From e98eeaaa5766511fdb8e6d5e412eb1c59d1f07ce Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: Tue, 24 Jun 2025 10:24:43 +0800
Subject: [PATCH] 隐患来源功能外加仓吉基础数据定时上报
---
src/main/java/com/ruoyi/project/mobile/service/ApiDangerScheduleService.java | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/mobile/service/ApiDangerScheduleService.java b/src/main/java/com/ruoyi/project/mobile/service/ApiDangerScheduleService.java
index 8bd9bed..9069f25 100644
--- a/src/main/java/com/ruoyi/project/mobile/service/ApiDangerScheduleService.java
+++ b/src/main/java/com/ruoyi/project/mobile/service/ApiDangerScheduleService.java
@@ -20,12 +20,12 @@
import com.ruoyi.project.tr.hiddenDangerCheck.service.IHiddenDangerCheckService;
import com.ruoyi.project.tr.hiddenDangerCheckPoint.domain.HiddenDangerCheckPoint;
import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService;
+import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashMap;
@@ -209,6 +209,12 @@
}
try {
HiddenDangerCheckPoint hdcp = new ObjectMapper().readValue(str, HiddenDangerCheckPoint.class);
+ if (ObjectUtils.isEmpty(hdcp.getCheckPerson())){
+ throw new RuntimeException("检查人不能为空");
+ }
+ if (ObjectUtils.isEmpty(hdcp.getFindTime())){
+ throw new RuntimeException("发现时间不能为空");
+ }
hdcp.setUpdateBy(header.loginName);
hdcp.setUpdateTime(DateUtils.getNowDate());
hdcp.setRegisterCreateTime(DateUtils.getNowDate());//设置隐患登记上报创建时间
@@ -225,6 +231,8 @@
queryExist.setWhetherDanger(TrHiddenDangerCheckConstants.WHETHER_DANGER_YES);//是否为隐患(是隐患)
queryExist.setCheckPointId(hdcp.getCheckPointId());
queryExist.setCheckId(hdcp.getCheckId());
+
+ hdcp.setReportStatus("0");
/**
* 本次查询结果 :如果未上报过隐患,必定为空
@@ -243,10 +251,10 @@
hdcp.setCompanyId(user.getCompanyId());
i = hdcpService.insertHiddenDangerCheckPoint(hdcp);
if (i< 1){
- throw new RuntimeException("添加隐患附属信息失败");
+ throw new RuntimeException("添加隐患信息失败");
}
- //获取Id返回值
+ //获取Id返回值 20250623 放开
hdcp.getId();
int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
if (result< 1){
@@ -261,15 +269,15 @@
hdcp.setUpdateTime(DateUtils.getNowDate());
i = hdcpService.updateHiddenDangerCheckPoint(hdcp);
- // todo-2022 此处修改附属表
-// int result = riskService.updateDangerInfo(hdcp);
-// if (result < 1){
-// throw new RuntimeException("修改失败");
-// }
- int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
- if (result< 1){
- throw new RuntimeException("添加隐患附属信息失败");
+ // todo-2022 此处修改附属表 20250623 放开
+ int result = riskService.updateDangerInfo(hdcp);
+ if (result < 1){
+ throw new RuntimeException("修改失败");
}
+// int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
+// if (result< 1){
+// throw new RuntimeException("添加隐患附属信息失败");
+// }
PreventRiskDangerCheckAndMeasure dangerCheckPointInfo = preventRiskDangerCheckAndMeasureService.getByDangerCheckPointId(hdcp.getId());
riskService.updateCheckLog(dangerCheckPointInfo.getCheckId(), hdcp);
--
Gitblit v1.9.2