|
@@ -70,11 +70,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* 报告审核表
|
|
@@ -540,13 +542,44 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
|
return R.failed("任务类型不存在");
|
|
|
}
|
|
|
|
|
|
- WmReport queryReport = new WmReport();
|
|
|
- queryReport.setDrugEntId(SecurityUtils.getUser().getDeptId());
|
|
|
- queryReport.setTaskTypeIdList(baseTaskTypeList.stream().map(WmTaskType::getId).collect(Collectors.toList()));
|
|
|
+ // 根据drugEntId查询WmReport
|
|
|
+// List<WmReport> wmReportList = wmReportMapper.selectList(Wrappers.<WmReport>lambdaQuery()
|
|
|
+// .eq(WmReport::getDrugEntId, SecurityUtils.getUser().getDeptId()));
|
|
|
+
|
|
|
+// WmReport queryReport = new WmReport();
|
|
|
+// queryReport.setDrugEntId(SecurityUtils.getUser().getDeptId());
|
|
|
+// queryReport.setTaskTypeIdList(baseTaskTypeList.stream().map(WmTaskType::getId).collect(Collectors.toList()));
|
|
|
+
|
|
|
+ Map<String, Object> entTaskStatusMap = new HashMap<>();
|
|
|
+ entTaskStatusMap.put("drugEntId", SecurityUtils.getUser().getDeptId());
|
|
|
+ entTaskStatusMap.put("taskTypeIdList", baseTaskTypeList.stream().map(WmTaskType::getId).collect(Collectors.toList()));
|
|
|
+// entTaskStatusMap.put("reportIdList", wmReportList.stream().map(WmReport::getId).collect(Collectors.toList()));
|
|
|
+
|
|
|
+ // 拆分是否通过状态、待审核状态,用于sql优化~
|
|
|
if (ArrayUtil.isNotEmpty(entTaskStatus)) {
|
|
|
- queryReport.setEntTaskStatus(Arrays.asList(entTaskStatus));
|
|
|
+ // 通过状态
|
|
|
+ String approvedStatus = "";
|
|
|
+ // 待审核状态
|
|
|
+ String waitStatus = "";
|
|
|
+ if (ArrayUtil.containsAll(entTaskStatus, "1", "2")) {
|
|
|
+ // 通过+不通过
|
|
|
+ approvedStatus = "1,2";
|
|
|
+ } else if (ArrayUtil.contains(entTaskStatus, "1")) {
|
|
|
+ // 通过
|
|
|
+ approvedStatus = "1";
|
|
|
+ } else if (ArrayUtil.contains(entTaskStatus, "2")) {
|
|
|
+ // 不通过
|
|
|
+ approvedStatus = "2";
|
|
|
+ }
|
|
|
+ if (ArrayUtil.contains(entTaskStatus, "0")) {
|
|
|
+ // 待审核
|
|
|
+ waitStatus = "0";
|
|
|
+ }
|
|
|
+ entTaskStatusMap.put("approvedStatus", approvedStatus);
|
|
|
+ entTaskStatusMap.put("waitStatus", waitStatus);
|
|
|
+// queryReport.setEntTaskStatus(entTaskStatusMap);
|
|
|
}
|
|
|
- IPage<WmTaskVO> pages = wmTaskMapper.entTaskPageByTaskType(page, queryReport);
|
|
|
+ IPage<WmTaskVO> pages = wmTaskMapper.entTaskPageByTaskType(page, entTaskStatusMap);
|
|
|
|
|
|
Page<Map<String, Object>> mapPage = new Page<>(pages.getCurrent(), pages.getSize(), pages.getTotal());
|
|
|
List<WmTaskVO> taskList = pages.getRecords();
|
|
@@ -565,7 +598,9 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
|
// 姓名
|
|
|
if (StringUtils.isNumeric(wmtask.getTaskUserId())) {
|
|
|
SysUser user = sysUserService.getById(Integer.parseInt(wmtask.getTaskUserId()));
|
|
|
- map.put("taskUsername", user.getRealname());
|
|
|
+ if (user != null) {
|
|
|
+ map.put("taskUsername", user.getRealname());
|
|
|
+ }
|
|
|
}
|
|
|
// 积分包名称设置到scorePackageId上 适配页面
|
|
|
map.put("scorePackageId", wmtask.getScorePackageName());
|