Commit 555d625a2baa5adb7494f19411885d062e80c08c

Authored by 张志伟
2 parents 91ffafeb cef7c485

Merge remote-tracking branch 'origin/test'

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 16 import cn.fw.valhalla.domain.db.pool.CustomerCluePool;
17 17 import cn.fw.valhalla.domain.db.pool.StammkundePool;
18 18 import cn.fw.valhalla.domain.dto.LeaveAllocationDTO;
  19 +import cn.fw.valhalla.domain.dto.StammkundeDto;
19 20 import cn.fw.valhalla.domain.enums.*;
20 21 import cn.fw.valhalla.domain.query.LeaveQueryVO;
21 22 import cn.fw.valhalla.domain.vo.LeaveNeedDoVO;
... ... @@ -26,6 +27,7 @@ import cn.fw.valhalla.rpc.erp.dto.PostUserDTO;
26 27 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO;
27 28 import cn.fw.valhalla.rpc.erp.dto.UserRoleDataRangeDTO;
28 29 import cn.fw.valhalla.rpc.oop.OopService;
  30 +import cn.fw.valhalla.rpc.oop.dto.ShopDTO;
29 31 import cn.fw.valhalla.service.bus.follow.FollowBizService;
30 32 import cn.fw.valhalla.service.data.*;
31 33 import com.alibaba.fastjson.JSONObject;
... ... @@ -153,7 +155,6 @@ public class LeaveNeedDoBizService {
153 155 dto.setType(typeEnum);
154 156 LeaveNeedDo needDo = leaveNeedDoService.queryProcessableById(dto.getId());
155 157 BV.notNull(needDo, () -> "该条记录已处理或不存在,请刷新后重试");
156   - stammkundePoolService.reject(needDo.getUserId(), needDo.getShopId(), null, DefeatReasonEnum.OT);
157 158  
158 159 dto.setAdviserId(needDo.getUserId());
159 160 if (AllocationTypeEnum.ONE.equals(typeEnum)) {
... ... @@ -204,6 +205,7 @@ public class LeaveNeedDoBizService {
204 205 customer.setShopId(dto.getShopId());
205 206 customer.setAdviserId(dto.getUserId());
206 207 spl.add(createPool(customer, userName));
  208 + rejectPool(customer.getId(), dto.getShopId(), userName, dto.getUserId(), customer.getGroupId());
207 209 }
208 210 customerService.updateBatchById(list);
209 211 stammkundePoolService.saveBatch(spl);
... ... @@ -229,8 +231,9 @@ public class LeaveNeedDoBizService {
229 231 customer.setShopId(shopId);
230 232 customer.setAdviserId(Objects.requireNonNull(info, "服务顾问信息获取异常,请重试").getUserId());
231 233 info.setCount(info.getCount() + 1);
232   - queue.offer(info);
  234 + rejectPool(customer.getId(), shopId, info.getUserName(), info.getUserId(), customer.getGroupId());
233 235 spl.add(createPool(customer, info.getUserName()));
  236 + queue.offer(info);
234 237 }
235 238 customerService.updateBatchById(list);
236 239 stammkundePoolService.saveBatch(spl);
... ... @@ -333,6 +336,23 @@ public class LeaveNeedDoBizService {
333 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 356 private StammkundePool createPool(Customer customer, String userName) {
337 357 StammkundePool sp = new StammkundePool();
338 358 sp.setCustomerId(customer.getId());
... ...