Commit 51a118ce8d0994f2bb4108bff673b9f92ae40e26

Authored by 张志伟
1 parent d811ff96

:sparkles: bug调整

fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java
@@ -23,6 +23,7 @@ public class FollowDetailVO { @@ -23,6 +23,7 @@ public class FollowDetailVO {
23 * 档案id 23 * 档案id
24 */ 24 */
25 private Long customerId; 25 private Long customerId;
  26 + private Integer type;
26 /** 27 /**
27 * 名称 28 * 名称
28 */ 29 */
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java
@@ -82,14 +82,11 @@ public class FollowController { @@ -82,14 +82,11 @@ public class FollowController {
82 82
83 @GetMapping("/approve/detail") 83 @GetMapping("/approve/detail")
84 @IgnoreAuth 84 @IgnoreAuth
85 - public Message<FollowDetailVO> approveDetail(@NotNull(message = "跟进记录id不能为空") final Long recordId,  
86 - @NotNull(message = "跟进类型不能为空") final Integer type) { 85 + public Message<FollowDetailVO> approveDetail(@NotNull(message = "跟进记录id不能为空") final Long recordId, final Integer type) {
87 final String msg = "查询跟进战败审批详情[follow/approve/detail]"; 86 final String msg = "查询跟进战败审批详情[follow/approve/detail]";
88 try { 87 try {
89 log.info("{}: param[{} {}]", msg, recordId, type); 88 log.info("{}: param[{} {}]", msg, recordId, type);
90 - FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type);  
91 - BV.notNull(typeEnum, "跟进类型不正确");  
92 - FollowDetailVO detailVO = followBizService.approveDetail(recordId, typeEnum); 89 + FollowDetailVO detailVO = followBizService.approveDetail(recordId, type);
93 return success(detailVO, data -> log.info("{}", data)); 90 return success(detailVO, data -> log.info("{}", data));
94 } catch (Exception ex) { 91 } catch (Exception ex) {
95 handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, recordId, type, e)); 92 handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, recordId, type, e));
@@ -99,14 +96,11 @@ public class FollowController { @@ -99,14 +96,11 @@ public class FollowController {
99 96
100 @GetMapping("/todo/record") 97 @GetMapping("/todo/record")
101 @IgnoreAuth 98 @IgnoreAuth
102 - public Message<List<FollowRecordVO>> todoRecord(@NotNull(message = "跟进任务id不能为空") final Long taskId,  
103 - @NotNull(message = "跟进类型不能为空") final Integer type) { 99 + public Message<List<FollowRecordVO>> todoRecord(@NotNull(message = "跟进任务id不能为空") final Long taskId, final Integer type) {
104 final String msg = "查询跟进历史记录[follow/todo/record]"; 100 final String msg = "查询跟进历史记录[follow/todo/record]";
105 try { 101 try {
106 log.info("{}: param[{} {}]", msg, taskId, type); 102 log.info("{}: param[{} {}]", msg, taskId, type);
107 - FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type);  
108 - BV.notNull(typeEnum, "跟进类型不正确");  
109 - return success(followBizService.todoRecord(taskId, typeEnum), data -> log.info("{}", data)); 103 + return success(followBizService.todoRecord(taskId, type), data -> log.info("{}", data));
110 } catch (Exception ex) { 104 } catch (Exception ex) {
111 handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, taskId, type, e)); 105 handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, taskId, type, e));
112 return failureWithMessage(QUERY_FAILURE); 106 return failureWithMessage(QUERY_FAILURE);
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AccidentPoolBizService.java
@@ -4,6 +4,7 @@ import cn.fw.common.cache.locker.DistributedLocker; @@ -4,6 +4,7 @@ import cn.fw.common.cache.locker.DistributedLocker;
4 import cn.fw.common.web.auth.LoginAuthBean; 4 import cn.fw.common.web.auth.LoginAuthBean;
5 import cn.fw.valhalla.common.constant.RoleCode; 5 import cn.fw.valhalla.common.constant.RoleCode;
6 import cn.fw.valhalla.common.utils.DateUtil; 6 import cn.fw.valhalla.common.utils.DateUtil;
  7 +import cn.fw.valhalla.common.utils.StringUtils;
7 import cn.fw.valhalla.domain.db.customer.AccidentPool; 8 import cn.fw.valhalla.domain.db.customer.AccidentPool;
8 import cn.fw.valhalla.domain.db.customer.Customer; 9 import cn.fw.valhalla.domain.db.customer.Customer;
9 import cn.fw.valhalla.domain.db.follow.FollowRecord; 10 import cn.fw.valhalla.domain.db.follow.FollowRecord;
@@ -80,6 +81,9 @@ public class AccidentPoolBizService { @@ -80,6 +81,9 @@ public class AccidentPoolBizService {
80 BV.isTrue(Boolean.TRUE.equals(pair.getKey()), () -> "请勿重复提交"); 81 BV.isTrue(Boolean.TRUE.equals(pair.getKey()), () -> "请勿重复提交");
81 boolean repetition = isRepetition(currentUser.getGroupId(), poolDTO.getPlateNo()); 82 boolean repetition = isRepetition(currentUser.getGroupId(), poolDTO.getPlateNo());
82 BV.isFalse(repetition, () -> "该记录已存在,请勿重复添加"); 83 BV.isFalse(repetition, () -> "该记录已存在,请勿重复添加");
  84 + if (StringUtils.isEmpty(poolDTO.getMobile())) {
  85 + poolDTO.setMobile(poolDTO.getReportMobile());
  86 + }
83 AccidentPool pool = conversion2db(poolDTO, currentUser); 87 AccidentPool pool = conversion2db(poolDTO, currentUser);
84 pool.setShopId(poolDTO.getShopId()); 88 pool.setShopId(poolDTO.getShopId());
85 pool.setShopName(poolDTO.getShopName()); 89 pool.setShopName(poolDTO.getShopName());
@@ -276,11 +280,7 @@ public class AccidentPoolBizService { @@ -276,11 +280,7 @@ public class AccidentPoolBizService {
276 record.setAddTodo(Boolean.FALSE); 280 record.setAddTodo(Boolean.FALSE);
277 record.setGroupId(task.getGroupId()); 281 record.setGroupId(task.getGroupId());
278 record.setShopId(task.getFollowShop()); 282 record.setShopId(task.getFollowShop());
279 - settingBizService.querySettingByType(FollowTypeEnum.AC, SettingTypeEnum.LIMITATION, task.getGroupId())  
280 - .ifPresent(r -> {  
281 - Timestamp expired = DateUtil.getExpired(task.getBeginTime(), r.getDetailValue(), getCalendarType(Objects.requireNonNull(SettingUnitEnum.ofValue(r.getUnit()))));  
282 - record.setLimitTime(expired);  
283 - }); 283 + record.setLimitTime(record.getDeadline());
284 followRecordService.queryAndSave(record); 284 followRecordService.queryAndSave(record);
285 } 285 }
286 } 286 }
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowBizService.java
@@ -139,9 +139,15 @@ public class FollowBizService { @@ -139,9 +139,15 @@ public class FollowBizService {
139 * @param type 139 * @param type
140 * @return 140 * @return
141 */ 141 */
142 - public List<FollowRecordVO> todoRecord(Long taskId, FollowTypeEnum type) {  
143 - FollowStrategy strategy = followMap.get(type);  
144 - Assert.notNull(strategy, "strategy cannot be null"); 142 + public List<FollowRecordVO> todoRecord(Long taskId, Integer type) {
  143 + FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type);
  144 + if (Objects.isNull(typeEnum)) {
  145 + FollowTask task = followTaskService.getById(taskId);
  146 + BV.notNull(task, () -> "跟进任务不存在");
  147 + typeEnum = task.getType();
  148 + }
  149 + FollowStrategy strategy = followMap.get(typeEnum);
  150 + BV.notNull(strategy, () -> "跟进类型不正确");
145 return strategy.getRecordList(taskId); 151 return strategy.getRecordList(taskId);
146 } 152 }
147 153
@@ -216,10 +222,17 @@ public class FollowBizService { @@ -216,10 +222,17 @@ public class FollowBizService {
216 * @param type 222 * @param type
217 * @return 223 * @return
218 */ 224 */
219 - public FollowDetailVO approveDetail(Long id, FollowTypeEnum type) {  
220 - FollowStrategy strategy = followMap.get(type);  
221 - Assert.notNull(strategy, "strategy cannot be null"); 225 + public FollowDetailVO approveDetail(Long id, Integer type) {
  226 + FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type);
  227 + if (Objects.isNull(typeEnum)) {
  228 + FollowRecord record = followRecordService.getById(id);
  229 + BV.notNull(record, () -> "跟进记录不存在");
  230 + typeEnum = record.getType();
  231 + }
  232 + FollowStrategy strategy = followMap.get(typeEnum);
  233 + BV.notNull(strategy, () -> "跟进类型不正确");
222 FollowDetailVO detail = strategy.getDetail(id); 234 FollowDetailVO detail = strategy.getDetail(id);
  235 + detail.setType(typeEnum.getValue());
223 ApproveRecord approveRecord = approveRecordService.getOne(Wrappers.<ApproveRecord>lambdaQuery() 236 ApproveRecord approveRecord = approveRecordService.getOne(Wrappers.<ApproveRecord>lambdaQuery()
224 .eq(ApproveRecord::getDataId, detail.getTaskId()) 237 .eq(ApproveRecord::getDataId, detail.getTaskId())
225 .last("limit 1") 238 .last("limit 1")
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java
@@ -95,7 +95,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy { @@ -95,7 +95,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy {
95 vo.setId(followRecord.getId()); 95 vo.setId(followRecord.getId());
96 vo.setTaskId(followRecord.getTaskId()); 96 vo.setTaskId(followRecord.getTaskId());
97 vo.setHadCall(count > 0 || !ValidationUtils.checkMobile(vo.getReportMobile())); 97 vo.setHadCall(count > 0 || !ValidationUtils.checkMobile(vo.getReportMobile()));
98 - vo.setDeadline(Objects.isNull(followRecord.getLimitTime()) ? followRecord.getDeadline() : followRecord.getLimitTime()); 98 + vo.setDeadline(followRecord.getDeadline());
99 return vo; 99 return vo;
100 } 100 }
101 101