Commit 1269a598c41a5e467dbcb39f0c7f47d2ed6a0c05

Authored by 张志伟
1 parent b7b93810

:fire: feat(*): 期初客户数据维护

- 期初客户数据维护
fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerImportMapper.java
1 1 package cn.fw.valhalla.dao.mapper;
2 2  
3   -import cn.fw.valhalla.domain.db.customer.CustomerContact;
4 3 import cn.fw.valhalla.domain.db.customer.CustomerImport;
5 4 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6 5 import org.springframework.stereotype.Repository;
... ...
fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerInitClueCallLogMapper.kt 0 → 100644
  1 +package cn.fw.valhalla.dao.mapper
  2 +
  3 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClueCallLog
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper
  5 +import org.springframework.stereotype.Repository
  6 +
  7 +/**
  8 + * 期初档案线索通话记录
  9 + *
  10 + * @author : kurisu
  11 + * @version : 2.0
  12 + * @desc : 期初档案线索通话记录
  13 + * @date : 2024-03-27 17:01
  14 + */
  15 +@Repository
  16 +interface CustomerInitClueCallLogMapper : BaseMapper<CustomerInitClueCallLog>
0 17 \ No newline at end of file
... ...
fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerInitClueMapper.kt 0 → 100644
  1 +package cn.fw.valhalla.dao.mapper
  2 +
  3 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClue
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper
  5 +import org.springframework.stereotype.Repository
  6 +
  7 +/**
  8 + * 期初档案线索
  9 + *
  10 + * @author : kurisu
  11 + * @version : 2.0
  12 + * @desc : 期初档案线索
  13 + * @date : 2024-03-27 17:01
  14 + */
  15 +@Repository
  16 +interface CustomerInitClueMapper : BaseMapper<CustomerInitClue>
0 17 \ No newline at end of file
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/ipt/CustomerInitClue.kt 0 → 100644
  1 +package cn.fw.valhalla.domain.db.ipt
  2 +
  3 +import cn.fw.common.annotation.NoArg
  4 +import cn.fw.common.data.entity.BaseAuditableTimeEntity
  5 +import java.time.LocalDate
  6 +import java.time.LocalDateTime
  7 +
  8 +/**
  9 + * 开帐导入档案线索(不做任何业务)
  10 + *
  11 + * @author : kurisu
  12 + * @version : 2.0
  13 + * @desc : 开帐导入档案线索(不做任何业务)
  14 + * @date : 2024-03-27 15:01
  15 + */
  16 +@NoArg
  17 +data class CustomerInitClue(
  18 + var plateNo: String?,
  19 + val vin: String,
  20 + var brandName: String?,
  21 + var seriesName: String?,
  22 + var specName: String?,
  23 + var engineNo: String?,
  24 + var buyDate: LocalDate?,
  25 + var customerName: String?,
  26 + val customerMobile: String,
  27 + var arrivalTime: LocalDateTime?,
  28 + var arrivalMileage: Int?,
  29 + var senderName: String?,
  30 + val senderMobile: String,
  31 + val adviserId: Long,
  32 + var adviserName: String?,
  33 + val shopId: Long,
  34 + val groupId: Long,
  35 + var yn: Boolean,
  36 +) : BaseAuditableTimeEntity<CustomerInitClue, Long>()
0 37 \ No newline at end of file
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/ipt/CustomerInitClueCallLog.kt 0 → 100644
  1 +package cn.fw.valhalla.domain.db.ipt
  2 +
  3 +import cn.fw.common.annotation.NoArg
  4 +import cn.fw.common.data.entity.BaseEntity
  5 +import java.time.LocalDateTime
  6 +
  7 +/**
  8 + * 初始线索通话记录
  9 + *
  10 + * @author : kurisu
  11 + * @version : 2.0
  12 + * @desc : 初始线索通话记录
  13 + * @date : 2024-03-27 16:47
  14 + */
  15 +@NoArg
  16 +data class CustomerInitClueCallLog(
  17 + val clueId: Long,
  18 + val callId: String,
  19 + val talkTime: Int,
  20 + var recording: String,
  21 + val uploadTime: LocalDateTime,
  22 +) : BaseEntity<CustomerInitClueCallLog, Long>()
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/InitClueQueryVO.kt 0 → 100644
  1 +package cn.fw.valhalla.domain.query
  2 +
  3 +import cn.fw.common.page.BasePageQuery
  4 +import cn.fw.common.web.annotation.LoginContextField
  5 +
  6 +/**
  7 + * 初期档案线索查询
  8 + *
  9 + * @author : kurisu
  10 + * @version : 2.0
  11 + * @desc : 初期档案线索查询
  12 + * @date : 2024-03-27 17:16
  13 + */
  14 +class InitClueQueryVO : BasePageQuery() {
  15 + var kw: String? = null
  16 +
  17 + @LoginContextField(LoginContextField.Name.USER_ID)
  18 + var adviserId: Long? = null
  19 +
  20 + @LoginContextField(LoginContextField.Name.GROUP_ID)
  21 + var groupId: Long? = null
  22 +}
0 23 \ No newline at end of file
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/ipt/CustomerInitClueVO.kt 0 → 100644
  1 +package cn.fw.valhalla.domain.vo.ipt
  2 +
  3 +import cn.fw.common.annotation.NoArg
  4 +import java.time.LocalDate
  5 +import java.time.LocalDateTime
  6 +import java.util.*
  7 +
  8 +/**
  9 + * 期初档案数据
  10 + *
  11 + * @author : kurisu
  12 + * @version : 2.0
  13 + * @desc : 期初档案数据
  14 + * @date : 2024-03-27 17:13
  15 + */
  16 +@NoArg
  17 +data class CustomerInitClueVO(
  18 + val id: Long,
  19 + val plateNo: String?,
  20 + val vin: String,
  21 + val brandName: String?,
  22 + val seriesName: String?,
  23 + val specName: String?,
  24 + val engineNo: String?,
  25 + val buyDate: LocalDate?,
  26 + val customerName: String?,
  27 + val customerMobile: String,
  28 + val arrivalTime: LocalDateTime?,
  29 + val arrivalMileage: Int?,
  30 + val senderName: String?,
  31 + val senderMobile: String,
  32 + val adviserId: Long,
  33 + val adviserName: String?,
  34 + val shopId: Long,
  35 + val shopName: String,
  36 + val groupId: Long,
  37 + val yn: Boolean,
  38 + val createTime: Date,
  39 + val updateTime: Date?,
  40 +)
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/ipt/InitClueCallLogVO.kt 0 → 100644
  1 +package cn.fw.valhalla.domain.vo.ipt
  2 +
  3 +import cn.fw.common.annotation.NoArg
  4 +import java.time.LocalDateTime
  5 +
  6 +/**
  7 + * 期初档案线索通话记录
  8 + *
  9 + * @author : kurisu
  10 + * @version : 2.0
  11 + * @desc : 期初档案线索通话记录
  12 + * @date : 2024-03-27 18:13
  13 + */
  14 +@NoArg
  15 +data class InitClueCallLogVO(
  16 + val id: Long,
  17 + val clueId: Long,
  18 + val callId: String,
  19 + val talkTime: Int,
  20 + val recording: String?,
  21 + val uploadTime: LocalDateTime,
  22 +)
... ...
fw-valhalla-rpc/pom.xml
... ... @@ -107,6 +107,10 @@
107 107 <groupId>cn.fw</groupId>
108 108 <artifactId>fw-hermes-sdk</artifactId>
109 109 </dependency>
  110 + <dependency>
  111 + <groupId>cn.fw</groupId>
  112 + <artifactId>fw-pstn-sdk</artifactId>
  113 + </dependency>
110 114 </dependencies>
111 115  
112 116 </project>
113 117 \ No newline at end of file
... ...
fw-valhalla-rpc/src/main/java/cn/fw/valhalla/rpc/pstn/PstnRpcService.kt 0 → 100644
  1 +package cn.fw.valhalla.rpc.pstn
  2 +
  3 +import cn.fw.common.util.logError
  4 +import cn.fw.pstn.sdk.api.PstnApiService
  5 +import org.springframework.stereotype.Service
  6 +
  7 +/**
  8 + * pstn rpc 服务
  9 + *
  10 + * @author : kurisu
  11 + * @version : 1.0
  12 + * @desc : pstn rpc 服务
  13 + * @date : 2024-03-27 16:51
  14 + */
  15 +@Service
  16 +class PstnRpcService(private val pstnApiService: PstnApiService) {
  17 + /**
  18 + * 查询通话录音
  19 + */
  20 + fun queryRecording(callId: String): String? {
  21 + try {
  22 + val msg = pstnApiService.queryCallDetail(callId)
  23 + if (!msg.isSuccess) {
  24 + logError("调用pstn api 查询通话详情异常:{}", msg.result)
  25 + return null
  26 + }
  27 + return msg?.data?.recording
  28 + } catch (e: Exception) {
  29 + logError("pstn统调用失败", e)
  30 + }
  31 + return ""
  32 + }
  33 +}
0 34 \ No newline at end of file
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/InitClueController.kt 0 → 100644
  1 +package cn.fw.valhalla.controller.app
  2 +
  3 +import cn.fw.common.page.AppPage
  4 +import cn.fw.common.web.annotation.ControllerMethod
  5 +import cn.fw.common.web.util.ResultBuilder.success
  6 +import cn.fw.data.base.domain.common.Message
  7 +import cn.fw.security.auth.client.annotation.Authorization
  8 +import cn.fw.security.auth.client.annotation.IgnoreAuth
  9 +import cn.fw.security.auth.client.enums.AuthType
  10 +import cn.fw.valhalla.domain.query.InitClueQueryVO
  11 +import cn.fw.valhalla.domain.vo.ipt.CustomerInitClueVO
  12 +import cn.fw.valhalla.service.bus.ipt.CustomerInitClueBizService
  13 +import org.springframework.validation.annotation.Validated
  14 +import org.springframework.web.bind.annotation.GetMapping
  15 +import org.springframework.web.bind.annotation.RequestMapping
  16 +import org.springframework.web.bind.annotation.RestController
  17 +
  18 +/**
  19 + * 事故车处理控制器
  20 + *
  21 + * @author : kurisu
  22 + * @version : 1.0
  23 + * @desc : 事故车处理控制器
  24 + * @date : 2024-02-29 17:50
  25 + */
  26 +@RestController
  27 +@Authorization(AuthType.APP)
  28 +@Validated
  29 +@RequestMapping("/app/init/customer")
  30 +class InitClueController(private val customerInitClueBizService: CustomerInitClueBizService) {
  31 + @IgnoreAuth
  32 + @GetMapping("/pool")
  33 + @ControllerMethod("查询档案期初数据")
  34 + fun customerPool(queryVO: InitClueQueryVO): Message<AppPage<CustomerInitClueVO>> {
  35 + return success(customerInitClueBizService.listPage(queryVO))
  36 + }
  37 +}
0 38 \ No newline at end of file
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/ipt/CustomerInitClueBizService.kt 0 → 100644
  1 +package cn.fw.valhalla.service.bus.ipt
  2 +
  3 +import cn.fw.common.data.mybatis.pagination.PageData
  4 +import cn.fw.common.page.AppPage
  5 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClue
  6 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClueCallLog
  7 +import cn.fw.valhalla.domain.query.InitClueQueryVO
  8 +import cn.fw.valhalla.domain.vo.AppPageVO
  9 +import cn.fw.valhalla.domain.vo.ipt.CustomerInitClueVO
  10 +import cn.fw.valhalla.domain.vo.ipt.InitClueCallLogVO
  11 +import cn.fw.valhalla.rpc.oop.OopService
  12 +import cn.fw.valhalla.service.data.CustomerInitClueCallLogService
  13 +import cn.fw.valhalla.service.data.CustomerInitClueService
  14 +import com.baomidou.mybatisplus.extension.kotlin.KtQueryWrapper
  15 +import org.springframework.stereotype.Service
  16 +import java.util.*
  17 +import java.util.function.Function
  18 +
  19 +/**
  20 + * 期初档案线索
  21 + *
  22 + * @author : kurisu
  23 + * @version : 2.0
  24 + * @desc : 期初档案线索
  25 + * @date : 2024-03-27 17:09
  26 + */
  27 +@Service
  28 +class CustomerInitClueBizService(
  29 + private val customerInitClueService: CustomerInitClueService,
  30 + private val customerInitClueCallLogService: CustomerInitClueCallLogService,
  31 + private val oopService: OopService
  32 +) {
  33 + /**
  34 + * 查询池子数据
  35 + */
  36 + fun listPage(query: InitClueQueryVO): AppPage<CustomerInitClueVO> {
  37 + val ipage = PageData<CustomerInitClue>(query)
  38 + val page: AppPageVO<CustomerInitClueVO> = AppPageVO.init(query)
  39 + val ktQuery = KtQueryWrapper(CustomerInitClue::class.java)
  40 + .eq(CustomerInitClue::yn, true)
  41 + .eq(CustomerInitClue::groupId, query.groupId)
  42 + .eq(Objects.nonNull(query.adviserId), CustomerInitClue::adviserId, query.adviserId)
  43 + .and(!query.kw.isNullOrBlank()) {
  44 + it.like(CustomerInitClue::plateNo, query.kw)
  45 + .or()
  46 + .like(CustomerInitClue::vin, query.kw)
  47 + .or()
  48 + .like(CustomerInitClue::customerName, query.kw)
  49 + .or()
  50 + .like(CustomerInitClue::senderName, query.kw)
  51 + }
  52 + customerInitClueService.page(ipage, ktQuery)
  53 + page.total = ipage.total
  54 + page.data = ipage.records?.mapNotNull {
  55 + it.toCustomerInitClueVO { id -> oopService.shop(id)?.shopName ?: "-" }
  56 + }
  57 + return page
  58 + }
  59 +
  60 + /**
  61 + * 查询具体线索通话记录
  62 + */
  63 + fun callLog(clueId: Long): List<InitClueCallLogVO> {
  64 + return customerInitClueCallLogService.list(
  65 + KtQueryWrapper(CustomerInitClueCallLog::class.java)
  66 + .eq(CustomerInitClueCallLog::clueId, clueId)
  67 + )?.map {
  68 + InitClueCallLogVO(
  69 + id = it.id,
  70 + clueId = it.clueId,
  71 + callId = it.callId,
  72 + talkTime = it.talkTime,
  73 + recording = it.recording,
  74 + uploadTime = it.uploadTime,
  75 + )
  76 + } ?: listOf()
  77 + }
  78 +}
  79 +
  80 +
  81 +fun CustomerInitClue.toCustomerInitClueVO(fn: Function<Long, String>): CustomerInitClueVO {
  82 + val shopName = fn.apply(this.shopId)
  83 + return CustomerInitClueVO(
  84 + id = this.id,
  85 + plateNo = this.plateNo,
  86 + vin = this.vin,
  87 + brandName = this.brandName,
  88 + seriesName = this.seriesName,
  89 + specName = this.specName,
  90 + engineNo = this.engineNo,
  91 + buyDate = this.buyDate,
  92 + customerName = this.customerName,
  93 + customerMobile = this.customerMobile,
  94 + arrivalTime = this.arrivalTime,
  95 + arrivalMileage = this.arrivalMileage,
  96 + senderName = this.senderName,
  97 + senderMobile = this.senderMobile,
  98 + adviserId = this.adviserId,
  99 + adviserName = this.adviserName,
  100 + shopId = this.shopId,
  101 + shopName = shopName,
  102 + groupId = this.groupId,
  103 + yn = this.yn,
  104 + createTime = this.createTime,
  105 + updateTime = this.updateTime,
  106 + )
  107 +}
  108 +
  109 +
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerInitClueCallLogService.kt 0 → 100644
  1 +package cn.fw.valhalla.service.data
  2 +
  3 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClueCallLog
  4 +import com.baomidou.mybatisplus.extension.service.IService
  5 +
  6 +/**
  7 + * 初期档案线索通话记录
  8 + *
  9 + * @author : kurisu
  10 + * @version : 2.0
  11 + * @desc : 初期档案线索通话记录
  12 + * @date : 2024-03-27 17:03
  13 + */
  14 +interface CustomerInitClueCallLogService : IService<CustomerInitClueCallLog> {
  15 +}
0 16 \ No newline at end of file
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerInitClueService.kt 0 → 100644
  1 +package cn.fw.valhalla.service.data
  2 +
  3 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClue
  4 +import com.baomidou.mybatisplus.extension.service.IService
  5 +
  6 +/**
  7 + * 初期档案线索
  8 + *
  9 + * @author : kurisu
  10 + * @version : 2.0
  11 + * @desc : 初期档案线索
  12 + * @date : 2024-03-27 17:03
  13 + */
  14 +interface CustomerInitClueService : IService<CustomerInitClue> {
  15 +}
0 16 \ No newline at end of file
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerInitClueCallLogServiceImpl.kt 0 → 100644
  1 +package cn.fw.valhalla.service.data.impl
  2 +
  3 +import cn.fw.valhalla.dao.mapper.CustomerInitClueCallLogMapper
  4 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClueCallLog
  5 +import cn.fw.valhalla.service.data.CustomerInitClueCallLogService
  6 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
  7 +import org.springframework.stereotype.Service
  8 +
  9 +/**
  10 + * 初期档案线索通话记录
  11 + *
  12 + * @author : kurisu
  13 + * @version : 2.0
  14 + * @desc : 初期档案线索通话记录
  15 + * @date : 2024-03-27 17:05
  16 + */
  17 +@Service
  18 +class CustomerInitClueCallLogServiceImpl : ServiceImpl<CustomerInitClueCallLogMapper, CustomerInitClueCallLog>(),
  19 + CustomerInitClueCallLogService {
  20 +}
0 21 \ No newline at end of file
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerInitClueServiceImpl.kt 0 → 100644
  1 +package cn.fw.valhalla.service.data.impl
  2 +
  3 +import cn.fw.valhalla.dao.mapper.CustomerInitClueMapper
  4 +import cn.fw.valhalla.domain.db.ipt.CustomerInitClue
  5 +import cn.fw.valhalla.service.data.CustomerInitClueService
  6 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
  7 +import org.springframework.stereotype.Service
  8 +
  9 +/**
  10 + * 初期档案线索
  11 + *
  12 + * @author : kurisu
  13 + * @version : 2.0
  14 + * @desc : 初期档案线索
  15 + * @date : 2024-03-27 17:05
  16 + */
  17 +@Service
  18 +class CustomerInitClueServiceImpl : ServiceImpl<CustomerInitClueMapper, CustomerInitClue>(), CustomerInitClueService {
  19 +}
0 20 \ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@
12 12 <parent>
13 13 <groupId>cn.fw</groupId>
14 14 <artifactId>fw-common-dependencies</artifactId>
15   - <version>3.5.0</version>
  15 + <version>3.6.0</version>
16 16 </parent>
17 17  
18 18 <modules>
... ... @@ -63,6 +63,7 @@
63 63 <geodesy>1.1.3</geodesy>
64 64 <yitter.idgenerator>1.0.3</yitter.idgenerator>
65 65 <fw.hestia.sdk>1.0.0</fw.hestia.sdk>
  66 + <fw-pstn-sdk.version>2.0.2</fw-pstn-sdk.version>
66 67 <fw.backlog.sdk>1.0.0</fw.backlog.sdk>
67 68 <fw.shirasawa.sdk>1.1.6</fw.shirasawa.sdk>
68 69 <fw-identify-sdk.version>1.0.0</fw-identify-sdk.version>
... ... @@ -189,6 +190,11 @@
189 190 </dependency>
190 191 <dependency>
191 192 <groupId>cn.fw</groupId>
  193 + <artifactId>fw-pstn-sdk</artifactId>
  194 + <version>${fw-pstn-sdk.version}</version>
  195 + </dependency>
  196 + <dependency>
  197 + <groupId>cn.fw</groupId>
192 198 <artifactId>fw-cas-sdk</artifactId>
193 199 <version>${fw.cas.sdk}</version>
194 200 </dependency>
... ...