|
@@ -16,6 +16,7 @@
|
|
|
*/
|
|
|
package com.qunzhixinxi.hnqz.admin.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.csp.sentinel.util.StringUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
@@ -919,8 +920,8 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
wmScorePackage.setScorePackageStatus("4");//已完成待结算
|
|
|
//部分终止,收回剩余积分值,没有审核的任务继续审核
|
|
|
//先更新任务状态为已审核
|
|
|
- Integer resSum = 0;//收回值
|
|
|
- if (null != scorestatusList && scorestatusList.size() > 0) {
|
|
|
+ int resSum = 0;//收回值
|
|
|
+ if (CollUtil.isNotEmpty(scorestatusList)) {
|
|
|
wmScorePackage.setUserNum(scorestatusList.size());
|
|
|
for (WmScorePackageStatus wmScorePackageStatus : scorestatusList) {
|
|
|
WmTask wmTask1 = new WmTask();
|
|
@@ -930,7 +931,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
wmTask1.setTaskStatus("1,2,3");
|
|
|
List<WmTask> taskList1 = wmTaskMapper.selectByTask(wmTask1);
|
|
|
Integer res = 0;
|
|
|
- if (taskList1 == null || taskList1.size() == 0) {
|
|
|
+ if ( CollUtil.isEmpty(taskList1)) {
|
|
|
if (wmScorePackage.getPackageType1().equals("1") || wmScorePackage.getPackageType1().equals("5")) {//定额
|
|
|
//这个用户还没有做任务时,积分值设为0
|
|
|
wmScorePackageStatus.setUserScore("0");
|
|
@@ -946,12 +947,18 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
} else {
|
|
|
if (wmScorePackage.getPackageType1().equals("1") || wmScorePackage.getPackageType1().equals("5")) {//定额
|
|
|
- Integer sum = taskList1.stream().mapToInt(WmTask::getScore).sum();
|
|
|
- res = Integer.valueOf(wmScorePackageStatus.getUserScore()) - sum;
|
|
|
+ int sum = taskList1.stream().mapToInt(WmTask::getScore).sum();
|
|
|
+ if (StringUtils.equals(wmScorePackage.getDeptId(),wmScorePackage.getSendPackageDeptId())){
|
|
|
+ res = Integer.parseInt(wmScorePackageStatus.getUserScore()) - sum;
|
|
|
+ } else {
|
|
|
+ res = sum;
|
|
|
+ }
|
|
|
+
|
|
|
if (res > 0) {//个人积分包值大于任务积分值
|
|
|
wmScorePackageStatus.setUserScore(sum + "");
|
|
|
resSum += res;
|
|
|
}
|
|
|
+
|
|
|
} else {//2,3 定量
|
|
|
//定量收回任务个数
|
|
|
wmScorePackageStatus.setTaskNum(taskList1.size());
|