Commit aec9f9fc9eba2e16e4d6e4f19787a79d45a8252d
1 parent
42beb174
优化智能电话通话记录的处理
Showing
2 changed files
with
14 additions
and
0 deletions
fw-shirasawa-server/src/main/java/cn/fw/shirasawa/server/controller/task/CallReportDealTask.java
... | ... | @@ -18,6 +18,7 @@ import org.springframework.scheduling.annotation.Scheduled; |
18 | 18 | import org.springframework.stereotype.Component; |
19 | 19 | import org.springframework.util.CollectionUtils; |
20 | 20 | |
21 | +import java.time.LocalDateTime; | |
21 | 22 | import java.util.ArrayList; |
22 | 23 | import java.util.List; |
23 | 24 | import java.util.Objects; |
... | ... | @@ -43,6 +44,10 @@ public class CallReportDealTask { |
43 | 44 | @Getter |
44 | 45 | private String callReportKey; |
45 | 46 | |
47 | + @Value("${spring.cache.custom.global-prefix}:mq:call:fail-report") | |
48 | + @Getter | |
49 | + private String failReportKey; | |
50 | + | |
46 | 51 | @Autowired |
47 | 52 | public CallReportDealTask(final FollowBizService followBizService, |
48 | 53 | final EhrRpcService ehrRpcService, |
... | ... | @@ -77,6 +82,10 @@ public class CallReportDealTask { |
77 | 82 | boolean isStaffValid = Objects.nonNull(staffId) && Objects.nonNull(groupId); |
78 | 83 | if (!isStaffValid) { |
79 | 84 | StaffInfoDTO info = ehrRpcService.queryStaffInfoByMobile(staffMobile); |
85 | + if (Objects.isNull(info) && dto.getCallTime().isBefore(LocalDateTime.now().minusMinutes(20L))) { | |
86 | + redisTemplate.opsForList().rightPush(getFailReportKey(), callStr); | |
87 | + continue; | |
88 | + } | |
80 | 89 | BV.notNull(info, () -> String.format("[%s]员工信息获取失败", staffMobile)); |
81 | 90 | dto.setStaffId(info.getId()); |
82 | 91 | dto.setStaffName(info.getName()); |
... | ... | @@ -84,6 +93,10 @@ public class CallReportDealTask { |
84 | 93 | } |
85 | 94 | if (Objects.isNull(dto.getMemberId())) { |
86 | 95 | MemberUserDTO memberInfo = memberRpcService.queryByMobile(peerMobile); |
96 | + if (Objects.isNull(memberInfo) && dto.getCallTime().isBefore(LocalDateTime.now().minusMinutes(20L))) { | |
97 | + redisTemplate.opsForList().rightPush(getFailReportKey(), callStr); | |
98 | + continue; | |
99 | + } | |
87 | 100 | BV.notNull(memberInfo, () -> String.format("[%s]会员信息信息获取失败", peerMobile)); |
88 | 101 | dto.setMemberId(memberInfo.getUserId()); |
89 | 102 | dto.setMemberName(memberInfo.getRealName()); | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/AbstractFollowStrategy.java
... | ... | @@ -158,6 +158,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { |
158 | 158 | cluePool.setClueStatus(ClueStatusEnum.COMPLETE); |
159 | 159 | cluePoolService.updateById(cluePool); |
160 | 160 | |
161 | + task.setFinishUser(cluePool.getFinishUserId()); | |
161 | 162 | task.setFinishUserName(cluePool.getFinishUserName()); |
162 | 163 | task.setFinishShop(cluePool.getFinishShopId()); |
163 | 164 | task.setCloseTime(cluePool.getCloseTime()); | ... | ... |