提交 a32613da authored 作者: tykj's avatar tykj

fix(核查):修正省退回区核查任务检查结果、检查人、退回次数问题&&修正终止核查省直属单位不显示的问题

上级 dc5cbe8f
...@@ -1028,15 +1028,42 @@ public class DeviceCheckController { ...@@ -1028,15 +1028,42 @@ public class DeviceCheckController {
log.info("[核查模块] 市专管员审核未通过,回滚该任务到初始状态,任务id = {}", currentTask.getId()); log.info("[核查模块] 市专管员审核未通过,回滚该任务到初始状态,任务id = {}", currentTask.getId());
// 重置Task任务本身的任务状态,使其回滚到等待专管员A处理时的状态,并在Task里添加特殊的回滚标记,用来鉴别这是一个回滚任务 // 重置Task任务本身的任务状态,使其回滚到等待专管员A处理时的状态,并在Task里添加特殊的回滚标记,用来鉴别这是一个回滚任务
StatusEnum firstStatus = getFirstStatus(currentTask.getBillStatus(), Integer.valueOf(currentDetail.getVar2())); StatusEnum firstStatus = getFirstStatus(currentTask.getBillStatus(), Integer.valueOf(currentDetail.getVar2()));
currentTask.setRemark("ROLLBACK-0");
String remark = currentTask.getRemark();
if (Objects.nonNull(remark) && remark.contains("ROLLBACK")) {
remark = remark;
} else {
remark = "ROLLBACK-0";
}
currentTask.setRemark(remark);
taskService.moveToSpecial(currentTask, firstStatus, 0); taskService.moveToSpecial(currentTask, firstStatus, 0);
//重置该自查详情里的各个装备的自查详情
// 重置该自查详情里的各个装备的自查详情
currentDetail = setDetailCheckNumber(currentDetail, 119); currentDetail = setDetailCheckNumber(currentDetail, 119);
currentDetail.setCheckFiles(""); currentDetail.setCheckFiles("");
currentDetail.setCheckFileList(Lists.newArrayList()); currentDetail.setCheckFileList(Lists.newArrayList());
Integer userId = authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId(); Integer userId = authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId();
currentDetail.setUserCId(0); currentDetail.setUserCId(0);
currentDetail = detailRepo.save(currentDetail); currentDetail = detailRepo.save(currentDetail);
// DeviceCheckDetail oldDeatil = detailRepo.findById(currentTask.getId()).get();
// // 更正撤销前负责人、校对结果、实查数量不显示问题
// oldDeatil.setUserAId(currentDetail.getUserAId());
// oldDeatil.setUserBId(currentDetail.getUserBId());
// oldDeatil.setCheckResult(currentDetail.getCheckResult());
// oldDeatil.setCheckedCount(currentDetail.getCheckedCount());
// detailRepo.save(oldDeatil);
//
// // 更正撤销前负责人、校对结果、实查数量显示出错问题
// currentDetail.setUserAId(null);
// currentDetail.setUserBId(null);
// currentDetail.setCheckResult("");
// currentDetail.setCheckedCount(0);
// currentDetail = detailRepo.save(currentDetail);
//该detail对应的stat数据里相应的数据剔除(写一个通用的剔除方法), 否则在第二次审核通过的时候会重复计算一次数据 //该detail对应的stat数据里相应的数据剔除(写一个通用的剔除方法), 否则在第二次审核通过的时候会重复计算一次数据
TaskBto fatherTask = taskService.get(currentTask.getParentTaskId()); TaskBto fatherTask = taskService.get(currentTask.getParentTaskId());
DeviceCheckStat dcs = statRepo.findById(fatherTask.getBillId()).get(); DeviceCheckStat dcs = statRepo.findById(fatherTask.getBillId()).get();
...@@ -1096,13 +1123,15 @@ public class DeviceCheckController { ...@@ -1096,13 +1123,15 @@ public class DeviceCheckController {
List<Task> detailTaskList = taskRepo.findAllByParentTaskId(c1.getId()); List<Task> detailTaskList = taskRepo.findAllByParentTaskId(c1.getId());
if (!detailTaskList.isEmpty()) { if (!detailTaskList.isEmpty()) {
List<String> notEndUnitNames = detailTaskList List<String> notEndUnitNames = detailTaskList
.stream().filter(task -> !task.getBillStatus().equals(END.id) && !task.getBillStatus().equals(CHECK_SHUT_DOWN.id)) .stream()
.map(task -> unitsRepo.findById(task.getOwnUnit()).get().getName()) .filter(task -> !task.getBillStatus().equals(END.id) && !task.getBillStatus().equals(CHECK_SHUT_DOWN.id))
.map(task -> unitsRepo.findById(detailRepo.findById(task.getBillId()).get().getCheckUnitId()).get().getName())
.collect(toList()); .collect(toList());
unitNames.addAll(notEndUnitNames); unitNames.addAll(notEndUnitNames);
} }
} else if (predNodeType(c1).equals(CcNodeType.MANUAL) && !c1.getBillStatus().equals(END.id) && !c1.getBillStatus().equals(CHECK_SHUT_DOWN.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 = unitsRepo.findById(detailRepo.findById(c1.getBillId()).get().getCheckUnitId()).get().getName();
// String unitName = unitsRepo.findById(c1.getOwnUnit()).get().getName(); // String unitName = unitsRepo.findById(c1.getOwnUnit()).get().getName();
unitNames.add(checkUnit); unitNames.add(checkUnit);
} }
...@@ -1657,7 +1686,7 @@ public class DeviceCheckController { ...@@ -1657,7 +1686,7 @@ public class DeviceCheckController {
String updateDetail = changeHunds(detailString, 3); String updateDetail = changeHunds(detailString, 3);
detailRepo.updateCheckDetail(id, updateDetail, "", 0, 0, 0); detailRepo.updateCheckDetail(id, updateDetail);
//2. 当前任务结束,开启一个新的 退回任务(连带一个新的detail) //2. 当前任务结束,开启一个新的 退回任务(连带一个新的detail)
TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id); TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id);
...@@ -1687,6 +1716,12 @@ public class DeviceCheckController { ...@@ -1687,6 +1716,12 @@ public class DeviceCheckController {
cDetail.setCheckFiles(""); cDetail.setCheckFiles("");
cDetail.setCheckFileList(Lists.newArrayList()); cDetail.setCheckFileList(Lists.newArrayList());
cDetail.setReview(false); cDetail.setReview(false);
cDetail.setUserAId(0);
cDetail.setUserAId(0);
cDetail.setUserCId(0);
cDetail.setCheckEName("");
cDetail.setCheckResult("");
cDetail.setCheckedCount(0);
cDetail = detailRepo.save(cDetail); cDetail = detailRepo.save(cDetail);
// 创建新的任务(被拒绝的自查单位如果是区则是140状态,否则是160状态 ) // 创建新的任务(被拒绝的自查单位如果是区则是140状态,否则是160状态 )
String unitName = unitsRepo.findById(cDetail.getCheckUnitId()).get().getName(); String unitName = unitsRepo.findById(cDetail.getCheckUnitId()).get().getName();
......
...@@ -24,6 +24,16 @@ public interface DeviceCheckDetailDao extends JpaRepository<DeviceCheckDetail, I ...@@ -24,6 +24,16 @@ public interface DeviceCheckDetailDao extends JpaRepository<DeviceCheckDetail, I
@Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6 where o.id=?1") @Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6 where o.id=?1")
void updateCheckDetail(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount); void updateCheckDetail(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount);
/**
* 根据id更新checkDetail
*
* @param id detail id
* @param checkDetail 要更新的检查结果
*/
@Modifying
@Query("update DeviceCheckDetail o set o.checkDetail=?2 where o.id=?1")
void updateCheckDetail(Integer id, String checkDetail);
@Modifying @Modifying
@Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6,o.terminalInfo=?7 where o.id=?1") @Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6,o.terminalInfo=?7 where o.id=?1")
void updateCheckDetailWithT(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount, String terminalInfo); void updateCheckDetailWithT(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount, String terminalInfo);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论