1、需求查询 支持同时查询多个需求状态

This commit is contained in:
2025-12-25 09:45:18 +08:00
parent 20a0dd2ac9
commit 8abd4d2117

View File

@@ -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<String> 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<SpdmTaskVo> 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<String> 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<SpdmTaskVo> 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);