Commit 51a118ce8d0994f2bb4108bff673b9f92ae40e26
1 parent
d811ff96
bug调整
Showing
5 changed files
with
30 additions
and
22 deletions
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java
... | ... | @@ -82,14 +82,11 @@ public class FollowController { |
82 | 82 | |
83 | 83 | @GetMapping("/approve/detail") |
84 | 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 | 86 | final String msg = "查询跟进战败审批详情[follow/approve/detail]"; |
88 | 87 | try { |
89 | 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 | 90 | return success(detailVO, data -> log.info("{}", data)); |
94 | 91 | } catch (Exception ex) { |
95 | 92 | handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, recordId, type, e)); |
... | ... | @@ -99,14 +96,11 @@ public class FollowController { |
99 | 96 | |
100 | 97 | @GetMapping("/todo/record") |
101 | 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 | 100 | final String msg = "查询跟进历史记录[follow/todo/record]"; |
105 | 101 | try { |
106 | 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 | 104 | } catch (Exception ex) { |
111 | 105 | handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, taskId, type, e)); |
112 | 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 | 4 | import cn.fw.common.web.auth.LoginAuthBean; |
5 | 5 | import cn.fw.valhalla.common.constant.RoleCode; |
6 | 6 | import cn.fw.valhalla.common.utils.DateUtil; |
7 | +import cn.fw.valhalla.common.utils.StringUtils; | |
7 | 8 | import cn.fw.valhalla.domain.db.customer.AccidentPool; |
8 | 9 | import cn.fw.valhalla.domain.db.customer.Customer; |
9 | 10 | import cn.fw.valhalla.domain.db.follow.FollowRecord; |
... | ... | @@ -80,6 +81,9 @@ public class AccidentPoolBizService { |
80 | 81 | BV.isTrue(Boolean.TRUE.equals(pair.getKey()), () -> "请勿重复提交"); |
81 | 82 | boolean repetition = isRepetition(currentUser.getGroupId(), poolDTO.getPlateNo()); |
82 | 83 | BV.isFalse(repetition, () -> "该记录已存在,请勿重复添加"); |
84 | + if (StringUtils.isEmpty(poolDTO.getMobile())) { | |
85 | + poolDTO.setMobile(poolDTO.getReportMobile()); | |
86 | + } | |
83 | 87 | AccidentPool pool = conversion2db(poolDTO, currentUser); |
84 | 88 | pool.setShopId(poolDTO.getShopId()); |
85 | 89 | pool.setShopName(poolDTO.getShopName()); |
... | ... | @@ -276,11 +280,7 @@ public class AccidentPoolBizService { |
276 | 280 | record.setAddTodo(Boolean.FALSE); |
277 | 281 | record.setGroupId(task.getGroupId()); |
278 | 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 | 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 | 139 | * @param type |
140 | 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 | 151 | return strategy.getRecordList(taskId); |
146 | 152 | } |
147 | 153 | |
... | ... | @@ -216,10 +222,17 @@ public class FollowBizService { |
216 | 222 | * @param type |
217 | 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 | 234 | FollowDetailVO detail = strategy.getDetail(id); |
235 | + detail.setType(typeEnum.getValue()); | |
223 | 236 | ApproveRecord approveRecord = approveRecordService.getOne(Wrappers.<ApproveRecord>lambdaQuery() |
224 | 237 | .eq(ApproveRecord::getDataId, detail.getTaskId()) |
225 | 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 | 95 | vo.setId(followRecord.getId()); |
96 | 96 | vo.setTaskId(followRecord.getTaskId()); |
97 | 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 | 99 | return vo; |
100 | 100 | } |
101 | 101 | ... | ... |