|
@@ -590,7 +590,6 @@ public class WmPackageManager {
|
|
|
result.put("nextStep", nextStep);
|
|
|
result.put("passedByNode6ScoreSum", passedByNode6ScoreSum);
|
|
|
result.put("usedRdmScore", usedRdpScore);
|
|
|
- result.put("availRdpScore", passedByNode6ScoreSum - usedRdpScore);
|
|
|
|
|
|
int taskTotalCount = tasks.size();
|
|
|
|
|
@@ -642,9 +641,34 @@ public class WmPackageManager {
|
|
|
double supervisionDeductScore = CollUtil.isEmpty(taskSupervisions) ? 0
|
|
|
: taskId2EntityMap.entrySet().stream().filter(entry -> supRegTaskIds.contains(entry.getKey()))
|
|
|
.mapToDouble(entry -> entry.getValue().getScore()).sum();
|
|
|
- // 监督扣减分值
|
|
|
+ // 监督扣减分值 todo 不同阶段对应的分值
|
|
|
result.put("supervisionDeductScore", supervisionDeductScore);
|
|
|
|
|
|
+ // 一阶段兑付的分值
|
|
|
+ double step1SupDeductScore = CollUtil.isNotEmpty(notices)
|
|
|
+ ? notices.stream()
|
|
|
+ .filter(rdm -> rdm.getStep().equals(1) && !CheckState.REJECTED.getState().equals(rdm.getCheckState()))
|
|
|
+ .mapToDouble(WmPackageRedemptionNotice::getCurrentRedemptionScore)
|
|
|
+ .sum()
|
|
|
+ : 0;
|
|
|
+ // 二阶段兑付分值
|
|
|
+ double step2SupDeductScore = CollUtil.isNotEmpty(notices)
|
|
|
+ ? notices.stream()
|
|
|
+ .filter(rdm -> rdm.getStep().equals(1) && !CheckState.REJECTED.getState().equals(rdm.getCheckState()))
|
|
|
+ .mapToDouble(WmPackageRedemptionNotice::getCurrentRedemptionScore)
|
|
|
+ .sum()
|
|
|
+ : 0;
|
|
|
+
|
|
|
+ result.put("step1SupDeductScore", step1SupDeductScore);
|
|
|
+ result.put("step2SupDeductScore", step2SupDeductScore);
|
|
|
+
|
|
|
+ // 一阶段:可兑付分值 = 审核通过积分值
|
|
|
+ result.put("availRdpScore", passedByNode6ScoreSum);
|
|
|
+ // 二阶段:可兑付分值 = 审核通过积分值 - 监督扣减分值 - 一阶段兑付的分值
|
|
|
+ result.put("step2AvailRdpScore", passedByNode6ScoreSum - step1SupDeductScore - supervisionDeductScore);
|
|
|
+ // 三阶段:可兑付分值 = 审核通过积分值 - 监督扣减分值 - 一阶段兑付分值-二阶段兑付分值
|
|
|
+ result.put("step3AvailRdpScore", passedByNode6ScoreSum - step1SupDeductScore - step2SupDeductScore - supervisionDeductScore);
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -657,8 +681,8 @@ public class WmPackageManager {
|
|
|
*/
|
|
|
public List<WmScorePackage> listStepPkgs(Integer step, HnqzUser user) {
|
|
|
|
|
|
- List<WmScorePackage> packages = scorePackageService.list(Wrappers.<WmScorePackage>lambdaQuery()
|
|
|
- .eq(WmScorePackage::getSendPackageDeptId, user.getDeptId()));
|
|
|
+ List<WmScorePackage> packages = scorePackageService
|
|
|
+ .list(Wrappers.<WmScorePackage>lambdaQuery().eq(WmScorePackage::getSendPackageDeptId, user.getDeptId()));
|
|
|
if (CollUtil.isEmpty(packages)) {
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
@@ -666,9 +690,9 @@ public class WmPackageManager {
|
|
|
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)
|
|
|
+ List<WmPackageRedemptionNotice> redemptionNotices = packageRedemptionNoticeService.list(
|
|
|
+ Wrappers.<WmPackageRedemptionNotice>lambdaQuery().in(WmPackageRedemptionNotice::getPackageId, packageIds)
|
|
|
+ .eq(step > 1, WmPackageRedemptionNotice::getStep, step - 1)
|
|
|
.notIn(WmPackageRedemptionNotice::getCheckState, CheckState.REJECTED.getState()));
|
|
|
|
|
|
Map<Integer, List<Integer>> noticePkgMap =
|
|
@@ -678,13 +702,19 @@ public class WmPackageManager {
|
|
|
// 根据不同知会阶段,过滤出还未知会的包
|
|
|
List<Integer> noticedPkgIds = noticePkgMap.get(step);
|
|
|
|
|
|
- if (CollUtil.isNotEmpty(noticedPkgIds)) {
|
|
|
- return packages.stream()
|
|
|
- .filter(pkg -> !noticedPkgIds.contains(Integer.parseInt(pkg.getId())))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ if (step > 1) {
|
|
|
+ // 二阶段、三阶段获取上一阶段已知会的包
|
|
|
+ return packages.stream()
|
|
|
+ .filter(
|
|
|
+ pkg -> CollUtil.isNotEmpty(noticedPkgIds) && noticedPkgIds.contains(Integer.parseInt(pkg.getId())))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ } else {
|
|
|
+ List<Integer> allNoticedPackageIds =
|
|
|
+ redemptionNotices.stream().map(WmPackageRedemptionNotice::getPackageId).collect(Collectors.toList());
|
|
|
+ // 一阶段获取还未知会的包
|
|
|
+ return packages.stream().filter(pkg -> CollUtil.isEmpty(allNoticedPackageIds)
|
|
|
+ || !allNoticedPackageIds.contains(Integer.parseInt(pkg.getId()))).collect(Collectors.toList());
|
|
|
}
|
|
|
-
|
|
|
- return packages;
|
|
|
}
|
|
|
|
|
|
/**
|