提交 1faedea4 authored 作者: zhoushaopan's avatar zhoushaopan

fix(核查模块): 李师傅自行修改 核查退回

李师傅自行修改 核查退回
上级 9bc2c3aa
package com.tykj.dev.device.confirmcheck.controller; package com.tykj.dev.device.confirmcheck.controller;
import cn.hutool.core.lang.Func;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -61,6 +62,7 @@ import java.time.LocalTime; ...@@ -61,6 +62,7 @@ import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors;
import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_DETAIL; import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_DETAIL;
import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_STAT; import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_STAT;
...@@ -265,13 +267,24 @@ public class DeviceCheckController { ...@@ -265,13 +267,24 @@ public class DeviceCheckController {
} }
@GetMapping("/detail/refresh/active/{id}") @GetMapping("/detail/refresh/active/{id}")
public ResponseEntity<String> activeSpecialData(@PathVariable Integer id,@RequestParam String unitName1,@RequestParam(defaultValue = "") String unitName2){ public ResponseEntity<String> activeSpecialData(@PathVariable Integer id,@RequestParam Integer unitId1,@RequestParam(defaultValue = "0") Integer unitId2){
log.info("[核查模块] 特殊数据处理,设置specialDetailId = {},specialUnits = {} {} ",id,unitName1,unitName2);
specialDetailId = id; String unitName1 = "";
specialUnits.add(unitName1); String unitName2 = "";
unitName1 = unitsRepo.findById(unitId1).get().getName();
unitName2 = unitsRepo.findById(unitId2).get().getName();
if (!StringUtils.isEmpty(unitName1)){
specialUnits.add(unitName1);
}
if (!StringUtils.isEmpty(unitName2)){ if (!StringUtils.isEmpty(unitName2)){
specialUnits.add(unitName2); specialUnits.add(unitName2);
} }
log.info("[核查模块] 特殊数据处理,设置specialDetailId = {},specialUnitsId = {} {} ",id,unitId1,unitId2);
specialDetailId = id;
return ResponseEntity.ok("设置特殊数据处理成功"); return ResponseEntity.ok("设置特殊数据处理成功");
} }
...@@ -313,6 +326,8 @@ public class DeviceCheckController { ...@@ -313,6 +326,8 @@ public class DeviceCheckController {
} }
detail.updateDevice(devInLib, devNotInLib); detail.updateDevice(devInLib, devNotInLib);
//更新应查装备数量
detail.setCheckingCount(devInLib.size());
detail = detailRepo.save(detail); detail = detailRepo.save(detail);
CheckDetailVo cdVo = transUtil.CheckDetailDo2Vo(detail); CheckDetailVo cdVo = transUtil.CheckDetailDo2Vo(detail);
...@@ -1825,19 +1840,21 @@ public class DeviceCheckController { ...@@ -1825,19 +1840,21 @@ public class DeviceCheckController {
boolean hasParent = parentTaskId != 0; boolean hasParent = parentTaskId != 0;
//尝试寻找老的市办结任务,如果有的话就删除加END //尝试寻找老的市办结任务,如果有的话就删除加END
//5.需要将上一次市的确认任务给清理掉 //5.需要将上一次市的确认任务给清理掉 统计确认任务关联的是statId 找到billId -> exam Task ->
// 父级的父级,就是省的任务,然后子child里名字包含 统计数据确认任务 的任务给 END 吧 // 父级的父级,就是省的任务,然后子child里名字包含 统计数据确认任务 的任务给 END 吧
Task verifyTask = taskRepo.findAllByParentTaskId(parentTaskId) Map<Integer, List<Task>> doneTaskList = taskRepo.findAllByParentTaskId(parentTaskId)
.stream() .stream()
.filter(task -> task.getTitle().contains("统计数据确认任务")) .filter(task -> task.getTitle().contains("统计数据确认任务"))
.sorted(Comparator.comparing(Task::getId)) .collect(groupingBy(Task::getBillId));
.findFirst()
.orElse(null); List<Task> existsDone = doneTaskList.get(statId);
if (Objects.nonNull(verifyTask)) { if (Objects.nonNull(existsDone)){
log.info("[核查模块] 发现了id = {}市的统计确认任务,将其完结并剔除整个树节点", verifyTask.getId()); for (Task d : existsDone) {
verifyTask.setParentTaskId(0); log.info("[核查模块] 发现了id = {}市的重复的统计确认任务,将其完结并剔除整个树节点", d.getId());
taskService.moveToEnd(verifyTask.parse2Bto()); d.setParentTaskId(0);
taskService.moveToEnd(d.parse2Bto());
}
} }
if (hasParent) { if (hasParent) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论