Commit 4eb2f717d8bc03344f6517914e9abe0c43e2e20f
1 parent
f5051c10
保有客分配,新增指定人员数量
Showing
1 changed file
with
3 additions
and
2 deletions
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/LeaveNeedDoBizService.java
... | ... | @@ -223,8 +223,8 @@ public class LeaveNeedDoBizService { |
223 | 223 | for (LeaveAllocationDTO.Allocation rule : ruleList) { |
224 | 224 | List<UserRoleDataRangeDTO> dataRange = userService.getUserRoleDataRange(rule.getUserId(), RoleCode.FWGW); |
225 | 225 | List<Long> shopIdList = dataRange.stream().map(UserRoleDataRangeDTO::getRangeValue).collect(Collectors.toList()); |
226 | - Long shopId = shopIdList.get(0); | |
227 | 226 | BV.isNotEmpty(shopIdList, () -> String.format("[%s]无服务接待角色,请核对", rule.getUserName())); |
227 | + Long shopId = shopIdList.get(0); | |
228 | 228 | BV.isTrue(needDo.getShopId().equals(shopId), () -> String.format("[%s]所属门店与离职人员门店不符", rule.getUserName())); |
229 | 229 | rule.setShopId(shopId); |
230 | 230 | } |
... | ... | @@ -248,7 +248,8 @@ public class LeaveNeedDoBizService { |
248 | 248 | final LinkedList<UserInfo> queue = new LinkedList<>(); |
249 | 249 | |
250 | 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 | 253 | if (CollectionUtils.isEmpty(subList)) { |
253 | 254 | continue; |
254 | 255 | } | ... | ... |