提交 65d679e5 authored 作者: Matrix's avatar Matrix

feat(核查模块): 增加了未完成单位的统计提示,以及补充了省撤回的履历日志

上级 affb3b55
......@@ -1315,6 +1315,31 @@ public class DeviceCheckController {
}
}
@ApiOperation(value = "查询还有哪些单位的自查没有完成,给出单位名称")
@GetMapping("/stat/shutdown/{statId}")
public ResponseEntity queryNotFinish(@PathVariable Integer statId){
Task checkTask = taskRepo.findByBillIdAndBusinessType(statId, CONFIRM_CHECK_STAT.id).get();
List<Task> l1Childs = taskRepo.findAllByParentTaskId(checkTask.getId());
List<String> unitNames = new ArrayList<>();
for (Task c1 : l1Childs) {
if (predNodeType(c1).equals(CcNodeType.EXAM)) {
List<Task> detailTaskList = taskRepo.findAllByParentTaskId(c1.getId());
List<String> notEndUnitNames = detailTaskList
.stream().filter(task -> !task.getBillStatus().equals(END.id))
.map(task -> unitsRepo.findById(task.getOwnUnit()).get().getName())
.collect(toList());
unitNames.addAll(notEndUnitNames);
}else if (predNodeType(c1).equals(CcNodeType.MANUAL)&& !c1.getBillStatus().equals(END.id)){
String unitName = unitsRepo.findById(c1.getOwnUnit()).get().getName();
unitNames.add(unitName);
}
}
return ResponseEntity.ok(unitNames);
}
@ApiOperation(value = "终结stat任务,多指核查任务")
@PutMapping("/stat/shutdown/{statId}")
public ResponseEntity shutDown(@PathVariable Integer statId) {
......@@ -1857,6 +1882,13 @@ public class DeviceCheckController {
TaskBto newTask = currentTask.toDo().copy().parse2Bto();
currentTask.setCustomInfo(currentTask.getCustomInfo());
taskService.moveToEnd(currentTask);
// 补充退回日志
String adminUser = authenticationUtils.getAuthentication().getCurrentUserInfo().getName();
String shutDownMsg = String.format("专管员[%s]退回了该任务", adminUser);
TaskLogBto taskLog = new TaskLogBto(currentTask.getId(), shutDownMsg);
taskLogService.addLog(taskLog);
// 创建新的detail 新的detail会在B的时候加入,所以老的stat要去除掉
DeviceCheckDetail cDetail = detail.copyWithoutId();
cDetail.setId(null);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论