From 534c699b712c8550ffe394f58e108522d34cf2bc Mon Sep 17 00:00:00 2001
From: 16639036659 <577530412@qq.com>
Date: 星期四, 06 七月 2023 10:01:24 +0800
Subject: [PATCH] 网页端禁止填报排查结果

---
 src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerPlanExecuteController.java |    8 +++++++-
 src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java    |   12 ++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerPlanExecuteController.java b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerPlanExecuteController.java
index 369996b..59f002c 100644
--- a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerPlanExecuteController.java
+++ b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerPlanExecuteController.java
@@ -23,6 +23,7 @@
 import com.ruoyi.project.tr.hiddenTroubleType.service.IHiddenTroubleTypeService;
 import com.ruoyi.project.tr.riskCheckPoint.service.IRiskCheckPointService;
 import com.ruoyi.project.tr.riskEvaluationPlan.service.IRiskEvaluationPlanService;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Transactional;
@@ -371,6 +372,9 @@
 //        hiddenDangerCheckPoint.setCheckStatus(TrHiddenDangerCheckConstants.CHECK_STATUS_ALREADY_CHECK);//排查状态(已排查)
 //        hiddenDangerCheckPoint.setPlanFormulateStatus(TrHiddenDangerCheckConstants.PLAN_FORMULATE_STATUS_ALREADY_COMPLETE);//隐患排查计划制定(已完成)
 //        hiddenDangerCheckPoint.setPlanExecuteStatus(TrHiddenDangerCheckConstants.PLAN_EXECUTE_STATUS_ALREADY_COMPLETE);//隐患排查计划执行(已完成)
+        if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){
+            throw new RuntimeException("手机识别码为空,请使用终端机进行填写");
+        }
 
         int i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint);
         hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
@@ -387,7 +391,9 @@
         //隐患排查检查点实体
         HiddenDangerCheckPoint hiddenDangerCheckPoint = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(Long.valueOf(id));
         mmap.put("hiddenDangerCheckPoint", hiddenDangerCheckPoint);
-
+        if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){
+            throw new RuntimeException("手机识别码为空,请使用终端机进行填写");
+        }
         //隐患类别
         User sysUser = getSysUser();
         HiddenTroubleType hiddenTroubleType = new HiddenTroubleType();
diff --git a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java
index ac1c7bf..6dbc81c 100644
--- a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java
+++ b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java
@@ -30,6 +30,7 @@
 import com.ruoyi.project.tr.riskCheckPoint.service.IRiskCheckPointService;
 import com.ruoyi.project.tr.riskEvaluationPlan.domain.RiskEvaluationPlan;
 import com.ruoyi.project.tr.riskEvaluationPlan.service.IRiskEvaluationPlanService;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -427,7 +428,9 @@
         hiddenDangerCheckPoint.setWhetherDanger(TrHiddenDangerCheckConstants.WHETHER_DANGER_NOT);//是否为隐患(正常)
 //        hiddenDangerCheckPoint.setScheduleCheckStatus(TrHiddenDangerCheckConstants.CHECK_STATUS_ALREADY_CHECK);//排查状态(已排查)(定时任务生成的数据)
 //        hiddenDangerCheckPoint.setCheckTime(DateUtils.getNowDate());//设置排查时间
-
+        if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){
+            throw new RuntimeException("手机识别码为空,请使用终端机进行填写");
+        }
         int i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint);
         hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
 
@@ -444,7 +447,9 @@
         //隐患排查检查点实体
         HiddenDangerCheckPoint hiddenDangerCheckPoint = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(Long.valueOf(id));
         mmap.put("hiddenDangerCheckPoint", hiddenDangerCheckPoint);
-
+        if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){
+            throw new RuntimeException("手机识别码为空,请使用终端机进行填写");
+        }
         //隐患类别
         User sysUser = getSysUser();
         HiddenTroubleType hiddenTroubleType = new HiddenTroubleType();
@@ -492,6 +497,9 @@
             hiddenDangerCheckPoint.setUpdateTime(DateUtils.getNowDate());
             i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint);
         }
+        if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){
+            throw new RuntimeException("手机识别码为空,请使用终端机进行填写");
+        }
         hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
 
         return toAjax(i);

--
Gitblit v1.9.2