提交 300c3e79 authored 作者: tykj's avatar tykj

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

上级 561f3a23
......@@ -651,7 +651,7 @@ public class DeviceCheckController {
}
@ApiOperation(value = "检查地区是否可以发起核查", notes = "检查地区是否可以发起核查")
@PostMapping("/checkPossible")
@PostMapping("/checkPossible/bak")
public ResponseEntity checkPossible(@RequestBody UnitIds unitIds) {
List<String> unitNames = unitIds.getIds().stream()
.map(id -> auService.findOne(AuExample.UnitId, id))
......
......@@ -131,9 +131,24 @@ public class ExamController {
}
@ApiOperation(value = "检查地区是否可以发起核查,并返回没有装备的单位id", notes = "检查地区是否可以发起核查")
@PostMapping("/checkPossible")
public ResponseEntity checkPossible(@RequestBody UnitIds unitIds) {
return ResponseEntity.ok(new UnitIds(checkUnitService.findUnExistDevice(unitIds.getIds())));
@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<Integer> collect = units.stream().filter(o -> o.getLevel() == 2).map(Units::getUnitId).collect(toList());
if (!collect.isEmpty()) {
for (Integer integer : collect) {
List<Units> bySubordinateAll = unitsService.findBySubordinateAll(integer);
List<Integer> unExistDevice = checkUnitService.findUnExistDevice(bySubordinateAll.stream().map(Units::getUnitId).collect(toList()));
units.addAll(unitsRepo.findAllById(unExistDevice));
}
}
return ResponseEntity.ok(units.stream().distinct().collect(toList()));
}
return ResponseEntity.ok(units);
}
@GetMapping("/confirm/unit")
......@@ -141,11 +156,7 @@ public class ExamController {
public ResponseEntity findDefaultUnits(@RequestParam(defaultValue = "false") boolean isExam) {
Map<Integer, List<Units>> checkUnit = checkUnitService.findCheckUnit(isExam);
// 需要去除掉被托管的单位
ArrayList<Units> units = new ArrayList<>();
units.addAll(checkUnit.get(1));
units.addAll(checkUnit.get(2));
units.addAll(checkUnit.get(3));
return ResponseEntity.ok(new ResultObj<>(units));
return ResponseEntity.ok(new ResultObj<>(checkUnit));
}
@ApiOperation(value = "发起核查", notes = "对指定单位发起核查任务")
......@@ -264,7 +275,7 @@ public class ExamController {
// 3-1-2 构建省局单位的任务
TaskBto taskBtoPro = new Task(CHECK_EXAM_STAT_1.id,
// getUnitDateString(startUnit, ceVo.getTitle()),
// getUnitDateString(startUnit , ceVo.getTitle()),
getUnitDateString(startUnit, "省局单位检查任务"),
cityStatTask.getId(), ".0.", CONFIRM_CHECK_STAT.id, proStatSave.getId(), startUnitId)
.parse2Bto();
......
......@@ -1279,7 +1279,8 @@ public class TaskServiceImpl implements TaskService {
boolean belongUnit = taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId());
boolean isCountry = taskSelectVo.getType() == null || (taskSelectVo.getType() == 1 ? (taskBto.getCustomInfo() == null || (!"country".equals(taskBto.getCustomInfo()) && !"country1".equals(taskBto.getCustomInfo()))) : (taskBto.getCustomInfo() != null && ("country".equals(taskBto.getCustomInfo()) || "country1".equals(taskBto.getCustomInfo()))));
return involveExists && pointExists && (userConfirm || (noUserHandle && belongUnit)) && isCountry;
})
}).filter(o -> !(o.getBusinessType() == 7 && "-1".equals(o.getRemark()))).filter(o -> !(o.getBusinessType() == 8 && "-1".equals(o.getRemark())))
.collect(Collectors.toList());
//查询所有的业务
if (bussinessType == null ||bussinessType.isEmpty()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论