|
@@ -1240,8 +1240,14 @@ public class WmSupervisionManager {
|
|
|
// mybatisplus hardcode page size 500
|
|
|
// half half select to avoid network exception when executing too long
|
|
|
List<String> deptIds = depts.stream().map(dept -> dept.getDeptId().toString()).collect(Collectors.toList());
|
|
|
- List<WmScorePackage> pkgs = packageService.list(queryWrapper.clone().in(WmScorePackage::getDeptId, deptIds.subList(0, deptIds.size()/2)));
|
|
|
- pkgs.addAll(packageService.list(queryWrapper.in(WmScorePackage::getDeptId, deptIds.subList(deptIds.size()/2, deptIds.size()))));
|
|
|
+ int halfVal = deptIds.size() / 2;
|
|
|
+ if (halfVal <= 0) {
|
|
|
+ halfVal = deptIds.size();
|
|
|
+ }
|
|
|
+ List<WmScorePackage> pkgs = packageService.list(queryWrapper.clone().in(WmScorePackage::getDeptId, deptIds.subList(0, halfVal)));
|
|
|
+ if (halfVal > 0) {
|
|
|
+ pkgs.addAll(packageService.list(queryWrapper.in(WmScorePackage::getDeptId, deptIds.subList(deptIds.size() / 2, deptIds.size()))));
|
|
|
+ }
|
|
|
;
|
|
|
if (CollUtil.isEmpty(pkgs)) {
|
|
|
throw new BizException("没有查询到匹配积分包");
|