|
@@ -648,6 +648,45 @@ public class WmPackageManager {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 新增知会-可选执行包列表
|
|
|
|
+ *
|
|
|
|
+ * @param step 知会阶段
|
|
|
|
+ * @param user 用户
|
|
|
|
+ * @return {@link List }<{@link WmScorePackage }> 可选执行包列表
|
|
|
|
+ */
|
|
|
|
+ public List<WmScorePackage> listStepPkgs(Integer step, HnqzUser user) {
|
|
|
|
+
|
|
|
|
+ List<WmScorePackage> packages = scorePackageService.list(Wrappers.<WmScorePackage>lambdaQuery()
|
|
|
|
+ .eq(WmScorePackage::getSendPackageDeptId, user.getDeptId()));
|
|
|
|
+ if (CollUtil.isEmpty(packages)) {
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<String> packageIds = packages.stream().map(WmScorePackage::getId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ // 查询已知会信息
|
|
|
|
+ List<WmPackageRedemptionNotice> redemptionNotices =
|
|
|
|
+ packageRedemptionNoticeService.list(Wrappers.<WmPackageRedemptionNotice>lambdaQuery()
|
|
|
|
+ .in(WmPackageRedemptionNotice::getPackageId, packageIds).eq(WmPackageRedemptionNotice::getStep, step)
|
|
|
|
+ .notIn(WmPackageRedemptionNotice::getCheckState, CheckState.REJECTED.getState()));
|
|
|
|
+
|
|
|
|
+ Map<Integer, List<Integer>> noticePkgMap =
|
|
|
|
+ redemptionNotices.stream().collect(Collectors.groupingBy(WmPackageRedemptionNotice::getStep,
|
|
|
|
+ Collectors.mapping(WmPackageRedemptionNotice::getPackageId, Collectors.toList())));
|
|
|
|
+
|
|
|
|
+ // 根据不同知会阶段,过滤出还未知会的包
|
|
|
|
+ List<Integer> noticedPkgIds = noticePkgMap.get(step);
|
|
|
|
+
|
|
|
|
+ if (CollUtil.isNotEmpty(noticedPkgIds)) {
|
|
|
|
+ return packages.stream()
|
|
|
|
+ .filter(pkg -> !noticedPkgIds.contains(Integer.parseInt(pkg.getId())))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return packages;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取积分包任务信息详情
|
|
* 获取积分包任务信息详情
|
|
*
|
|
*
|