From 475a645bf6778711ea007a92f4880e843b07a7bc Mon Sep 17 00:00:00 2001
From: 16639036659 <577530412@qq.com>
Date: 星期一, 31 十月 2022 16:47:28 +0800
Subject: [PATCH] 隐患信息补全
---
src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
index c132bab..ec626b0 100644
--- a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
+++ b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
@@ -5,6 +5,7 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils;
+import com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -19,6 +20,7 @@
import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService;
import com.ruoyi.project.tr.hiddenTroubleType.domain.HiddenTroubleType;
import com.ruoyi.project.tr.hiddenTroubleType.service.IHiddenTroubleTypeService;
+import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
@@ -91,6 +93,7 @@
hiddenDangerCheckPoint.setJudgeQueryByUserIdList(userIdList);//隐患整改人ID 为登陆账号companyId下的userId的
startPage();
List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint);
+
return getDataTable(list);
}
@@ -107,7 +110,22 @@
// 第二:1.隐患上报创建人(register_user_id) 或者 2.(判定人(judge_user_id),report_status 不为null )------为本登录帐号userId的
hiddenDangerCheckPoint.setJudgeQueryByUserId(getSysUser().getUserId());
List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint);
- return getDataTable(list);
+ List<HiddenDangerCheckPoint> resultList = new ArrayList<>();
+
+ for (HiddenDangerCheckPoint dangerCheckPoint : list) {
+ // todo-2022 修改前查询
+ PreventRiskDangerInfo dangerInfo = riskService.getDangerInfoById(dangerCheckPoint.getId());
+ if (ObjectUtils.isNotEmpty(dangerInfo)){
+ dangerCheckPoint.setHazardCode(dangerInfo.getHazardCode());
+ dangerCheckPoint.setDangerSrc(dangerInfo.getDangerSrc());
+ dangerCheckPoint.setDangerReason(dangerInfo.getDangerReason());
+ dangerCheckPoint.setHazardDangerType(dangerInfo.getHazardDangerType());
+ dangerCheckPoint.setDangerResult(dangerInfo.getDangerResult());
+ }
+
+ resultList.add(dangerCheckPoint);
+ }
+ return getDataTable(resultList);
}
/**
@@ -336,6 +354,15 @@
@GetMapping("/editDangerReport/{id}")
public String editDangerReport(@PathVariable("id") Long id, ModelMap mmap) {
HiddenDangerCheckPoint hdcp = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(id);
+ // todo-2022 修改前查询
+ PreventRiskDangerInfo dangerInfo = riskService.getDangerInfoById(hdcp.getId());
+
+ hdcp.setHazardCode(dangerInfo.getHazardCode());
+ hdcp.setDangerSrc(dangerInfo.getDangerSrc());
+ hdcp.setDangerReason(dangerInfo.getDangerReason());
+ hdcp.setHazardDangerType(dangerInfo.getHazardDangerType());
+ hdcp.setDangerResult(dangerInfo.getDangerResult());
+
mmap.put("hiddenDangerCheckPoint", hdcp);
//获取所在公司人员信息
--
Gitblit v1.9.2