Commit 555d625a2baa5adb7494f19411885d062e80c08c
Merge remote-tracking branch 'origin/test'
Showing
1 changed file
with
22 additions
and
2 deletions
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/LeaveNeedDoBizService.java
@@ -16,6 +16,7 @@ import cn.fw.valhalla.domain.db.follow.FollowTask; | @@ -16,6 +16,7 @@ import cn.fw.valhalla.domain.db.follow.FollowTask; | ||
16 | import cn.fw.valhalla.domain.db.pool.CustomerCluePool; | 16 | import cn.fw.valhalla.domain.db.pool.CustomerCluePool; |
17 | import cn.fw.valhalla.domain.db.pool.StammkundePool; | 17 | import cn.fw.valhalla.domain.db.pool.StammkundePool; |
18 | import cn.fw.valhalla.domain.dto.LeaveAllocationDTO; | 18 | import cn.fw.valhalla.domain.dto.LeaveAllocationDTO; |
19 | +import cn.fw.valhalla.domain.dto.StammkundeDto; | ||
19 | import cn.fw.valhalla.domain.enums.*; | 20 | import cn.fw.valhalla.domain.enums.*; |
20 | import cn.fw.valhalla.domain.query.LeaveQueryVO; | 21 | import cn.fw.valhalla.domain.query.LeaveQueryVO; |
21 | import cn.fw.valhalla.domain.vo.LeaveNeedDoVO; | 22 | import cn.fw.valhalla.domain.vo.LeaveNeedDoVO; |
@@ -26,6 +27,7 @@ import cn.fw.valhalla.rpc.erp.dto.PostUserDTO; | @@ -26,6 +27,7 @@ import cn.fw.valhalla.rpc.erp.dto.PostUserDTO; | ||
26 | import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; | 27 | import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; |
27 | import cn.fw.valhalla.rpc.erp.dto.UserRoleDataRangeDTO; | 28 | import cn.fw.valhalla.rpc.erp.dto.UserRoleDataRangeDTO; |
28 | import cn.fw.valhalla.rpc.oop.OopService; | 29 | import cn.fw.valhalla.rpc.oop.OopService; |
30 | +import cn.fw.valhalla.rpc.oop.dto.ShopDTO; | ||
29 | import cn.fw.valhalla.service.bus.follow.FollowBizService; | 31 | import cn.fw.valhalla.service.bus.follow.FollowBizService; |
30 | import cn.fw.valhalla.service.data.*; | 32 | import cn.fw.valhalla.service.data.*; |
31 | import com.alibaba.fastjson.JSONObject; | 33 | import com.alibaba.fastjson.JSONObject; |
@@ -153,7 +155,6 @@ public class LeaveNeedDoBizService { | @@ -153,7 +155,6 @@ public class LeaveNeedDoBizService { | ||
153 | dto.setType(typeEnum); | 155 | dto.setType(typeEnum); |
154 | LeaveNeedDo needDo = leaveNeedDoService.queryProcessableById(dto.getId()); | 156 | LeaveNeedDo needDo = leaveNeedDoService.queryProcessableById(dto.getId()); |
155 | BV.notNull(needDo, () -> "该条记录已处理或不存在,请刷新后重试"); | 157 | BV.notNull(needDo, () -> "该条记录已处理或不存在,请刷新后重试"); |
156 | - stammkundePoolService.reject(needDo.getUserId(), needDo.getShopId(), null, DefeatReasonEnum.OT); | ||
157 | 158 | ||
158 | dto.setAdviserId(needDo.getUserId()); | 159 | dto.setAdviserId(needDo.getUserId()); |
159 | if (AllocationTypeEnum.ONE.equals(typeEnum)) { | 160 | if (AllocationTypeEnum.ONE.equals(typeEnum)) { |
@@ -204,6 +205,7 @@ public class LeaveNeedDoBizService { | @@ -204,6 +205,7 @@ public class LeaveNeedDoBizService { | ||
204 | customer.setShopId(dto.getShopId()); | 205 | customer.setShopId(dto.getShopId()); |
205 | customer.setAdviserId(dto.getUserId()); | 206 | customer.setAdviserId(dto.getUserId()); |
206 | spl.add(createPool(customer, userName)); | 207 | spl.add(createPool(customer, userName)); |
208 | + rejectPool(customer.getId(), dto.getShopId(), userName, dto.getUserId(), customer.getGroupId()); | ||
207 | } | 209 | } |
208 | customerService.updateBatchById(list); | 210 | customerService.updateBatchById(list); |
209 | stammkundePoolService.saveBatch(spl); | 211 | stammkundePoolService.saveBatch(spl); |
@@ -229,8 +231,9 @@ public class LeaveNeedDoBizService { | @@ -229,8 +231,9 @@ public class LeaveNeedDoBizService { | ||
229 | customer.setShopId(shopId); | 231 | customer.setShopId(shopId); |
230 | customer.setAdviserId(Objects.requireNonNull(info, "服务顾问信息获取异常,请重试").getUserId()); | 232 | customer.setAdviserId(Objects.requireNonNull(info, "服务顾问信息获取异常,请重试").getUserId()); |
231 | info.setCount(info.getCount() + 1); | 233 | info.setCount(info.getCount() + 1); |
232 | - queue.offer(info); | 234 | + rejectPool(customer.getId(), shopId, info.getUserName(), info.getUserId(), customer.getGroupId()); |
233 | spl.add(createPool(customer, info.getUserName())); | 235 | spl.add(createPool(customer, info.getUserName())); |
236 | + queue.offer(info); | ||
234 | } | 237 | } |
235 | customerService.updateBatchById(list); | 238 | customerService.updateBatchById(list); |
236 | stammkundePoolService.saveBatch(spl); | 239 | stammkundePoolService.saveBatch(spl); |
@@ -333,6 +336,23 @@ public class LeaveNeedDoBizService { | @@ -333,6 +336,23 @@ public class LeaveNeedDoBizService { | ||
333 | todoRpcService.complete(backLogItemDTO); | 336 | todoRpcService.complete(backLogItemDTO); |
334 | } | 337 | } |
335 | 338 | ||
339 | + private void rejectPool (Long customerId, Long shopId, String userName, Long userId, Long groupId) { | ||
340 | + StammkundeDto stammkundeDto = new StammkundeDto(); | ||
341 | + stammkundeDto.setCustomerId(customerId); | ||
342 | + stammkundeDto.setReason(DefeatReasonEnum.OT); | ||
343 | + stammkundeDto.setShopId(shopId); | ||
344 | + stammkundeDto.setNewUserId(userId); | ||
345 | + stammkundeDto.setNewUserName(userName); | ||
346 | + ShopDTO shop = oopService.shop(shopId); | ||
347 | + stammkundeDto.setNewShopId(shopId); | ||
348 | + if (Objects.nonNull(shop)) { | ||
349 | + stammkundeDto.setNewShopName(shop.getShortName()); | ||
350 | + } | ||
351 | + stammkundeDto.setGroupId(groupId); | ||
352 | + | ||
353 | + stammkundePoolService.reject(stammkundeDto); | ||
354 | + } | ||
355 | + | ||
336 | private StammkundePool createPool(Customer customer, String userName) { | 356 | private StammkundePool createPool(Customer customer, String userName) { |
337 | StammkundePool sp = new StammkundePool(); | 357 | StammkundePool sp = new StammkundePool(); |
338 | sp.setCustomerId(customer.getId()); | 358 | sp.setCustomerId(customer.getId()); |