提交 3335519d authored 作者: tykj's avatar tykj

feat:检查模块功能变更流程

上级 231bb82f
......@@ -152,9 +152,11 @@ public class ExamController {
@ApiOperation(value = "检查地区是否可以发起核查,并返回没有装备的单位id", notes = "检查地区是否可以发起核查")
@PostMapping("/confirm/checkPossible")
public ResponseEntity checkPossible(@RequestBody UnitIds unitIds, @RequestParam(defaultValue = "false") boolean isExam) {
List<Units> units = unitsRepo.findAllById(checkUnitService.findUnExistDevice(unitIds.getIds()));
if (!isExam) {
// 核查
List<Units> rs = new ArrayList<>();
rs.addAll(unitsRepo.findAllById(checkUnitService.findUnExistDevice(unitIds.getIds())));
List<Integer> collect = unitsRepo.findAllById(unitIds.getIds()).stream().filter(o -> o.getLevel() == 2).map(Units::getUnitId).collect(toList());
log.info("[check] 获取核查单位,{}", collect);
......@@ -164,13 +166,15 @@ public class ExamController {
log.info("[check] 查询市级核查单位:{}", bySubordinateAll);
List<Integer> unExistDevice = checkUnitService.findUnExistDevice(bySubordinateAll.stream().map(Units::getUnitId).collect(toList()));
log.info("[check] 市级无装备的单位:{}", unExistDevice);
units.addAll(unitsRepo.findAllById(unExistDevice));
rs.addAll(unitsRepo.findAllById(unExistDevice));
}
}
return ResponseEntity.ok(units.stream().distinct().collect(toList()));
return ResponseEntity.ok(rs.stream().distinct().collect(toList()));
} else {
// 检查
List<Units> units = unitsRepo.findAllById(checkUnitService.findUnExistDevice(unitIds.getIds()));
return ResponseEntity.ok(units);
}
return ResponseEntity.ok(units);
}
@GetMapping("/confirm/unit")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论