Commit 4eb2f717d8bc03344f6517914e9abe0c43e2e20f

Authored by 张志伟
1 parent f5051c10

:sparkles: 保有客分配,新增指定人员数量

fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/LeaveNeedDoBizService.java
@@ -223,8 +223,8 @@ public class LeaveNeedDoBizService { @@ -223,8 +223,8 @@ public class LeaveNeedDoBizService {
223 for (LeaveAllocationDTO.Allocation rule : ruleList) { 223 for (LeaveAllocationDTO.Allocation rule : ruleList) {
224 List<UserRoleDataRangeDTO> dataRange = userService.getUserRoleDataRange(rule.getUserId(), RoleCode.FWGW); 224 List<UserRoleDataRangeDTO> dataRange = userService.getUserRoleDataRange(rule.getUserId(), RoleCode.FWGW);
225 List<Long> shopIdList = dataRange.stream().map(UserRoleDataRangeDTO::getRangeValue).collect(Collectors.toList()); 225 List<Long> shopIdList = dataRange.stream().map(UserRoleDataRangeDTO::getRangeValue).collect(Collectors.toList());
226 - Long shopId = shopIdList.get(0);  
227 BV.isNotEmpty(shopIdList, () -> String.format("[%s]无服务接待角色,请核对", rule.getUserName())); 226 BV.isNotEmpty(shopIdList, () -> String.format("[%s]无服务接待角色,请核对", rule.getUserName()));
  227 + Long shopId = shopIdList.get(0);
228 BV.isTrue(needDo.getShopId().equals(shopId), () -> String.format("[%s]所属门店与离职人员门店不符", rule.getUserName())); 228 BV.isTrue(needDo.getShopId().equals(shopId), () -> String.format("[%s]所属门店与离职人员门店不符", rule.getUserName()));
229 rule.setShopId(shopId); 229 rule.setShopId(shopId);
230 } 230 }
@@ -248,7 +248,8 @@ public class LeaveNeedDoBizService { @@ -248,7 +248,8 @@ public class LeaveNeedDoBizService {
248 final LinkedList<UserInfo> queue = new LinkedList<>(); 248 final LinkedList<UserInfo> queue = new LinkedList<>();
249 249
250 for (LeaveAllocationDTO.Allocation rule : ruleList) { 250 for (LeaveAllocationDTO.Allocation rule : ruleList) {
251 - List<Customer> subList = customerList.subList(0, rule.getNum()); 251 + int size = customerList.size();
  252 + List<Customer> subList = customerList.subList(0, rule.getNum() > size ? size : rule.getNum());
252 if (CollectionUtils.isEmpty(subList)) { 253 if (CollectionUtils.isEmpty(subList)) {
253 continue; 254 continue;
254 } 255 }