Commit 40af9bbaa487caeca490009310efde19b211532e
Merge remote-tracking branch 'origin/test'
Showing
5 changed files
with
26 additions
and
16 deletions
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/ipt/CustomerInitClue.kt
1 | 1 | package cn.fw.valhalla.domain.db.ipt |
2 | 2 | |
3 | 3 | import cn.fw.common.annotation.NoArg |
4 | -import cn.fw.common.data.entity.BaseAuditableTimeEntity | |
4 | +import com.baomidou.mybatisplus.annotation.* | |
5 | +import com.baomidou.mybatisplus.extension.activerecord.Model | |
5 | 6 | import java.time.LocalDate |
6 | 7 | import java.time.LocalDateTime |
7 | 8 | |
... | ... | @@ -15,6 +16,8 @@ import java.time.LocalDateTime |
15 | 16 | */ |
16 | 17 | @NoArg |
17 | 18 | data class CustomerInitClue( |
19 | + @TableId(type = IdType.AUTO) | |
20 | + val id: Long? = null, | |
18 | 21 | val plateNo: String?, |
19 | 22 | val vin: String, |
20 | 23 | val brandName: String?, |
... | ... | @@ -33,4 +36,8 @@ data class CustomerInitClue( |
33 | 36 | val shopId: Long, |
34 | 37 | val groupId: Long, |
35 | 38 | val yn: Boolean, |
36 | -) : BaseAuditableTimeEntity<CustomerInitClue, Long>() | |
37 | 39 | \ No newline at end of file |
40 | + @TableField(insertStrategy = FieldStrategy.NOT_NULL, fill = FieldFill.INSERT) | |
41 | + val createTime: LocalDateTime? = null, | |
42 | + @TableField(updateStrategy = FieldStrategy.NOT_NULL, fill = FieldFill.INSERT_UPDATE) | |
43 | + val updateTime: LocalDateTime? = null | |
44 | +) : Model<CustomerInitClue>() | |
38 | 45 | \ No newline at end of file | ... | ... |
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/ipt/CustomerInitClueCallLog.kt
1 | 1 | package cn.fw.valhalla.domain.db.ipt |
2 | 2 | |
3 | 3 | import cn.fw.common.annotation.NoArg |
4 | -import cn.fw.common.data.entity.BaseEntity | |
4 | +import com.baomidou.mybatisplus.annotation.IdType | |
5 | +import com.baomidou.mybatisplus.annotation.TableId | |
6 | +import com.baomidou.mybatisplus.extension.activerecord.Model | |
5 | 7 | import java.time.LocalDateTime |
6 | 8 | |
7 | 9 | /** |
... | ... | @@ -14,9 +16,11 @@ import java.time.LocalDateTime |
14 | 16 | */ |
15 | 17 | @NoArg |
16 | 18 | data class CustomerInitClueCallLog( |
19 | + @TableId(type = IdType.AUTO) | |
20 | + val id: Long? = null, | |
17 | 21 | val clueId: Long, |
18 | 22 | val callId: String, |
19 | 23 | val talkTime: Int, |
20 | 24 | val recording: String?, |
21 | 25 | val uploadTime: LocalDateTime, |
22 | -) : BaseEntity<CustomerInitClueCallLog, Long>() | |
26 | +) : Model<CustomerInitClueCallLog>() | ... | ... |
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/ipt/CustomerInitClueVO.kt
... | ... | @@ -3,7 +3,6 @@ package cn.fw.valhalla.domain.vo.ipt |
3 | 3 | import cn.fw.common.annotation.NoArg |
4 | 4 | import java.time.LocalDate |
5 | 5 | import java.time.LocalDateTime |
6 | -import java.util.* | |
7 | 6 | |
8 | 7 | /** |
9 | 8 | * 期初档案数据 |
... | ... | @@ -58,5 +57,5 @@ data class CustomerInitClueVO( |
58 | 57 | /** 集团id */ |
59 | 58 | val groupId: Long, |
60 | 59 | /** 导入时间 */ |
61 | - val createTime: Date | |
60 | + val createTime: LocalDateTime? | |
62 | 61 | ) | ... | ... |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/task/CallHistoryTask.kt
... | ... | @@ -43,15 +43,13 @@ class CallHistoryTask( |
43 | 43 | /** |
44 | 44 | * 持久化通话记录 |
45 | 45 | */ |
46 | - @Scheduled(initialDelay = 1000 * 10, fixedRate = 1000 * 15) | |
46 | + @Scheduled(cron = "0/10 * * * * ?") | |
47 | 47 | fun dealCallHistory() { |
48 | 48 | val listOps = stringRedisTemplate.boundListOps(callReportKey) |
49 | 49 | val dataList = mutableListOf<String>() |
50 | 50 | for (i in 0..2000) { |
51 | - val dataStr = listOps.leftPop() | |
52 | - dataStr?.let { | |
53 | - dataList.add(dataStr) | |
54 | - } | |
51 | + val dataStr = listOps.leftPop() ?: break | |
52 | + dataList.add(dataStr) | |
55 | 53 | } |
56 | 54 | val mapper = jacksonObjectMapper() |
57 | 55 | CoroutineScope(Dispatchers.IO).launch { |
... | ... | @@ -88,7 +86,7 @@ class CallHistoryTask( |
88 | 86 | /** |
89 | 87 | * 拉取化通话录音 |
90 | 88 | */ |
91 | - @Scheduled(initialDelay = 1000 * 10, fixedRate = 1000 * 30) | |
89 | + @Scheduled(cron = "0/15 * * * * ?") | |
92 | 90 | fun dealCallRecordings() { |
93 | 91 | val list = customerInitClueCallLogService.list( |
94 | 92 | KtQueryWrapper(CustomerInitClueCallLog::class.java) | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/ipt/CustomerInitClueBizService.kt
... | ... | @@ -2,6 +2,7 @@ package cn.fw.valhalla.service.bus.ipt |
2 | 2 | |
3 | 3 | import cn.fw.common.data.mybatis.pagination.PageData |
4 | 4 | import cn.fw.common.page.AppPage |
5 | +import cn.fw.common.util.logInfo | |
5 | 6 | import cn.fw.valhalla.domain.db.ipt.CustomerInitClue |
6 | 7 | import cn.fw.valhalla.domain.db.ipt.CustomerInitClueCallLog |
7 | 8 | import cn.fw.valhalla.domain.dto.CallReportDTO |
... | ... | @@ -76,7 +77,7 @@ class CustomerInitClueBizService( |
76 | 77 | .orderByAsc(CustomerInitClueCallLog::uploadTime) |
77 | 78 | )?.map { |
78 | 79 | InitClueCallLogVO( |
79 | - id = it.id, | |
80 | + id = it?.id ?: -1, | |
80 | 81 | clueId = it.clueId, |
81 | 82 | callId = it.callId, |
82 | 83 | talkTime = it.talkTime, |
... | ... | @@ -109,9 +110,10 @@ class CustomerInitClueBizService( |
109 | 110 | .eq(CustomerInitClue::senderMobile, dto.peerNo) |
110 | 111 | } |
111 | 112 | ) |
112 | - return list?.mapNotNull { | |
113 | + return list?.map { | |
114 | + logInfo(it.toString()) | |
113 | 115 | CustomerInitClueCallLog( |
114 | - clueId = it.id, | |
116 | + clueId = it.id ?: -1, | |
115 | 117 | callId = dto.callId, |
116 | 118 | talkTime = dto.talkTime, |
117 | 119 | recording = null, |
... | ... | @@ -138,7 +140,7 @@ class CustomerInitClueBizService( |
138 | 140 | fun CustomerInitClue.toCustomerInitClueVO(fn: Function<Long, String>): CustomerInitClueVO { |
139 | 141 | val shopName = fn.apply(this.shopId) |
140 | 142 | return CustomerInitClueVO( |
141 | - id = this.id, | |
143 | + id = this.id ?: -1, | |
142 | 144 | plateNo = this.plateNo, |
143 | 145 | vin = this.vin, |
144 | 146 | brandName = this.brandName, | ... | ... |