From 51a118ce8d0994f2bb4108bff673b9f92ae40e26 Mon Sep 17 00:00:00 2001 From: Kurisu Date: Tue, 2 Mar 2021 10:36:19 +0800 Subject: [PATCH] :sparkles: bug调整 --- fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java | 1 + fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java | 14 ++++---------- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AccidentPoolBizService.java | 10 +++++----- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowBizService.java | 25 +++++++++++++++++++------ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java | 2 +- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java index 23fd7aa..357faba 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java @@ -23,6 +23,7 @@ public class FollowDetailVO { * 档案id */ private Long customerId; + private Integer type; /** * 名称 */ diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java index 6aea373..7d70b4b 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/FollowController.java @@ -82,14 +82,11 @@ public class FollowController { @GetMapping("/approve/detail") @IgnoreAuth - public Message approveDetail(@NotNull(message = "跟进记录id不能为空") final Long recordId, - @NotNull(message = "跟进类型不能为空") final Integer type) { + public Message approveDetail(@NotNull(message = "跟进记录id不能为空") final Long recordId, final Integer type) { final String msg = "查询跟进战败审批详情[follow/approve/detail]"; try { log.info("{}: param[{} {}]", msg, recordId, type); - FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type); - BV.notNull(typeEnum, "跟进类型不正确"); - FollowDetailVO detailVO = followBizService.approveDetail(recordId, typeEnum); + FollowDetailVO detailVO = followBizService.approveDetail(recordId, type); return success(detailVO, data -> log.info("{}", data)); } catch (Exception ex) { handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, recordId, type, e)); @@ -99,14 +96,11 @@ public class FollowController { @GetMapping("/todo/record") @IgnoreAuth - public Message> todoRecord(@NotNull(message = "跟进任务id不能为空") final Long taskId, - @NotNull(message = "跟进类型不能为空") final Integer type) { + public Message> todoRecord(@NotNull(message = "跟进任务id不能为空") final Long taskId, final Integer type) { final String msg = "查询跟进历史记录[follow/todo/record]"; try { log.info("{}: param[{} {}]", msg, taskId, type); - FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type); - BV.notNull(typeEnum, "跟进类型不正确"); - return success(followBizService.todoRecord(taskId, typeEnum), data -> log.info("{}", data)); + return success(followBizService.todoRecord(taskId, type), data -> log.info("{}", data)); } catch (Exception ex) { handleException(ex, e -> log.error("{}失败:param[{} {}]", msg, taskId, type, e)); return failureWithMessage(QUERY_FAILURE); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AccidentPoolBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AccidentPoolBizService.java index 1d4e1be..3aa5d19 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AccidentPoolBizService.java +++ b/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; import cn.fw.common.web.auth.LoginAuthBean; import cn.fw.valhalla.common.constant.RoleCode; import cn.fw.valhalla.common.utils.DateUtil; +import cn.fw.valhalla.common.utils.StringUtils; import cn.fw.valhalla.domain.db.customer.AccidentPool; import cn.fw.valhalla.domain.db.customer.Customer; import cn.fw.valhalla.domain.db.follow.FollowRecord; @@ -80,6 +81,9 @@ public class AccidentPoolBizService { BV.isTrue(Boolean.TRUE.equals(pair.getKey()), () -> "请勿重复提交"); boolean repetition = isRepetition(currentUser.getGroupId(), poolDTO.getPlateNo()); BV.isFalse(repetition, () -> "该记录已存在,请勿重复添加"); + if (StringUtils.isEmpty(poolDTO.getMobile())) { + poolDTO.setMobile(poolDTO.getReportMobile()); + } AccidentPool pool = conversion2db(poolDTO, currentUser); pool.setShopId(poolDTO.getShopId()); pool.setShopName(poolDTO.getShopName()); @@ -276,11 +280,7 @@ public class AccidentPoolBizService { record.setAddTodo(Boolean.FALSE); record.setGroupId(task.getGroupId()); record.setShopId(task.getFollowShop()); - settingBizService.querySettingByType(FollowTypeEnum.AC, SettingTypeEnum.LIMITATION, task.getGroupId()) - .ifPresent(r -> { - Timestamp expired = DateUtil.getExpired(task.getBeginTime(), r.getDetailValue(), getCalendarType(Objects.requireNonNull(SettingUnitEnum.ofValue(r.getUnit())))); - record.setLimitTime(expired); - }); + record.setLimitTime(record.getDeadline()); followRecordService.queryAndSave(record); } } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowBizService.java index f93ff69..ae37832 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowBizService.java @@ -139,9 +139,15 @@ public class FollowBizService { * @param type * @return */ - public List todoRecord(Long taskId, FollowTypeEnum type) { - FollowStrategy strategy = followMap.get(type); - Assert.notNull(strategy, "strategy cannot be null"); + public List todoRecord(Long taskId, Integer type) { + FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type); + if (Objects.isNull(typeEnum)) { + FollowTask task = followTaskService.getById(taskId); + BV.notNull(task, () -> "跟进任务不存在"); + typeEnum = task.getType(); + } + FollowStrategy strategy = followMap.get(typeEnum); + BV.notNull(strategy, () -> "跟进类型不正确"); return strategy.getRecordList(taskId); } @@ -216,10 +222,17 @@ public class FollowBizService { * @param type * @return */ - public FollowDetailVO approveDetail(Long id, FollowTypeEnum type) { - FollowStrategy strategy = followMap.get(type); - Assert.notNull(strategy, "strategy cannot be null"); + public FollowDetailVO approveDetail(Long id, Integer type) { + FollowTypeEnum typeEnum = FollowTypeEnum.ofValue(type); + if (Objects.isNull(typeEnum)) { + FollowRecord record = followRecordService.getById(id); + BV.notNull(record, () -> "跟进记录不存在"); + typeEnum = record.getType(); + } + FollowStrategy strategy = followMap.get(typeEnum); + BV.notNull(strategy, () -> "跟进类型不正确"); FollowDetailVO detail = strategy.getDetail(id); + detail.setType(typeEnum.getValue()); ApproveRecord approveRecord = approveRecordService.getOne(Wrappers.lambdaQuery() .eq(ApproveRecord::getDataId, detail.getTaskId()) .last("limit 1") diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java index cbeed1f..ba67b2c 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java +++ b/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 { vo.setId(followRecord.getId()); vo.setTaskId(followRecord.getTaskId()); vo.setHadCall(count > 0 || !ValidationUtils.checkMobile(vo.getReportMobile())); - vo.setDeadline(Objects.isNull(followRecord.getLimitTime()) ? followRecord.getDeadline() : followRecord.getLimitTime()); + vo.setDeadline(followRecord.getDeadline()); return vo; } -- libgit2 0.22.2