提交 f10e4809 authored 作者: ljj234's avatar ljj234

fix: 修正核查终止任务时,返回未检查单位名称错误问题

上级 c9fe4a85
...@@ -1094,26 +1094,19 @@ public class DeviceCheckController { ...@@ -1094,26 +1094,19 @@ public class DeviceCheckController {
for (Task c1 : l1Childs) { for (Task c1 : l1Childs) {
if (predNodeType(c1).equals(CcNodeType.EXAM) || predNodeType(c1).equals(CcNodeType.CHECK)) { if (predNodeType(c1).equals(CcNodeType.EXAM) || predNodeType(c1).equals(CcNodeType.CHECK)) {
List<Task> detailTaskList = taskRepo.findAllByParentTaskId(c1.getId()); List<Task> detailTaskList = taskRepo.findAllByParentTaskId(c1.getId());
if (detailTaskList.isEmpty()) { if (!detailTaskList.isEmpty()) {
// unitNames.add(unitsRepo.findById(c1.getOwnUnit()).get().getName()); List<String> notEndUnitNames = detailTaskList
unitNames.add(detailRepo.findById(c1.getBillId()).get().getCheckUnit()); .stream().filter(task -> !task.getBillStatus().equals(END.id) && !task.getBillStatus().equals(CHECK_SHUT_DOWN.id))
} else { .map(task -> unitsRepo.findById(task.getOwnUnit()).get().getName())
// List<String> notEndUnitNames = detailTaskList .collect(toList());
// .stream().filter(task -> !task.getBillStatus().equals(END.id))
// .map(task -> unitsRepo.findById(task.getOwnUnit()).get().getName())
// .collect(toList());
List<String> notEndUnitNames = detailRepo.findAllById(detailTaskList.stream().map(Task::getBillId).collect(toList()))
.stream().map(DeviceCheckDetail::getCheckUnit).collect(toList());
unitNames.addAll(notEndUnitNames); unitNames.addAll(notEndUnitNames);
} }
} else if (predNodeType(c1).equals(CcNodeType.MANUAL) && !c1.getBillStatus().equals(END.id)) { } else if (predNodeType(c1).equals(CcNodeType.MANUAL) && !c1.getBillStatus().equals(END.id) && !c1.getBillStatus().equals(CHECK_SHUT_DOWN.id)) {
String checkUnit = detailRepo.findById(c1.getBillId()).get().getCheckUnit(); String checkUnit = detailRepo.findById(c1.getBillId()).get().getCheckUnit();
// String unitName = unitsRepo.findById(c1.getOwnUnit()).get().getName(); // String unitName = unitsRepo.findById(c1.getOwnUnit()).get().getName();
unitNames.add(checkUnit); unitNames.add(checkUnit);
} }
} }
return ResponseEntity.ok(unitNames); return ResponseEntity.ok(unitNames);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论