|
@@ -831,18 +831,18 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
// }
|
|
|
if (wmScorePackage.getPackageType1().equals("1")) {// 定额
|
|
|
if (!StringUtil.isEmpty(wmScorePackage.getUserScore()) && wmScorePackage.getUserNum() > 0) {
|
|
|
- wmScorePackage.setScore(Integer.valueOf(wmScorePackage.getUserScore()) * wmScorePackage.getUserNum());
|
|
|
+ wmScorePackage.setScore(Long.parseLong(wmScorePackage.getUserScore()) * wmScorePackage.getUserNum());
|
|
|
}
|
|
|
} else {
|
|
|
if (!StringUtil.isEmpty(wmScorePackage.getUserScore())) {
|
|
|
if (PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
|
|
|
// 如果是患者教育,积分值转换为以'分'为单位保存
|
|
|
- int scoreFen = new BigDecimal(wmScorePackage.getUserScore()).multiply(new BigDecimal("100"))
|
|
|
- .intValue();
|
|
|
+ long scoreFen = new BigDecimal(wmScorePackage.getUserScore()).multiply(new BigDecimal("100"))
|
|
|
+ .longValue();
|
|
|
wmScorePackage.setScore(scoreFen);
|
|
|
wmScorePackage.setUserScore(String.valueOf(scoreFen));
|
|
|
} else {
|
|
|
- wmScorePackage.setScore(Integer.valueOf(wmScorePackage.getUserScore()));
|
|
|
+ wmScorePackage.setScore(Long.valueOf(wmScorePackage.getUserScore()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -875,7 +875,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
// WmScorePackage wmScorePackage1 = new WmScorePackage();
|
|
|
// wmScorePackage1.setId(wmScorePackage.getRelationScoreId());
|
|
|
// WmScorePackage wmScorePackage2 = wmScorePackageMapper.selectById(wmScorePackage1.getId());
|
|
|
- Integer kfpjf = 0;
|
|
|
+ long kfpjf = 0;
|
|
|
|
|
|
List<WmScorePackage> scorePackagekfpjf = this.getScorePackagekfpjf(null, null, new String[]{"0", "1", "2"},
|
|
|
new String[]{wmScorePackage.getRelationScoreId()});
|
|
@@ -1267,7 +1267,6 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
}
|
|
|
if (PackageTypeEnum.TYPE1_HCP_PACKAGE.getName().equals(wmScorePackage1.getPackageType1())) {
|
|
|
// 如果是患者教育,则转换积分值 '分'-> '元'
|
|
|
- Integer score = wmScorePackage1.getScore();
|
|
|
String userScore = wmScorePackage1.getUserScore();
|
|
|
if (StringUtils.isNumeric(userScore)) {
|
|
|
wmScorePackage1.setUserScore(String.format("%.2f", Integer.parseInt(userScore) / 100.0));
|
|
@@ -1381,7 +1380,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
queryWrapper.in(WmScorePackageStatus::getStatus, "2");
|
|
|
List<WmScorePackageStatus> scorestatusList = wmScorePackageStatusService.list(queryWrapper);
|
|
|
// 全部终止,终止任务和积分包
|
|
|
- int recoveryScore = 0;
|
|
|
+ long recoveryScore = 0;
|
|
|
if ("1".equals(enableType)) {
|
|
|
wmScorePackage.setScorePackageStatus("6");// 已终止
|
|
|
// 更新结单
|
|
@@ -1410,7 +1409,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
wmScorePackage.setScorePackageStatus("4");// 已完成待结算
|
|
|
// 部分终止,收回剩余积分值,没有审核的任务继续审核
|
|
|
// 先更新任务状态为已审核
|
|
|
- int resSum = 0;// 收回值
|
|
|
+ long resSum = 0;// 收回值
|
|
|
boolean pickedButNotSubmitted = false;
|
|
|
if (CollUtil.isNotEmpty(scorestatusList)) {
|
|
|
wmScorePackage.setUserNum(scorestatusList.size());
|
|
@@ -1421,13 +1420,13 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
wmTask1.setTaskUserId(wmScorePackageStatus.getUserId());
|
|
|
wmTask1.setTaskStatus("1,2,3");
|
|
|
List<WmTask> taskList1 = wmTaskMapper.selectByTask(wmTask1);
|
|
|
- Integer res = 0;
|
|
|
+ long res = 0;
|
|
|
boolean all = false;
|
|
|
if (CollUtil.isEmpty(taskList1)) {
|
|
|
if (wmScorePackage.getPackageType1().equals("1") || wmScorePackage.getPackageType1()
|
|
|
.equals("5")) {// 定额
|
|
|
// 这个用户还没有做任务时,积分值设为0
|
|
|
- int userScore = Integer.parseInt(wmScorePackageStatus.getUserScore());
|
|
|
+ long userScore = Integer.parseInt(wmScorePackageStatus.getUserScore());
|
|
|
wmScorePackageStatus.setUserScore("0");
|
|
|
// wmScorePackage.setScore(wmScorePackage.getScore() - Integer.parseInt(wmScorePackageStatus.getUserScore()));
|
|
|
resSum += userScore;
|
|
@@ -1444,23 +1443,23 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
} else {
|
|
|
if (wmScorePackage.getPackageType1().equals("1") || wmScorePackage.getPackageType1()
|
|
|
.equals("5")) {// 定额
|
|
|
- int sum;
|
|
|
+ long sum;
|
|
|
if (wmScorePackage.getRelationScoreId() == null) {
|
|
|
// 审核不通过的不计入
|
|
|
sum = taskList1.stream()
|
|
|
.filter(task1 -> !"4".equals(task1.getTaskStatus()))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
- res = Integer.parseInt(wmScorePackageStatus.getUserScore()) - sum;
|
|
|
+ res = Long.parseLong(wmScorePackageStatus.getUserScore()) - sum;
|
|
|
if (res > 0) {// 个人积分包值大于任务积分值
|
|
|
wmScorePackageStatus.setUserScore(sum + "");
|
|
|
resSum += res;
|
|
|
}
|
|
|
} else {
|
|
|
- int passed = taskList1.stream()
|
|
|
+ long passed = taskList1.stream()
|
|
|
.filter(task -> ReportEnum.APPROVAL_OPINION_YES.getType()
|
|
|
.equals(task.getReportDrugApprovalOpinion()))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
if (passed == 0) {
|
|
|
wmScorePackage.setScorePackageStatus("6");// 已终止
|
|
@@ -1579,7 +1578,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
// 新增积分记录
|
|
|
SysDeptRechargeRecord newRechargeRecord = new SysDeptRechargeRecord();
|
|
|
newRechargeRecord.setRechargeId(deptRecharge.getId());
|
|
|
- newRechargeRecord.setChangeScore((long) recoveryScore);
|
|
|
+ newRechargeRecord.setChangeScore(recoveryScore);
|
|
|
newRechargeRecord.setCurrentScore(currentScore);
|
|
|
newRechargeRecord.setType(RechargeRecordType.RECOVERY);
|
|
|
newRechargeRecord.setDeptId(deptRecharge.getDeptId());
|
|
@@ -1609,7 +1608,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
// 新增积分记录
|
|
|
SysDeptRechargeRecord newRechargeRecord = new SysDeptRechargeRecord();
|
|
|
newRechargeRecord.setRechargeId(deptRecharge.getId());
|
|
|
- newRechargeRecord.setChangeScore((long) recoveryScore);
|
|
|
+ newRechargeRecord.setChangeScore(recoveryScore);
|
|
|
newRechargeRecord.setCurrentScore(currentScore);
|
|
|
newRechargeRecord.setType(RechargeRecordType.RECOVERY);
|
|
|
newRechargeRecord.setDeptId(deptRecharge.getDeptId());
|
|
@@ -1629,7 +1628,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
* @param Id
|
|
|
* @param score
|
|
|
*/
|
|
|
- public void updateRelationScore(String Id, Integer score) {
|
|
|
+ public void updateRelationScore(String Id, Long score) {
|
|
|
WmScorePackage wmScorePackage = wmScorePackageMapper.selectById(Id);
|
|
|
if (wmScorePackage != null && wmScorePackage.getRelationScoreId() != null) {
|
|
|
WmScorePackage relationScore = wmScorePackageMapper.selectById(wmScorePackage.getRelationScoreId());
|
|
@@ -1652,9 +1651,9 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
packages.forEach(p -> {
|
|
|
List<WmScorePackage> scorePackages = relMap.get(p.getId());
|
|
|
- int sum = 0;
|
|
|
+ long sum = 0;
|
|
|
if (CollUtil.isNotEmpty(scorePackages)) {
|
|
|
- sum = scorePackages.stream().mapToInt(WmScorePackage::getScore).sum();
|
|
|
+ sum = scorePackages.stream().mapToLong(WmScorePackage::getScore).sum();
|
|
|
}
|
|
|
if (Objects.nonNull(p.getScore())) {
|
|
|
p.setScore(p.getScore() - sum);
|
|
@@ -1758,18 +1757,18 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
if (wmScorePackage.getPackageType1().equals("1")) {// 定额
|
|
|
if (!StringUtil.isEmpty(wmScorePackage.getUserScore()) && wmScorePackage.getUserNum() > 0) {
|
|
|
- wmScorePackage.setScore(Integer.valueOf(wmScorePackage.getUserScore()) * wmScorePackage.getUserNum());
|
|
|
+ wmScorePackage.setScore(Long.parseLong(wmScorePackage.getUserScore()) * wmScorePackage.getUserNum());
|
|
|
}
|
|
|
} else {
|
|
|
if (!StringUtil.isEmpty(wmScorePackage.getUserScore())) {
|
|
|
if (PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
|
|
|
// 如果是患者教育,积分值转换为以'分'为单位保存
|
|
|
- int scoreFen = new BigDecimal(wmScorePackage.getUserScore()).multiply(new BigDecimal("100"))
|
|
|
- .intValue();
|
|
|
+ long scoreFen = new BigDecimal(wmScorePackage.getUserScore()).multiply(new BigDecimal("100"))
|
|
|
+ .longValue();
|
|
|
wmScorePackage.setScore(scoreFen);
|
|
|
wmScorePackage.setUserScore(String.valueOf(scoreFen));
|
|
|
} else {
|
|
|
- wmScorePackage.setScore(Integer.valueOf(wmScorePackage.getUserScore()));
|
|
|
+ wmScorePackage.setScore(Long.valueOf(wmScorePackage.getUserScore()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1777,7 +1776,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
WmScorePackage oldScorePackage = wmScorePackageMapper.selectById(wmScorePackage.getId());
|
|
|
|
|
|
// 积分值相比修改前的变动(相对于积分余额,增加则为负-消耗,减少则为正-回收)
|
|
|
- int changeScore = oldScorePackage.getScore() - wmScorePackage.getScore();
|
|
|
+ long changeScore = oldScorePackage.getScore() - wmScorePackage.getScore();
|
|
|
|
|
|
WmScorePackage relationScorePackage = new WmScorePackage();// 关联积分包
|
|
|
// 判断预积分包值不能大于可分配积分值
|
|
@@ -1785,7 +1784,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.equals("-1")) {
|
|
|
WmScorePackage wmScorePackage1 = new WmScorePackage();
|
|
|
wmScorePackage1.setId(wmScorePackage.getRelationScoreId());
|
|
|
- Integer kfpjf;
|
|
|
+ long kfpjf;
|
|
|
|
|
|
List<WmScorePackage> scorePackagekfpjf = this.getScorePackagekfpjf(null, null, new String[]{"0", "1", "2"},
|
|
|
new String[]{wmScorePackage.getRelationScoreId()});
|
|
@@ -1975,7 +1974,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
wmScorePackage.setUpdateUser(SecurityUtils.getUser().getId());
|
|
|
|
|
|
// 查询原积分包值
|
|
|
- int oldPackageScore = this.getById(wmScorePackage.getId()).getScore();
|
|
|
+ long oldPackageScore = this.getById(wmScorePackage.getId()).getScore();
|
|
|
|
|
|
// 没有上级关联包, 则屏蔽推广药品企业
|
|
|
wmScorePackage.setDrugProducerList(null);
|
|
@@ -2302,7 +2301,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
List<Map<String, Object>> m = new ArrayList<>(stepB_1.size() + stepB_2.size());
|
|
|
m.addAll(stepB_1);
|
|
|
m.addAll(stepB_2);
|
|
|
- Map<String, Integer> result = step3(m, wmScorePackage);
|
|
|
+ Map<String, Long> result = step3(m, wmScorePackage);
|
|
|
WmScorePackage p = step4(result, wmScorePackage);
|
|
|
|
|
|
return new AsyncResult<>(p);
|
|
@@ -2344,14 +2343,14 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
);
|
|
|
|
|
|
// 审核通过
|
|
|
- int shtg = taskList.parallelStream()
|
|
|
+ long shtg = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "1") || StrUtil.equals(t.getReportOneApprovalOpinion(), "1"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 审核 不通过
|
|
|
- int shbtg = taskList.parallelStream()
|
|
|
+ long shbtg = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "2") || StrUtil.equals(t.getReportOneApprovalOpinion(), "2"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 审核通过数
|
|
|
long shtgnum = taskList.parallelStream()
|
|
@@ -2362,24 +2361,24 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "2") || StrUtil.equals(t.getReportOneApprovalOpinion(), "2"))
|
|
|
.count();
|
|
|
// 平台未审核
|
|
|
- int temp = taskList.parallelStream()
|
|
|
+ long temp = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "1"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 待审核
|
|
|
- int dsh = taskList.parallelStream()
|
|
|
+ long dsh = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "2"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 已审核
|
|
|
- int ysh = taskList.parallelStream()
|
|
|
+ long ysh = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "3"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 已审核数
|
|
|
long yshnum = taskList.parallelStream().filter(t -> StrUtil.equals(t.getTaskStatus(), "3")).count();
|
|
|
// 已提交
|
|
|
- int ytj = temp + dsh + ysh;
|
|
|
+ long ytj = temp + dsh + ysh;
|
|
|
|
|
|
// 已审核百分比
|
|
|
long yshtt = 0;
|
|
@@ -2388,7 +2387,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
// 审核不通过百分比
|
|
|
long shbtgtt = 0;
|
|
|
if (StrUtil.equals(scorePackage.getPackageType1(), "1")) {
|
|
|
- int score = scorePackage.getScore();
|
|
|
+ long score = scorePackage.getScore();
|
|
|
yshtt = ysh * 100L / score;
|
|
|
yshtt = yshtt > 100 ? 100 : yshtt;
|
|
|
|
|
@@ -2508,7 +2507,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
if (PackageTypeEnum.TYPE1_HCP_PACKAGE.getName().equals(scorePackage.getPackageType1())) {
|
|
|
// 如果是患者教育,则转换积分值 '分'-> '元'
|
|
|
- Integer score = scorePackage.getScore();
|
|
|
+ long score = scorePackage.getScore();
|
|
|
String userScore = scorePackage.getUserScore();
|
|
|
if (StringUtils.isNumeric(userScore)) {
|
|
|
scorePackage.setUserScore(String.format("%.2f", Integer.parseInt(userScore) / 100.0));
|
|
@@ -2570,14 +2569,14 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
);
|
|
|
|
|
|
// 审核通过
|
|
|
- int shtg = taskList.parallelStream()
|
|
|
+ long shtg = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "1") || StrUtil.equals(t.getReportOneApprovalOpinion(), "1"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 审核 不通过
|
|
|
- int shbtg = taskList.parallelStream()
|
|
|
+ long shbtg = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "2") || StrUtil.equals(t.getReportOneApprovalOpinion(), "2"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 审核通过数
|
|
|
long shtgnum = taskList.parallelStream()
|
|
@@ -2588,24 +2587,24 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "2") || StrUtil.equals(t.getReportOneApprovalOpinion(), "2"))
|
|
|
.count();
|
|
|
// 平台未审核
|
|
|
- int temp = taskList.parallelStream()
|
|
|
+ long temp = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus(), "1"))
|
|
|
- .mapToInt(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
+ .mapToLong(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
.sum();
|
|
|
// 待审核
|
|
|
- int dsh = taskList.parallelStream()
|
|
|
+ long dsh = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus(), "2"))
|
|
|
- .mapToInt(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
+ .mapToLong(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
.sum();
|
|
|
// 已审核
|
|
|
- int ysh = taskList.parallelStream()
|
|
|
+ long ysh = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus(), "3"))
|
|
|
- .mapToInt(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
+ .mapToLong(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
.sum();
|
|
|
// 已审核数
|
|
|
long yshnum = taskList.parallelStream().filter(t -> StrUtil.equals(t.getTaskStatus(), "3")).count();
|
|
|
// 已提交
|
|
|
- int ytj = temp + dsh + ysh;
|
|
|
+ long ytj = temp + dsh + ysh;
|
|
|
|
|
|
// 已审核百分比
|
|
|
long yshtt = 0;
|
|
@@ -2615,7 +2614,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
long shbtgtt = 0;
|
|
|
if (StrUtil.equals(scorePackage.getPackageType1(), PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val())
|
|
|
|| StrUtil.equals(scorePackage.getPackageType1(), PackageTypeEnum.TYPE1_SCORE_AND_TASK_PACKAGE.val())) {
|
|
|
- int score = scorePackage.getScore();
|
|
|
+ long score = scorePackage.getScore();
|
|
|
if (score != 0) {
|
|
|
yshtt = ysh * 100L / score;
|
|
|
yshtt = yshtt > 100 ? 100 : yshtt;
|
|
@@ -2752,10 +2751,10 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
if (PackageTypeEnum.TYPE1_HCP_PACKAGE.getName().equals(scorePackage.getPackageType1())) {
|
|
|
// 如果是患者教育,则转换积分值 '分'-> '元'
|
|
|
- Integer score = scorePackage.getScore();
|
|
|
+ long score = scorePackage.getScore();
|
|
|
String userScore = scorePackage.getUserScore();
|
|
|
if (StringUtils.isNumeric(userScore)) {
|
|
|
- scorePackage.setUserScore(String.format("%.2f", Integer.parseInt(userScore) / 100.0));
|
|
|
+ scorePackage.setUserScore(String.format("%.2f", Long.parseLong(userScore) / 100.0));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2844,14 +2843,14 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
List<String> reportWaitingCheckStatus = Arrays.asList("0", "1", "2", "3", "4");
|
|
|
|
|
|
// 审核通过
|
|
|
- int shtg = taskList.parallelStream()
|
|
|
+ long shtg = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "1") && StrUtil.equals(t.getReportOneApprovalOpinion(), "1"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 审核 不通过
|
|
|
- int shbtg = taskList.parallelStream()
|
|
|
+ long shbtg = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "2") || StrUtil.equals(t.getReportOneApprovalOpinion(), "2"))
|
|
|
- .mapToInt(WmTask::getScore)
|
|
|
+ .mapToLong(WmTask::getScore)
|
|
|
.sum();
|
|
|
// 审核通过数
|
|
|
long shtgnum = taskList.parallelStream()
|
|
@@ -2862,25 +2861,25 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.filter(t -> StrUtil.equals(t.getReportDrugApprovalOpinion(), "2") || StrUtil.equals(t.getReportOneApprovalOpinion(), "2"))
|
|
|
.count();
|
|
|
// 平台未审核
|
|
|
- int temp = taskList.parallelStream()
|
|
|
+ long temp = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "1"))
|
|
|
.mapToInt(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
.sum();
|
|
|
// 待审核
|
|
|
- int dsh = taskList.parallelStream()
|
|
|
+ long dsh = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "2"))
|
|
|
.mapToInt(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
.sum();
|
|
|
log.info("dsh_val:<--{}-->", dsh);
|
|
|
// 已审核
|
|
|
- int ysh = taskList.parallelStream()
|
|
|
+ long ysh = taskList.parallelStream()
|
|
|
.filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "3"))
|
|
|
.mapToInt(t -> t.getScore() == null ? 0 : t.getScore())
|
|
|
.sum();
|
|
|
// 已审核数
|
|
|
long yshnum = taskList.parallelStream().filter(t -> StrUtil.equals(t.getTaskStatus().trim(), "3")).count();
|
|
|
// 已提交
|
|
|
- int ytj = temp + dsh + ysh;
|
|
|
+ long ytj = temp + dsh + ysh;
|
|
|
|
|
|
// 已审核百分比
|
|
|
long yshtt = 0;
|
|
@@ -2890,7 +2889,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
long shbtgtt = 0;
|
|
|
if (StrUtil.equals(scorePackage.getPackageType1(), PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val())
|
|
|
|| StrUtil.equals(scorePackage.getPackageType1(), PackageTypeEnum.TYPE1_SCORE_AND_TASK_PACKAGE.val())) {
|
|
|
- int score = scorePackage.getScore();
|
|
|
+ long score = scorePackage.getScore();
|
|
|
if (score != 0) {
|
|
|
yshtt = ysh * 100L / score;
|
|
|
yshtt = yshtt > 100 ? 100 : yshtt;
|
|
@@ -3139,9 +3138,9 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Map<String, Integer> step3(List<Map<String, Object>> m, WmScorePackage wmScorePackage) {
|
|
|
- int payScore = 0;
|
|
|
- int ysh = 0;
|
|
|
+ public Map<String, Long> step3(List<Map<String, Object>> m, WmScorePackage wmScorePackage) {
|
|
|
+ long payScore = 0L;
|
|
|
+ long ysh = 0L;
|
|
|
|
|
|
for (Map<String, Object> tmp : m) {
|
|
|
for (Map.Entry<String, Object> entry : tmp.entrySet()) {
|
|
@@ -3179,19 +3178,19 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
}
|
|
|
|
|
|
|
|
|
- public WmScorePackage step4(Map<String, Integer> payScoreAndYsh, WmScorePackage wmScorePackage) {
|
|
|
- int payScore = payScoreAndYsh.get("payScore");
|
|
|
- int ysh = payScoreAndYsh.get("ysh");
|
|
|
+ public WmScorePackage step4(Map<String, Long> payScoreAndYsh, WmScorePackage wmScorePackage) {
|
|
|
+ long payScore = payScoreAndYsh.get("payScore");
|
|
|
+ long ysh = payScoreAndYsh.get("ysh");
|
|
|
|
|
|
// 完成积分值(最终完成积分值 = 完成积分值 * (1+审核管理费比例))
|
|
|
- int actualScore = BigDecimal.valueOf(ysh).multiply(
|
|
|
+ long actualScore = BigDecimal.valueOf(ysh).multiply(
|
|
|
wmScorePackage.getAuditManagementFeeRates().divide(new BigDecimal("100.00"), 2, RoundingMode.HALF_EVEN).add(BigDecimal.ONE)
|
|
|
- ).intValue();
|
|
|
+ ).longValue();
|
|
|
|
|
|
// payScore(payScore = 完成积分值 * (1+审核管理费比例))
|
|
|
- int actualPayScore = BigDecimal.valueOf(payScore).multiply(
|
|
|
+ long actualPayScore = BigDecimal.valueOf(payScore).multiply(
|
|
|
wmScorePackage.getAuditManagementFeeRates().divide(new BigDecimal("100.00"), 2, RoundingMode.HALF_EVEN).add(BigDecimal.ONE)
|
|
|
- ).intValue();
|
|
|
+ ).longValue();
|
|
|
|
|
|
BigDecimal payRate = new BigDecimal(actualPayScore).multiply(BigDecimal.valueOf(100))
|
|
|
.divide(new BigDecimal(wmScorePackage.getScore()), 2, RoundingMode.HALF_UP);
|
|
@@ -3462,7 +3461,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
throw new RuntimeException("已选择的任务不存在");
|
|
|
}
|
|
|
// 校验已选择的任务分值
|
|
|
- int selectTaskScore = selectTaskList.stream().mapToInt(WmTask::getScore).sum();
|
|
|
+ long selectTaskScore = selectTaskList.stream().mapToLong(WmTask::getScore).sum();
|
|
|
if (!unpackDTO.getSelectTaskScore().equals(selectTaskScore)) {
|
|
|
throw new RuntimeException("已选任务分值不正确");
|
|
|
}
|
|
@@ -3471,7 +3470,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
throw new RuntimeException("“已选总任务积分”必须小于“总积分包值”");
|
|
|
}
|
|
|
// 拆包后的原积分包包值:取剩任务分值
|
|
|
- int oldScorePackageScore = scorePackage.getScore() - selectTaskScore;
|
|
|
+ long oldScorePackageScore = scorePackage.getScore() - selectTaskScore;
|
|
|
if (!unpackDTO.getRemainPackageScore().equals(oldScorePackageScore)) {
|
|
|
throw new RuntimeException("原积分包剩余积分包值不正确");
|
|
|
}
|
|
@@ -3591,7 +3590,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
List<WmTask> taskList = wmTaskMapper.selectList(Wrappers.<WmTask>lambdaQuery().eq(WmTask::getScorePackageId, packageId)
|
|
|
.eq(WmTask::getDelFlag, DelEnum.NOT_DEL.getVal())
|
|
|
.eq(WmTask::getEnableFlag, EnableEnum.ENABLE.val()));
|
|
|
- int approvedScore = 0;
|
|
|
+ long approvedScore = 0L;
|
|
|
if (CollUtil.isNotEmpty(taskList)) {
|
|
|
// 个人包审核情况
|
|
|
boolean pendingTaskApprovalFlag = taskList.stream()
|
|
@@ -3623,7 +3622,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.collect(Collectors.toList());
|
|
|
// 审核通过的积分
|
|
|
approvedScore = approvedTasks.stream()
|
|
|
- .mapToInt(WmTask::getScore).sum();
|
|
|
+ .mapToLong(WmTask::getScore).sum();
|
|
|
} else {
|
|
|
// 没有关联大包的情况
|
|
|
// 审核通过的任务
|
|
@@ -3632,7 +3631,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.collect(Collectors.toList());
|
|
|
// 审核通过的积分
|
|
|
approvedScore = approvedTasks.stream()
|
|
|
- .mapToInt(WmTask::getScore).sum();
|
|
|
+ .mapToLong(WmTask::getScore).sum();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3707,7 +3706,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
|
|
|
// 回收积分
|
|
|
- int recoveryScore = 0;
|
|
|
+ long recoveryScore = 0;
|
|
|
if (UpmsType.TerminatePackageType.ALL.equals(terminatePackageType)) {
|
|
|
// 全部终止
|
|
|
recoveryScore = scorePackage.getScore();
|
|
@@ -3759,13 +3758,13 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
}
|
|
|
|
|
|
// 已分配积分值
|
|
|
- int assignedScore = 0;
|
|
|
+ long assignedScore = 0;
|
|
|
// 查询子包的积分
|
|
|
List<WmScorePackage> subPackages = this.list(Wrappers.<WmScorePackage>lambdaQuery()
|
|
|
.eq(WmScorePackage::getRelationScoreId, packageId)
|
|
|
.ne(WmScorePackage::getScorePackageStatus, ScorePackageStatusEnum.TERMINATED.val()));
|
|
|
if (CollUtil.isNotEmpty(subPackages)) {
|
|
|
- assignedScore += subPackages.stream().mapToInt(WmScorePackage::getScore).sum();
|
|
|
+ assignedScore += subPackages.stream().mapToLong(WmScorePackage::getScore).sum();
|
|
|
}
|
|
|
// 查询企业任务的积分
|
|
|
List<WmTask> entTaskList = wmTaskMapper.selectList(Wrappers.<WmTask>lambdaQuery()
|
|
@@ -3775,9 +3774,9 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
}
|
|
|
|
|
|
// 实际已分配积分值(实际已分配积分值 = 已分配积分值 * (1+审核管理费比例))
|
|
|
- int actualAssignedScore = BigDecimal.valueOf(assignedScore).multiply(
|
|
|
+ long actualAssignedScore = BigDecimal.valueOf(assignedScore).multiply(
|
|
|
scorePackage.getAuditManagementFeeRates().divide(new BigDecimal("100.00"), RoundingMode.HALF_EVEN).add(BigDecimal.ONE)
|
|
|
- ).intValue();
|
|
|
+ ).longValue();
|
|
|
log.info("当前积分包pacakgeId={},已分配积分值={},实际已分配积分值={}", scorePackage.getId(), assignedScore, actualAssignedScore);
|
|
|
|
|
|
log.info("当前积分包终止前数据:{}", scorePackage);
|
|
@@ -3804,7 +3803,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
updateEntity.setId(packageId);
|
|
|
updateEntity.setEnableType(terminatePackageType.getEnableType());
|
|
|
updateEntity.setScore(assignedScore);
|
|
|
- updateEntity.setKfpjf(0);
|
|
|
+ updateEntity.setKfpjf(0L);
|
|
|
updateEntity.setUpdateTime(now);
|
|
|
updateEntity.setUpdateUser(userId);
|
|
|
log.info("更新积分包参数:{}", updateEntity);
|
|
@@ -3812,7 +3811,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
}
|
|
|
|
|
|
// 回收积分值
|
|
|
- int recoveryScore = 0;
|
|
|
+ long recoveryScore = 0;
|
|
|
if (UpmsType.TerminatePackageType.ALL.equals(terminatePackageType) || assignedScore <= 0) {
|
|
|
// 回收整包积分值
|
|
|
recoveryScore = scorePackage.getScore();
|
|
@@ -3847,7 +3846,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
* @param packageId 积分包id
|
|
|
* @param recoveryScore 回收积分值
|
|
|
*/
|
|
|
- private void updateDeptRecharge(String packageId, int recoveryScore) {
|
|
|
+ private void updateDeptRecharge(String packageId, long recoveryScore) {
|
|
|
Integer userId = SecurityUtils.getUser().getId();
|
|
|
Integer deptId = SecurityUtils.getUser().getDeptId();
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
@@ -3878,8 +3877,8 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
// 新增积分记录
|
|
|
SysDeptRechargeRecord newRechargeRecord = new SysDeptRechargeRecord();
|
|
|
newRechargeRecord.setRechargeId(deptRecharge.getId());
|
|
|
- newRechargeRecord.setChangeScore((long) recoveryScore);
|
|
|
- newRechargeRecord.setCurrentScore((long) currentScore);
|
|
|
+ newRechargeRecord.setChangeScore(recoveryScore);
|
|
|
+ newRechargeRecord.setCurrentScore(currentScore);
|
|
|
newRechargeRecord.setType(RechargeRecordType.RECOVERY);
|
|
|
newRechargeRecord.setDeptId(deptRecharge.getDeptId());
|
|
|
if (rechargeRecord != null) {
|
|
@@ -3927,11 +3926,11 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.eq(WmScorePackage::getDelFlag, DelEnum.NOT_DEL.getVal())
|
|
|
.eq(WmScorePackage::getEnableFlag, EnableEnum.ENABLE.val())
|
|
|
.ne(WmScorePackage::getScorePackageStatus, ScorePackageStatusEnum.TERMINATED.val()));
|
|
|
- Map<String, Integer> relatedPackageScoresMap = new HashMap<>();
|
|
|
+ Map<String, Long> relatedPackageScoresMap = new HashMap<>();
|
|
|
if (CollUtil.isNotEmpty(subPackages)) {
|
|
|
// 已分配的积分
|
|
|
relatedPackageScoresMap = subPackages.stream()
|
|
|
- .collect(Collectors.groupingBy(WmScorePackage::getRelationScoreId, Collectors.summingInt(WmScorePackage::getScore)));
|
|
|
+ .collect(Collectors.groupingBy(WmScorePackage::getRelationScoreId, Collectors.summingLong(WmScorePackage::getScore)));
|
|
|
}
|
|
|
|
|
|
// 查询当前积分包的直接关联的任务
|
|
@@ -3947,18 +3946,18 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.collect(Collectors.groupingBy(WmTask::getScorePackageId, Collectors.summingInt(WmTask::getScore)));
|
|
|
}
|
|
|
|
|
|
- Map<String, Integer> finalRelatedPackageScoresMap = relatedPackageScoresMap;
|
|
|
+ Map<String, Long> finalRelatedPackageScoresMap = relatedPackageScoresMap;
|
|
|
Map<String, Integer> finalRelatedTaskScoresMap = relatedTaskScoresMap;
|
|
|
packages.forEach(pkg -> {
|
|
|
String packageId = pkg.getId();
|
|
|
// 统计可分配积分值
|
|
|
- Integer score = pkg.getScore();
|
|
|
+ long score = pkg.getScore();
|
|
|
// 实际可下发积分值 = 可分配积分值 / (1+审核管理费比例)
|
|
|
- int actualScore = BigDecimal.valueOf(score).divide(
|
|
|
+ long actualScore = BigDecimal.valueOf(score).divide(
|
|
|
pkg.getAuditManagementFeeRates().divide(new BigDecimal("100.00"), RoundingMode.HALF_EVEN)
|
|
|
.add(BigDecimal.ONE),
|
|
|
RoundingMode.HALF_EVEN
|
|
|
- ).intValue();
|
|
|
+ ).longValue();
|
|
|
|
|
|
// 减去直接关联的下级包的积分值
|
|
|
if (finalRelatedPackageScoresMap.containsKey(packageId)) {
|
|
@@ -4129,7 +4128,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
new String[]{wmScorePackage.getRelationScoreId()});
|
|
|
|
|
|
if (CollUtil.isNotEmpty(scorePackagekfpjf)) {
|
|
|
- int kfpjf = scorePackagekfpjf.get(0).getKfpjf();
|
|
|
+ long kfpjf = scorePackagekfpjf.get(0).getKfpjf();
|
|
|
if (wmScorePackage.getScore() > kfpjf) {
|
|
|
log.error("可分配积分值不足");
|
|
|
throw new BizException("可分配积分值不足");
|
|
@@ -4292,7 +4291,7 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
WmScorePackage relPkg = this.getById(relPkgId);
|
|
|
// 是当前操作人所在企业的的关联包
|
|
|
if (relPkg != null && deptId.toString().equals(relPkg.getDeptId())) {
|
|
|
- relPkg.setKfpjf((int) Math.ceil(relPkg.getKfpjf() - wmScorePackage.getScore()));
|
|
|
+ relPkg.setKfpjf(Double.valueOf(Math.ceil(relPkg.getKfpjf() - wmScorePackage.getScore())).longValue());
|
|
|
// 判断积分包是否被发放 (原有外包业务逻辑,不知道为什么)
|
|
|
int count = this.count(Wrappers.<WmScorePackage>lambdaQuery()
|
|
|
.ne(WmScorePackage::getId, wmScorePackage.getId())
|
|
@@ -4474,11 +4473,11 @@ public class WmScorePackaeServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
pkg.setStartTime(planIssue);
|
|
|
pkg.setEndTime(plan.getPlanExpiry());
|
|
|
pkg.setEntTaskLimit(BigDecimal.ZERO);
|
|
|
- pkg.setKfpjf(0);
|
|
|
+ pkg.setKfpjf(0L);
|
|
|
pkg.setPlanId(plan.getPlanId());
|
|
|
pkg.setRelatedService(deptId.toString());
|
|
|
pkg.setRelationScoreId("");
|
|
|
- pkg.setScore(plan.getPlanScore().intValue());
|
|
|
+ pkg.setScore(plan.getPlanScore());
|
|
|
pkg.setScorePackageName(res.getPkgName());
|
|
|
pkg.setWmScoreTaskTypeList(scoreTaskTypes);
|
|
|
|