1、数据查询 bugfix
This commit is contained in:
@@ -974,20 +974,26 @@ public class TaskServiceImpl implements ITaskService {
|
||||
String workspaceNodeId = req.getWorkspaceNodeId();
|
||||
String disciplineNodeId = req.getDisciplineNodeId();
|
||||
String nodeId = "";
|
||||
String nodeTag = "";
|
||||
if (StringUtils.isNotBlank(projectNodeId)) {
|
||||
nodeId = projectNodeId;
|
||||
nodeTag = "tag1";
|
||||
}
|
||||
if (StringUtils.isNotBlank(phaseNodeId)) {
|
||||
nodeId = phaseNodeId;
|
||||
nodeTag = "tag2";
|
||||
}
|
||||
if (StringUtils.isNotBlank(machineNodeId)) {
|
||||
nodeId = machineNodeId;
|
||||
nodeTag = "tag4";
|
||||
}
|
||||
if (StringUtils.isNotBlank(workspaceNodeId)) {
|
||||
nodeId = workspaceNodeId;
|
||||
nodeTag = "tag5";
|
||||
}
|
||||
if (StringUtils.isNotBlank(disciplineNodeId)) {
|
||||
nodeId = disciplineNodeId;
|
||||
nodeTag = "tag6";
|
||||
}
|
||||
List<String> allNodeIdList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(nodeId)) {
|
||||
@@ -996,14 +1002,41 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
String taskNodeId = req.getTaskNodeId();
|
||||
List<SpdmAnalysisTaskVo> taskVoList;
|
||||
if (StringUtils.isNotBlank(taskNodeId)) {
|
||||
taskVoList = mapper.getAnalysisTask(taskNodeId);
|
||||
}else {
|
||||
taskVoList = mapper.taskList(req, tenantId, allNodeIdList, pos, limit);
|
||||
}
|
||||
List<SpdmAnalysisTaskVo> allTaskVoList = new ArrayList<>();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("total", taskVoList.size());
|
||||
taskVoList = taskVoList.stream().skip((long) (req.getCurrent() - 1) * req.getSize()).limit(req.getSize()).toList();
|
||||
jsonObject.put("total", 0);
|
||||
if (StringUtils.isNotBlank(taskNodeId)) {
|
||||
allTaskVoList = mapper.getAnalysisTask(taskNodeId);
|
||||
}else {
|
||||
taskVoList = mapper.taskList(req, tenantId, new ArrayList<>(), pos, limit);
|
||||
if (CollectionUtils.isEmpty(taskVoList)) {
|
||||
log.error("数据分析中未查询到任务信息");
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
if (StringUtils.isNotBlank(nodeId) && StringUtils.isNotBlank(nodeTag)) {
|
||||
String currentNodeTagId = "";
|
||||
for (SpdmAnalysisTaskVo spdmTaskVo : taskVoList) {
|
||||
try {
|
||||
currentNodeTagId = getTagProperty(spdmTaskVo, nodeTag);
|
||||
if (StringUtils.isNotBlank(currentNodeTagId) && currentNodeTagId.contains(nodeId)) {
|
||||
allTaskVoList.add(spdmTaskVo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
allTaskVoList = taskVoList;
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isEmpty(allTaskVoList)) {
|
||||
log.error("数据分析中未查询到任务信息");
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
|
||||
taskVoList = allTaskVoList.stream().skip((long) (req.getCurrent() - 1) * req.getSize()).limit(req.getSize()).toList();
|
||||
if (CollectionUtils.isEmpty(taskVoList)) {
|
||||
log.error("数据分析中未查询到任务信息");
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
@@ -1056,7 +1089,8 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
jsonObject.put("currentPage", req.getCurrent());
|
||||
jsonObject.put("pageSize", req.getSize());
|
||||
jsonObject.put("data", taskVoList.stream().skip((long) (req.getCurrent() - 1) * req.getSize()).limit(req.getSize()).toList());
|
||||
jsonObject.put("total", taskVoList.size());
|
||||
jsonObject.put("data", taskVoList);
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user