65610b54
张志伟
|
1
2
|
package cn.fw.valhalla.service.bus.follow.strategy.impl;
|
dac2e8b1
张志伟
|
3
|
import cn.fw.common.exception.BusinessException;
|
725fb553
张志伟
|
4
|
import cn.fw.valhalla.common.constant.RoleCode;
|
ad395b9c
张志伟
|
5
|
import cn.fw.valhalla.common.utils.DateUtil;
|
b2f969bd
张志伟
|
6
|
import cn.fw.valhalla.common.utils.MobileUtil;
|
ad395b9c
张志伟
|
7
|
import cn.fw.valhalla.domain.db.OriginalData;
|
23b952c1
张志伟
|
8
|
import cn.fw.valhalla.domain.db.customer.Customer;
|
ad395b9c
张志伟
|
9
|
import cn.fw.valhalla.domain.db.follow.FollowNoticeRecord;
|
65610b54
张志伟
|
10
|
import cn.fw.valhalla.domain.db.follow.FollowRecord;
|
3ac8e84c
张志伟
|
11
|
import cn.fw.valhalla.domain.db.follow.FollowRecordLog;
|
08704989
张志伟
|
12
|
import cn.fw.valhalla.domain.db.follow.FollowTask;
|
8587e21d
张志伟
|
13
|
import cn.fw.valhalla.domain.db.pool.CustomerCluePool;
|
65610b54
张志伟
|
14
|
import cn.fw.valhalla.domain.dto.CustomerDetailDto;
|
b2f969bd
张志伟
|
15
|
import cn.fw.valhalla.domain.dto.FollowAttachmentDTO;
|
ad395b9c
张志伟
|
16
|
import cn.fw.valhalla.domain.enums.*;
|
b2f969bd
张志伟
|
17
|
import cn.fw.valhalla.domain.vo.follow.*;
|
ad395b9c
张志伟
|
18
|
import cn.fw.valhalla.domain.vo.setting.SettingVO;
|
65610b54
张志伟
|
19
|
import cn.fw.valhalla.rpc.angel.dto.InsuranceDTO;
|
725fb553
张志伟
|
20
|
import cn.fw.valhalla.rpc.erp.dto.PostUserDTO;
|
68cd8666
张志伟
|
21
|
import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO;
|
23b952c1
张志伟
|
22
|
import cn.fw.valhalla.rpc.oop.dto.ShopDTO;
|
65610b54
张志伟
|
23
|
import cn.fw.valhalla.service.bus.follow.strategy.AbstractFollowStrategy;
|
fa966283
张志伟
📝 v1.0.1调整
|
24
|
import cn.fw.valhalla.service.event.CancelApproveEvent;
|
08704989
张志伟
|
25
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
65610b54
张志伟
|
26
27
|
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
|
08704989
张志伟
|
28
|
import org.springframework.transaction.annotation.Transactional;
|
65610b54
张志伟
|
29
30
|
import org.springframework.util.CollectionUtils;
|
ad395b9c
张志伟
|
31
|
import java.sql.Timestamp;
|
3a2863b4
张志伟
|
32
|
import java.time.LocalDateTime;
|
ad395b9c
张志伟
|
33
34
|
import java.util.*;
import java.util.stream.Collectors;
|
65610b54
张志伟
|
35
|
|
b2f969bd
张志伟
|
36
37
|
import static cn.fw.common.businessvalidator.Validator.BV;
|
65610b54
张志伟
|
38
39
40
41
42
43
44
45
|
/**
* @author : kurisu
* @className : IRFollowStrategy
* @description : 续保策略
* @date: 2020-08-17 10:48
*/
@Slf4j
@Component
|
f36f3da7
张志伟
|
46
|
@SuppressWarnings("Duplicates")
|
65610b54
张志伟
|
47
48
49
50
51
52
53
54
|
public class IRFollowStrategy extends AbstractFollowStrategy {
@Override
public FollowTypeEnum getFollowType() {
return FollowTypeEnum.IR;
}
@Override
public List<FollowTodoListVO> getList(Integer startIndex, Integer pageSize, Long userId) {
|
23b952c1
张志伟
|
55
|
List<FollowRecord> list = list(startIndex, pageSize, userId, getFollowType());
|
65610b54
张志伟
|
56
57
58
59
60
61
62
63
64
65
|
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
}
List<FollowTodoListVO> voList = new ArrayList<>();
for (FollowRecord followRecord : list) {
IRTodoListVO vo = new IRTodoListVO();
vo.setId(followRecord.getId());
vo.setTaskId(followRecord.getTaskId());
vo.setCustomerId(followRecord.getCustomerId());
vo.setDeadline(followRecord.getDeadline());
|
91c29e23
张志伟
|
66
|
CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId());
|
65610b54
张志伟
|
67
68
|
vo.setName(customerDetailDto.getName());
vo.setCarImage(customerDetailDto.getCarImage());
|
6d5a775e
张志伟
|
69
|
vo.setPlateNo(customerDetailDto.getPlateNo());
|
65610b54
张志伟
|
70
71
72
73
74
75
76
77
78
|
Optional<InsuranceDTO> insuranceDTO = queryInsuInfo(followRecord.getCustomerId());
insuranceDTO.ifPresent(ins -> {
vo.setInsComName(ins.getInsurerName());
vo.setInsExpiration(ins.getExpiryDate());
});
voList.add(vo);
}
return voList;
}
|
b2f969bd
张志伟
|
79
80
|
@Override
|
376d3231
张志伟
✨ 主动放弃跟进 100%
|
81
|
public FollowDetailVO getDetail(Long id) {
|
b2f969bd
张志伟
|
82
83
|
FollowRecord followRecord = followRecordService.getById(id);
BV.notNull(followRecord, "跟进记录不存在");
|
fa966283
张志伟
📝 v1.0.1调整
|
84
|
IRDetailVO vo = assemble(followRecord.getCustomerId());
|
3ac8e84c
张志伟
|
85
86
87
88
89
|
int count = followRecordLogService.count(Wrappers.<FollowRecordLog>lambdaQuery()
.eq(FollowRecordLog::getRecordId, followRecord.getId())
.eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE)
);
vo.setHadCall(count > 0);
|
b2f969bd
张志伟
|
90
|
vo.setId(followRecord.getId());
|
b2f969bd
张志伟
|
91
92
|
vo.setTaskId(followRecord.getTaskId());
vo.setDeadline(followRecord.getDeadline());
|
b2f969bd
张志伟
|
93
94
95
96
97
98
99
100
101
|
return vo;
}
@Override
public List<FollowRecordVO> getRecordList(Long taskId) {
return super.getRecordList(taskId);
}
@Override
|
b2f969bd
张志伟
|
102
103
104
|
public void uploadAtt(FollowAttachmentDTO dto, Long userId) {
super.uploadAtt(dto, userId);
}
|
08704989
张志伟
|
105
106
107
108
|
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelFollowTask(Long customerId, Date time, Long groupId) {
|
8587e21d
张志伟
|
109
110
111
112
113
114
115
|
CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(customerId, groupId, getFollowType());
if (Objects.isNull(cluePool)) {
return;
}
if (ClueStatusEnum.WAITING.equals(cluePool.getClueStatus())) {
customerCluePoolService.removeById(cluePool.getId());
followNoticeRecordService.removeByClueId(cluePool.getId());
|
08704989
张志伟
|
116
|
}
|
8587e21d
张志伟
|
117
118
119
120
121
122
|
if (ClueStatusEnum.ONGOING.equals(cluePool.getClueStatus())) {
customerCluePoolService.removeById(cluePool.getId());
followNoticeRecordService.removeByClueId(cluePool.getId());
cancelFollowTodo(cluePool.getRefererId(), getFollowType());
}
//暂不考虑退单回滚的情况
|
08704989
张志伟
|
123
|
}
|
ad395b9c
张志伟
|
124
125
126
127
|
@Override
@Transactional(rollbackFor = Exception.class)
public void settingChanged(List<SettingVO> setting, Long groupId) {
|
8587e21d
张志伟
|
128
129
130
131
|
List<CustomerCluePool> poolList = customerCluePoolService.list(Wrappers.<CustomerCluePool>lambdaQuery()
.eq(CustomerCluePool::getClueType, getFollowType())
.eq(CustomerCluePool::getGroupId, groupId)
.eq(CustomerCluePool::getClueStatus, ClueStatusEnum.WAITING)
|
ad395b9c
张志伟
|
132
|
);
|
8587e21d
张志伟
|
133
134
|
if (CollectionUtils.isEmpty(poolList)) {
|
ad395b9c
张志伟
|
135
136
|
return;
}
|
8587e21d
张志伟
|
137
|
this.updateClue(poolList, setting);
|
ad395b9c
张志伟
|
138
139
|
SettingVO noticeSetting = setting.stream().filter(r -> SettingTypeEnum.FIRST_NOTICE_TIME.getValue().equals(r.getType())).findFirst().orElse(new SettingVO());
|
8587e21d
张志伟
|
140
|
this.updateNoticeRecord(poolList, noticeSetting);
|
ad395b9c
张志伟
|
141
142
143
|
}
@Override
|
8587e21d
张志伟
|
144
|
protected void updateClue(List<CustomerCluePool> list, List<SettingVO> setting) {
|
ad395b9c
张志伟
|
145
146
147
148
149
150
151
152
|
for (SettingVO vo : setting) {
final Integer unit = vo.getUnit();
final int value = Optional.ofNullable(vo.getDetailValue()).orElse(0);
SettingUnitEnum unitEnum = SettingUnitEnum.ofValue(unit);
if (SettingTypeEnum.FIRST_TRIGGER_TIME.getValue().equals(vo.getType())) {
if (Objects.nonNull(unitEnum) && value > 0) {
final int calendarType = getCalendarType(unitEnum);
|
8587e21d
张志伟
|
153
154
|
list.forEach(clue -> {
Date originTime = clue.getAddTime();
|
23b952c1
张志伟
|
155
|
Timestamp timestamp = DateUtil.getExpired(originTime, -1 * value, calendarType);
|
8587e21d
张志伟
|
156
|
clue.setStartTime(timestamp);
|
ad395b9c
张志伟
|
157
158
159
|
});
}
}
|
ad395b9c
张志伟
|
160
|
}
|
8587e21d
张志伟
|
161
|
customerCluePoolService.updateBatchById(list);
|
ad395b9c
张志伟
|
162
163
164
165
166
167
168
169
170
|
}
/**
* 更新服务号消息记录
*
* @param list
* @param vo
*/
@Override
|
8587e21d
张志伟
|
171
172
|
protected void updateNoticeRecord(List<CustomerCluePool> list, SettingVO vo) {
List<Long> idList = list.stream().map(CustomerCluePool::getId).collect(Collectors.toList());
|
ad395b9c
张志伟
|
173
174
|
List<FollowNoticeRecord> noticeList = followNoticeRecordService.list(Wrappers.<FollowNoticeRecord>lambdaQuery()
.eq(FollowNoticeRecord::getStatus, SendStatusEnum.NOT_SENT)
|
8587e21d
张志伟
|
175
|
.in(FollowNoticeRecord::getClueId, idList)
|
ad395b9c
张志伟
|
176
177
178
179
180
181
182
183
|
);
Integer unit = vo.getUnit();
int value = Optional.ofNullable(vo.getDetailValue()).orElse(0);
SettingUnitEnum unitEnum = SettingUnitEnum.ofValue(unit);
if (Objects.isNull(unitEnum) || value <= 0) {
return;
}
final int calendarType = getCalendarType(unitEnum);
|
8587e21d
张志伟
|
184
|
for (CustomerCluePool clue : list) {
|
ad395b9c
张志伟
|
185
|
for (FollowNoticeRecord noticeRecord : noticeList) {
|
8587e21d
张志伟
|
186
187
|
if (clue.getId().equals(noticeRecord.getClueId())) {
Date originTime = clue.getAddTime();
|
23b952c1
张志伟
|
188
|
Timestamp timestamp = DateUtil.getExpired(originTime, -1 * value, calendarType);
|
ad395b9c
张志伟
|
189
190
191
192
193
194
195
|
noticeRecord.setSendTime(timestamp);
}
}
}
followNoticeRecordService.updateBatchById(noticeList);
}
|
23b952c1
张志伟
|
196
197
198
|
@Override
@Transactional(rollbackFor = Exception.class)
|
dac2e8b1
张志伟
|
199
|
public boolean origin2task(OriginalData originalData) throws Exception {
|
23b952c1
张志伟
|
200
|
Customer customer = customerService.queryById(originalData.getCustomerId());
|
dac2e8b1
张志伟
|
201
|
BV.notNull(customer, () -> "档案不存在");
|
8587e21d
张志伟
|
202
203
204
|
CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(customer.getId(), customer.getGroupId(), getFollowType());
completeClue(cluePool, originalData);
CustomerCluePool clue = this.createClueInfo(originalData, getFollowType(), customer);
|
dac2e8b1
张志伟
|
205
|
BV.notNull(clue, () -> "生成跟进线索失败");
|
8587e21d
张志伟
|
206
207
208
|
customerCluePoolService.save(clue);
this.createFirstNotice(clue, originalData.getGenerateTime());
return true;
|
23b952c1
张志伟
|
209
210
|
}
|
23b952c1
张志伟
|
211
|
@Override
|
8587e21d
张志伟
|
212
213
214
|
@Transactional(rollbackFor = Exception.class)
public void updateTask(Long customerId) {
//续保跟进与服务顾问无关
|
23b952c1
张志伟
|
215
216
|
}
|
ad395b9c
张志伟
|
217
|
@Override
|
23b952c1
张志伟
|
218
|
@Transactional(rollbackFor = Exception.class)
|
dac2e8b1
张志伟
|
219
|
public void closeTask(FollowTask task) throws BusinessException {
|
172cb4a3
张志伟
|
220
|
task.setState(TaskStateEnum.DEFEAT);
|
9b497427
张志伟
|
221
222
223
|
task.setCloseTime(new Date());
if (Boolean.TRUE.equals(task.getRedistribution())) {
task.setReason(TaskDefeatTypeEnum.C);
|
9b497427
张志伟
|
224
|
} else {
|
24f07d55
张志伟
|
225
|
task.setReason(TaskDefeatTypeEnum.C);
|
9b497427
张志伟
|
226
227
|
final Long clueId = task.getClueId();
CustomerCluePool cluePool = customerCluePoolService.getById(clueId);
|
61dc3387
张志伟
|
228
229
230
|
if (Objects.nonNull(cluePool)) {
if (Boolean.FALSE.equals(cluePool.getRedistribution()) &&
LocalDateTime.now().isBefore((DateUtil.date2LocalDateTime(cluePool.getDeadline())))) {
|
24f07d55
张志伟
|
231
|
task.setReason(TaskDefeatTypeEnum.B);
|
61dc3387
张志伟
|
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
PostUserDTO followUser = customerChangeBizService.changeInsFollowUser(task);
if (Objects.isNull(followUser)) {
task.setReason(null);
task.setState(TaskStateEnum.ONGOING);
task.setCloseTime(null);
task.setDeadline(cluePool.getDeadline());
followTaskService.updateById(task);
return;
}
cluePool.setRedistribution(Boolean.TRUE);
customerCluePoolService.updateById(cluePool);
FollowTask followTask = createTask(cluePool, true);
followTask.setFollowUser(followUser.getUserId());
followTask.setFollowUserName(followUser.getUserName());
followTask.setFollowShop(task.getFollowShop());
followTaskService.save(followTask);
startTask(followTask, true);
} else {
cluePool.setCloseTime(new Date());
cluePool.setClueStatus(ClueStatusEnum.FAILURE);
customerCluePoolService.updateById(cluePool);
|
dac2e8b1
张志伟
|
253
|
}
|
9b497427
张志伟
|
254
255
|
}
}
|
a19dc9c5
张志伟
|
256
|
followTaskService.updateById(task);
|
9b497427
张志伟
|
257
258
|
CancelApproveEvent event = new CancelApproveEvent(task.getId(), ApproveTypeEnum.FOLLOW_DEFEAT);
eventPublisher.publishEvent(event);
|
612d25d9
张志伟
|
259
260
261
262
263
264
|
}
@Override
@Transactional(rollbackFor = Exception.class)
public void overdueProcessing(FollowRecord record) {
super.overdueProcessing(record);
|
23b952c1
张志伟
|
265
266
|
}
|
fa966283
张志伟
📝 v1.0.1调整
|
267
268
269
270
271
272
273
|
@Override
public FollowDetailVO followPoolDetail(FollowTask task) {
IRDetailVO vo = assemble(task.getCustomerId());
vo.setTaskId(task.getId());
return vo;
}
|
23b952c1
张志伟
|
274
275
276
|
/**
* 生成消息推送
*
|
8587e21d
张志伟
|
277
278
|
* @param cluePool
* @param time
|
23b952c1
张志伟
|
279
280
|
*/
@Override
|
8587e21d
张志伟
|
281
|
@Transactional(rollbackFor = Exception.class)
|
9b497427
张志伟
|
282
|
protected void createFirstNotice(final CustomerCluePool cluePool, final Date time) {
|
8587e21d
张志伟
|
283
|
if (!cluePool.getDeadline().after(cluePool.getStartTime()) || !cluePool.getDeadline().after(DateUtil.localDateTime2Date(LocalDateTime.now()))) {
|
9b497427
张志伟
|
284
|
return;
|
3a2863b4
张志伟
|
285
|
}
|
23b952c1
张志伟
|
286
|
final FollowNoticeRecord record = new FollowNoticeRecord();
|
8587e21d
张志伟
|
287
288
|
record.setClueId(cluePool.getId());
record.setCustomerId(cluePool.getRefererId());
|
23b952c1
张志伟
|
289
|
record.setStatus(SendStatusEnum.NOT_SENT);
|
8587e21d
张志伟
|
290
291
|
settingBizService.querySettingByType(getFollowType(), SettingTypeEnum.FIRST_NOTICE_TIME, cluePool.getGroupId())
.ifPresent(r -> record.setSendTime(calDate(r, time, true)));
|
23b952c1
张志伟
|
292
|
record.setCreateTime(new Date());
|
8587e21d
张志伟
|
293
|
record.setFollowType(getFollowType());
|
9b497427
张志伟
|
294
|
followNoticeRecordService.save(record);
|
23b952c1
张志伟
|
295
|
}
|
ad395b9c
张志伟
|
296
|
|
8587e21d
张志伟
|
297
|
@Override
|
c4ac5c54
张志伟
|
298
|
protected CustomerCluePool createClueInfo(final OriginalData originalData, FollowTypeEnum followType, Customer customer) {
|
8587e21d
张志伟
|
299
300
301
302
303
304
305
306
|
final CustomerCluePool pool = new CustomerCluePool();
pool.setClueType(followType);
pool.setAddTime(originalData.getGenerateTime());
pool.setClueStatus(ClueStatusEnum.WAITING);
pool.setRedistribution(Boolean.FALSE);
pool.setGroupId(originalData.getGroupId());
pool.setCreateTime(new Date());
settingBizService.querySettingByType(followType, SettingTypeEnum.FIRST_TRIGGER_TIME, originalData.getGroupId())
|
788d0ffd
张志伟
|
307
|
.ifPresent(r -> pool.setStartTime(calDate(r, originalData.getGenerateTime(), true)));
|
23b952c1
张志伟
|
308
|
|
c4ac5c54
张志伟
|
309
|
pool.setDeadline(originalData.getGenerateTime());
|
8587e21d
张志伟
|
310
311
312
|
pool.setRefererId(customer.getId());
pool.setFrameNo(customer.getFrameNo());
pool.setPlateNo(customer.getPlateNo());
|
23b952c1
张志伟
|
313
|
|
aa3c5e29
张志伟
|
314
|
ShopDTO shop = oopService.shop(customer.getShopId());
|
8587e21d
张志伟
|
315
|
if (Objects.nonNull(shop)) {
|
ae766fec
张志伟
|
316
|
pool.setOriginalShopName(shop.getShortName());
|
23b952c1
张志伟
|
317
|
}
|
8587e21d
张志伟
|
318
|
pool.setOriginalShopId(customer.getShopId());
|
d70c5e5d
张志伟
|
319
|
List<PostUserDTO> userByRole = userService.getUserByRole(customer.getShopId(), RoleCode.XBGJ);
|
8587e21d
张志伟
|
320
|
BV.isFalse(CollectionUtils.isEmpty(userByRole), () -> "该门店没有续保跟进人员");
|
8587e21d
张志伟
|
321
322
323
324
325
326
327
328
329
330
|
Collections.shuffle(userByRole);
PostUserDTO userDTO = userByRole.get(0);
pool.setOriginalUserId(userDTO.getUserId());
pool.setOriginalUserName(userDTO.getUserName());
if (shop.getId().equals(customer.getShopId())) {
Optional<PostUserDTO> dto = userByRole.stream().filter(u -> u.getUserId().equals(customer.getAdviserId())).findFirst();
dto.ifPresent(d -> {
pool.setOriginalUserId(d.getUserId());
pool.setOriginalUserName(d.getUserName());
});
|
23b952c1
张志伟
|
331
|
}
|
8587e21d
张志伟
|
332
|
return pool;
|
ad395b9c
张志伟
|
333
|
}
|
fa966283
张志伟
📝 v1.0.1调整
|
334
|
|
68cd8666
张志伟
|
335
336
337
338
339
340
341
342
343
|
@Transactional(rollbackFor = Exception.class)
@Override
protected void completeClue(CustomerCluePool cluePool, OriginalData originalData) {
if (Objects.isNull(cluePool)) {
return;
}
if (ClueStatusEnum.COMPLETE.equals(cluePool.getClueStatus()) || ClueStatusEnum.FAILURE.equals(cluePool.getClueStatus())) {
return;
}
|
99e77aad
张志伟
|
344
345
346
347
|
if (ClueStatusEnum.WAITING.equals(cluePool.getClueStatus())) {
customerCluePoolService.removeById(cluePool.getId());
return;
}
|
68cd8666
张志伟
|
348
349
|
LocalDateTime deadline = DateUtil.date2LocalDateTime(cluePool.getDeadline());
if (deadline.isAfter(DateUtil.date2LocalDateTime(DateUtil.getExpiredYear(originalData.getGenerateTime(), -1)))) {
|
68cd8666
张志伟
|
350
351
|
if (cluePool.getOriginalShopId().equals(originalData.getShopId())) {
cluePool.setFinishUserId(cluePool.getOriginalUserId());
|
99e77aad
张志伟
|
352
353
354
355
356
357
358
359
360
361
362
363
364
365
|
cluePool.setFinishUserName(cluePool.getOriginalUserName());
cluePool.setFinishShopId(cluePool.getOriginalShopId());
cluePool.setFinishShopName(cluePool.getOriginalShopName());
} else {
UserInfoDTO user = userService.user(originalData.getUserId());
cluePool.setFinishUserId(originalData.getUserId());
if (Objects.nonNull(user)) {
cluePool.setFinishUserName(user.getUserName());
}
ShopDTO shop = oopService.shop(originalData.getShopId());
cluePool.setFinishShopId(originalData.getShopId());
if (Objects.nonNull(shop)) {
cluePool.setFinishShopName(shop.getShortName());
}
|
68cd8666
张志伟
|
366
|
}
|
135746d3
张志伟
|
367
|
cluePool.setCloseTime(DateUtil.getExpiredYear(originalData.getGenerateTime(), -1));
|
68cd8666
张志伟
|
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
|
cluePool.setClueStatus(ClueStatusEnum.COMPLETE);
customerCluePoolService.updateById(cluePool);
this.completeTask(cluePool);
}
}
/**
* 处理进行中的跟进任务
*
* @param cluePool
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void completeTask(CustomerCluePool cluePool) {
FollowTask followTask = followTaskService.queryOngoingTaskByClueId(cluePool.getId());
if (Objects.isNull(followTask)) {
return;
}
followTask.setFinishUser(cluePool.getFinishUserId());
followTask.setFinishUserName(cluePool.getFinishUserName());
followTask.setFinishShop(cluePool.getFinishShopId());
followTask.setCloseTime(cluePool.getCloseTime());
boolean equals = followTask.getFollowShop().equals(cluePool.getFinishShopId());
followTask.setState(equals ? TaskStateEnum.COMPLETE : TaskStateEnum.DEFEAT);
if (!equals) {
|
0e485f5d
张志伟
:construction_wor...
|
394
|
followTask.setReason(TaskDefeatTypeEnum.F);
|
68cd8666
张志伟
|
395
396
397
398
399
400
401
402
403
404
|
}
boolean succeed = followTaskService.updateById(followTask);
if (succeed) {
completeTodo(followTask.getId());
followNoticeRecordService.removeByClueId(followTask.getId());
CancelApproveEvent event = new CancelApproveEvent(followTask.getId(), ApproveTypeEnum.FOLLOW_DEFEAT);
eventPublisher.publishEvent(event);
}
}
|
fa966283
张志伟
📝 v1.0.1调整
|
405
406
|
@Override
public IRDetailVO assemble(Long customerId) {
|
91c29e23
张志伟
|
407
|
CustomerDetailDto detailDto = customerBizService.queryById(customerId);
|
fa966283
张志伟
📝 v1.0.1调整
|
408
409
410
411
412
413
414
415
416
417
418
|
IRDetailVO vo = new IRDetailVO();
vo.setCustomerId(customerId);
vo.setAdviserId(detailDto.getAdviserId());
vo.setAdviserName(detailDto.getAdviserName());
vo.setVin(detailDto.getFrameNo());
vo.setName(detailDto.getName());
vo.setMobile(detailDto.getMobile());
vo.setRegion(MobileUtil.attribution(detailDto.getMobile()));
vo.setRealMobile(detailDto.getMobile());
vo.setPlateNo(detailDto.getPlateNo());
vo.setCarModel(detailDto.getBrandName() + " " + detailDto.getSeriesName());
|
f7ea0ff7
张志伟
|
419
420
421
|
vo.setExpires(detailDto.getExpires());
vo.setPeriods(detailDto.getPeriods());
vo.setLoanCustomer(detailDto.isLoanCustomer());
|
fa966283
张志伟
📝 v1.0.1调整
|
422
423
424
425
426
427
428
429
430
|
Optional<InsuranceDTO> insuranceDTO = queryInsuInfo(customerId);
insuranceDTO.ifPresent(ins -> {
vo.setTclInsComName(ins.getTciInsurerName());
vo.setTclInsExpiration(ins.getTciExpiryDate());
vo.setBusInsComName(ins.getInsurerName());
vo.setBusInsExpiration(ins.getExpiryDate());
});
return vo;
}
|
65610b54
张志伟
|
431
|
}
|