diff --git a/project/src/main/java/com/sdm/project/service/impl/DemandServiceImpl.java b/project/src/main/java/com/sdm/project/service/impl/DemandServiceImpl.java index 96238640..3310e794 100644 --- a/project/src/main/java/com/sdm/project/service/impl/DemandServiceImpl.java +++ b/project/src/main/java/com/sdm/project/service/impl/DemandServiceImpl.java @@ -370,8 +370,10 @@ public class DemandServiceImpl extends BaseService implements IDemandService { // 需求的状态和进度需要根据任务来确定 if (StringUtils.isNotBlank(req.getAchieveStatus()) || StringUtils.isNotBlank(req.getDemandStatus())) { if (StringUtils.isNotBlank(req.getAchieveStatus())) { + String achieveStatus = req.getAchieveStatus(); + List achieveStatusList = Arrays.stream(achieveStatus.split(",")).toList(); if (CollectionUtils.isEmpty(taskList)) { - demandList = demandList.stream().filter(firstDemand -> req.getAchieveStatus().equals(firstDemand.getAchieveStatus())).toList(); + demandList = demandList.stream().filter(firstDemand -> achieveStatusList.contains(firstDemand.getAchieveStatus())).toList(); } else { List eachTaskList; String eachStatus; @@ -380,7 +382,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService { eachTaskList = taskMap.get(demand.getUuid()); if (CollectionUtils.isEmpty(eachTaskList)) { log.info("当前需求:{}没有关联的任务", demand.getId()); - if (req.getAchieveStatus().equals(demand.getAchieveStatus())) { + if (achieveStatusList.contains(demand.getAchieveStatus())) { newDemandList.add(demand); } } else { @@ -392,7 +394,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService { eachStatus = TaskAchieveStatusEnum.QUALIFIED.getCode(); } log.info("当前需求:{}的风险状态为:{}", demand.getId(), eachStatus); - if (!eachStatus.equals(req.getAchieveStatus())) { + if (!achieveStatusList.contains(eachStatus)) { continue; } newDemandList.add(demand); @@ -408,8 +410,10 @@ public class DemandServiceImpl extends BaseService implements IDemandService { } if (StringUtils.isNotBlank(req.getDemandStatus())) { + String demandStatus = req.getDemandStatus(); + List demandStatusList = Arrays.stream(demandStatus.split(",")).toList(); if (CollectionUtils.isEmpty(taskList)) { - demandList = demandList.stream().filter(firstDemand -> req.getDemandStatus().equals(firstDemand.getDemandStatus())).toList(); + demandList = demandList.stream().filter(firstDemand -> demandStatusList.contains(firstDemand.getDemandStatus())).toList(); } else { List eachTaskList; String eachStatus = ""; @@ -418,7 +422,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService { eachTaskList = taskMap.get(demand.getUuid()); if (CollectionUtils.isEmpty(eachTaskList)) { log.info("当前需求:{}没有关联的任务", demand.getId()); - if (req.getDemandStatus().equals(demand.getDemandStatus())) { + if (demandStatusList.contains(demand.getDemandStatus())) { newDemandList.add(demand); } } else { @@ -452,7 +456,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService { eachStatus = TaskExeStatusEnum.IN_PROGRESS.getCode(); } log.info("当前需求:{}的需求状态为:{}", demand.getId(), eachStatus); - if (!eachStatus.equals(req.getDemandStatus())) { + if (!demandStatusList.contains(eachStatus)) { continue; } newDemandList.add(demand);