From 2b67ed2da39eba5824cfee7950e03be2c1a256ec Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期一, 20 十月 2025 13:17:04 +0800
Subject: [PATCH] 新增数据上传准东

---
 src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckScoreAndDangerLog.java        |   11 +
 src/main/java/com/ruoyi/common/utils/DateUtils.java                                               |    1 
 src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckTaskLog.java                  |   12 +
 src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckScoreAndDangerLogMapper.java |    7 
 src/main/java/com/ruoyi/doublePrevention/controller/RiskOldInfoController.java                    |    2 
 src/main/resources/mybatis/tr/TbSpecialCheckScoreAndDangerLogMapper.xml                           |  260 ++++++++++++++++++++--------
 src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckTaskLogMapper.java           |    5 
 src/main/resources/mybatis/tr/TbSpecialCheckTaskLogMapper.xml                                     |   18 ++
 src/main/java/com/ruoyi/doublePrevention/scheduls/ZhunDongTaskLogSchedule.java                    |  193 +++++++++++++++++++--
 9 files changed, 415 insertions(+), 94 deletions(-)

diff --git a/src/main/java/com/ruoyi/common/utils/DateUtils.java b/src/main/java/com/ruoyi/common/utils/DateUtils.java
index 9fe0d9f..5050f63 100644
--- a/src/main/java/com/ruoyi/common/utils/DateUtils.java
+++ b/src/main/java/com/ruoyi/common/utils/DateUtils.java
@@ -24,6 +24,7 @@
     public static String YYYY_MM_DD = "yyyy-MM-dd";
 
     public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
+    public static String YYYYMMDD = "yyyyMMdd";
 
     public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
 
diff --git a/src/main/java/com/ruoyi/doublePrevention/controller/RiskOldInfoController.java b/src/main/java/com/ruoyi/doublePrevention/controller/RiskOldInfoController.java
index e423de9..1fc0e00 100644
--- a/src/main/java/com/ruoyi/doublePrevention/controller/RiskOldInfoController.java
+++ b/src/main/java/com/ruoyi/doublePrevention/controller/RiskOldInfoController.java
@@ -5,7 +5,7 @@
 import com.ruoyi.doublePrevention.entity.dto.resp.RiskOldInfoQueryRespDTO;
 import com.ruoyi.doublePrevention.enums.ResultCodes;
 import com.ruoyi.doublePrevention.repository.RiskOldInfoRepository;
-import com.ruoyi.doublePrevention.scheduls.ZhunDongSchedule;
+//import com.ruoyi.doublePrevention.scheduls.ZhunDongSchedule;
 import com.ruoyi.doublePrevention.service.baseService.RiskOldInfoService;
 import com.ruoyi.doublePrevention.vo.ResultVO;
 import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/com/ruoyi/doublePrevention/scheduls/ZhunDongTaskLogSchedule.java b/src/main/java/com/ruoyi/doublePrevention/scheduls/ZhunDongTaskLogSchedule.java
index bd15c57..edc6ded 100644
--- a/src/main/java/com/ruoyi/doublePrevention/scheduls/ZhunDongTaskLogSchedule.java
+++ b/src/main/java/com/ruoyi/doublePrevention/scheduls/ZhunDongTaskLogSchedule.java
@@ -5,11 +5,16 @@
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.doublePrevention.entity.ZDReport.HandlerZDReportParam;
+import com.ruoyi.doublePrevention.entity.ZDReport.ZDTaskDangerLogDTO;
 import com.ruoyi.doublePrevention.entity.ZDReport.ZDTaskLogDTO;
+import com.ruoyi.doublePrevention.enums.SyncEnum;
+import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog;
 import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog;
+import com.ruoyi.project.tr.specialCheck.mapper.TbSpecialCheckScoreAndDangerLogMapper;
 import com.ruoyi.project.tr.specialCheck.mapper.TbSpecialCheckTaskLogMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -24,32 +29,47 @@
 import java.util.Date;
 import java.util.List;
 
+import static com.ruoyi.common.utils.Threads.sleep;
+
 @Component
 @Slf4j
 public class ZhunDongTaskLogSchedule {
 
     private static final String TOKEN = "030B6744-EECB-4732-B679-280373E7E575";
     private static final String URL = "http://218.31.50.112:8087";
-    private static final String TOKEN_PRE = "token";
+    //    private static final String TOKEN_PRE = "token";
     @Autowired
     private TbSpecialCheckTaskLogMapper taskSpecialLogMapper;
-    // @Scheduled(cron = "0 0/6 * * * ? ")
+
+    @Autowired
+    private TbSpecialCheckScoreAndDangerLogMapper tbSpecialCheckScoreAndDangerLogMapper;
+
+
+    // @Scheduled(cron = "35 1 0/2 * * ? ")
+    @Scheduled(cron = "0 0/2 * * * ? ")
     public void updateZhunDongTASkLogReportStatus() {
-        //todo 准东基础数据推送
+        // 准东基础数据推送
+
+        log.info("【AA】开始推送准东专项数据..." + DateUtils.dateTimeNow());
+        //专项检查情况记录
+        ZDCheckRecordLogWork();
+        sleep(5000);
+        //专项隐患
+        ZDCheckDangerLogWork();
+
     }
 
 
     @Transactional
-    public void ZDTaskLogWork() {
+    public void ZDCheckRecordLogWork() {
         HttpURLConnection con = null;
         BufferedReader buffer = null;
         int responseCode = 200;
         /**
-         * 1、隐患排查任务基础数据
+         * 1、专项检查情况记录数据
          * */
-        log.info("【Q】隐患排查任务基础数据-处理数据...");
-        //todo 更换查询sql
-        List<TbSpecialCheckTaskLog> taskLogLists = taskSpecialLogMapper.listTestReportTask();
+        log.info("【QQ】专项检查情况记录数据-处理数据...");
+        List<TbSpecialCheckTaskLog> taskLogLists = taskSpecialLogMapper.listZDCheckRecordLog();
 
         if (ObjectUtils.isNotEmpty(taskLogLists)) {
             List<ZDTaskLogDTO> zdTaskLogDTOS = new ArrayList<>();
@@ -59,7 +79,7 @@
                 zdTaskLogDTO.setHazard_code(specialCheckTaskLog.getHazardCode());
                 zdTaskLogDTO.setTask_id(specialCheckTaskLog.getTaskId());
                 zdTaskLogDTO.setCheck_type(specialCheckTaskLog.getCheckType());
-                zdTaskLogDTO.setCheck_date(DateUtils.parseDateToStrLocal(DateUtils.YYYYMMDDHHMMSS, specialCheckTaskLog.getCheckDate()));
+                zdTaskLogDTO.setCheck_date(DateUtils.parseDateToStrLocal(DateUtils.YYYYMMDD, specialCheckTaskLog.getCheckDate()));
                 zdTaskLogDTO.setCreate_date(DateUtils.parseDateToStrLocal(DateUtils.YYYYMMDDHHMMSS, specialCheckTaskLog.getCreateDate()));
                 zdTaskLogDTO.setUpdate_date(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
                 zdTaskLogDTO.setCreate_by(specialCheckTaskLog.getCreateBy());
@@ -68,7 +88,7 @@
                 zdTaskLogDTOS.add(zdTaskLogDTO);
             }
 
-            log.info("【【【Q】隐患排查任务基础数据】】" + JSONObject.toJSONString(zdTaskLogDTOS));
+            log.info("【【【QQ】专项检查情况记录数据】】" + JSONObject.toJSONString(zdTaskLogDTOS));
             //加密数据
 
             StringBuffer eventResultBuffer = null;
@@ -101,7 +121,7 @@
                     while ((line = buffer.readLine()) != null) {
                         eventResultBuffer.append(line);
                     }
-                    log.info("【Q】隐患排查任务基础数据result:" + eventResultBuffer.toString());
+                    log.info("【QQ】专项检查情况记录数据result:" + eventResultBuffer.toString());
 
                     JSONObject jsonObject = JSONObject.parseObject(eventResultBuffer.toString());
                     if (jsonObject.getInteger("status") == 200) {
@@ -109,17 +129,16 @@
                         if (message.contains("失效0条")) {
                             for (TbSpecialCheckTaskLog tbSpecialCheckTaskLog : taskLogLists) {
                                 HandlerZDReportParam handlerZDReportParam = new HandlerZDReportParam();
-                                //todo 更换查询数据
                                 //封装数据
-//                                handlerZDReportParam.setId(CJEvent.getId());
-//                                handlerZDReportParam.setZhunReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
-//                                handlerZDReportParam.setZhunReportTime(new Date());
-//                                CJEventService.updateEventReportStatusHuaiDong(handlerZDReportParam);
+                                handlerZDReportParam.setId(tbSpecialCheckTaskLog.getId());
+                                handlerZDReportParam.setZhunReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
+                                handlerZDReportParam.setZhunReportTime(new Date());
+                                taskSpecialLogMapper.updateEventReportStatusZhunDong(handlerZDReportParam);
                             }
                         }
 
                     } else {
-                        log.info("【Q】隐患排查任务基础数据推送数据失败..." + eventResultBuffer);
+                        log.info("【QQ】专项检查情况记录数据推送数据失败..." + eventResultBuffer);
                     }
 
                 }
@@ -127,9 +146,143 @@
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            log.info("【Q】隐患排查任务基础数据推送数据结束...");
-        }else {
-            log.info("【Q】隐患排查任务基础数据无可推数据");
+            log.info("【QQ】专项检查情况记录数据推送数据结束...");
+        } else {
+            log.info("【QQ】专项检查情况记录数据无可推数据");
         }
     }
+
+
+    @Transactional
+    public void ZDCheckDangerLogWork() {
+        HttpURLConnection con = null;
+        BufferedReader buffer = null;
+        int responseCode = 200;
+        /**
+         * 1、专项检查隐患信息
+         * */
+        log.info("【PP】专项检查隐患信息数据-处理数据...");
+        List<TbSpecialCheckScoreAndDangerLog> dangerLogs = tbSpecialCheckScoreAndDangerLogMapper.listCheckDangerList();
+
+        if (ObjectUtils.isNotEmpty(dangerLogs)) {
+            List<ZDTaskDangerLogDTO> zdTaskDangerLogDTOS = new ArrayList<>();
+            for (TbSpecialCheckScoreAndDangerLog dangerLog : dangerLogs) {
+                ZDTaskDangerLogDTO taskDangerLogDTO = new ZDTaskDangerLogDTO();
+                taskDangerLogDTO.setId(dangerLog.getId());
+                taskDangerLogDTO.setDanger_id(dangerLog.getDangerId());
+                taskDangerLogDTO.setTask_id(dangerLog.getTaskId());
+                taskDangerLogDTO.setCheck_type(dangerLog.getCheckType());
+                taskDangerLogDTO.setCheck_date(DateUtils.parseDateToStrLocal(DateUtils.YYYYMMDD, dangerLog.getCheckDate()));
+                taskDangerLogDTO.setCheck_pay(dangerLog.getCheckPay());
+                taskDangerLogDTO.setCheck_item_id(dangerLog.getCheckItemId());
+                taskDangerLogDTO.setCheck_score_id(dangerLog.getCheckScoreId());
+                taskDangerLogDTO.setHarm_type(dangerLog.getHarmType());
+                taskDangerLogDTO.setCreate_date(DateUtils.parseDateToStrLocal(DateUtils.YYYYMMDDHHMMSS, dangerLog.getCreateDate()));
+                taskDangerLogDTO.setUpdate_date(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
+                taskDangerLogDTO.setCreate_by(dangerLog.getCreateBy());
+                taskDangerLogDTO.setUpdate_by(dangerLog.getUpdateBy());
+                taskDangerLogDTO.setDeleted(dangerLog.getDeleted().toString());
+
+                zdTaskDangerLogDTOS.add(taskDangerLogDTO);
+            }
+
+            log.info("【【【PP】专项检查隐患信息数据】】" + JSONObject.toJSONString(zdTaskDangerLogDTOS));
+            //加密数据
+
+            StringBuffer eventResultBuffer = null;
+            //上报数据
+            try {
+                URL url = new URL(URL + "/api/wwyt/tb_base_check_danger_List");
+                //得到连接对象
+                con = (HttpURLConnection) url.openConnection();
+                // 设置请求方式和参数
+                con.setRequestMethod("POST");
+                con.setDoOutput(true);
+                con.setDoInput(true);
+                con.setUseCaches(false);
+                con.setRequestProperty("token", TOKEN);
+                con.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+                // 发送请求体
+                try (OutputStream os = con.getOutputStream()) {
+                    os.write(JSON.toJSONString(zdTaskDangerLogDTOS).getBytes(StandardCharsets.UTF_8));
+                }
+                //得到响应码
+                responseCode = con.getResponseCode();
+                //确认响应流不为空
+                if (responseCode == HttpURLConnection.HTTP_OK) {
+                    //得到响应流
+                    InputStream inputStream = con.getInputStream();
+                    //将响应流转换成字符串
+                    eventResultBuffer = new StringBuffer();
+                    String line;
+                    buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
+                    while ((line = buffer.readLine()) != null) {
+                        eventResultBuffer.append(line);
+                    }
+                    log.info("【PP】专项检查隐患信息数据result:" + eventResultBuffer.toString());
+
+                    JSONObject jsonObject = JSONObject.parseObject(eventResultBuffer.toString());
+                    if (jsonObject.getInteger("status") == 200) {
+                        String message = jsonObject.getString("message");
+                        if (message.contains("失效0条")) {
+                            for (TbSpecialCheckScoreAndDangerLog scoreAndDangerLog : dangerLogs) {
+                                HandlerZDReportParam handlerZDReportParam = new HandlerZDReportParam();
+                                //封装数据
+                                handlerZDReportParam.setId(scoreAndDangerLog.getId());
+                                handlerZDReportParam.setZhunReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
+                                handlerZDReportParam.setZhunReportTime(new Date());
+                                tbSpecialCheckScoreAndDangerLogMapper.updateEventReportStatusZhunDong(handlerZDReportParam);
+                            }
+                        }
+
+                    } else if (jsonObject.getInteger("status") == 500) {
+                        String message = jsonObject.getString("message");
+                        if (message.contains("不存在danger_id为")) {
+                            String s = extractDangerId(message);
+                            if (ObjectUtils.isNotEmpty(s)) {
+                                HandlerZDReportParam handlerZDReportParam = new HandlerZDReportParam();
+                                //封装数据
+                                handlerZDReportParam.setId(s);
+                                handlerZDReportParam.setZhunReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
+                                handlerZDReportParam.setZhunReportTime(new Date());
+                                tbSpecialCheckScoreAndDangerLogMapper.updateEventReportStatusZhunDongSp(handlerZDReportParam);
+                            }
+                        }
+
+
+                        log.info("【PP】专项检查隐患信息数据推送数据失败..." + eventResultBuffer);
+                    } else {
+                        log.info("【PP】专项检查隐患信息数据推送数据失败..." + eventResultBuffer);
+                    }
+
+                }
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            log.info("【PP】专项检查隐患信息数据推送数据结束...");
+        } else {
+            log.info("【PP】专项检查隐患信息数据无可推数据");
+        }
+    }
+
+
+    public static String extractDangerId(String message) {
+        // 方法1: 使用substring方式提取
+        String prefix = "不存在danger_id为";
+        String suffix = "的隐患";
+
+        if (message.contains(prefix) && message.contains(suffix)) {
+            int startIndex = message.indexOf(prefix) + prefix.length();
+            int endIndex = message.indexOf(suffix);
+            return message.substring(startIndex, endIndex);
+        }
+        return null;
+//        int start = message.indexOf("不存在danger_id为") + "不存在danger_id为".length();
+//        int end = message.indexOf("的隐患");
+//        if (end > start) {
+//            return message.substring(start, end);
+//        }
+//        return null;
+    }
 }
diff --git a/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckScoreAndDangerLog.java b/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckScoreAndDangerLog.java
index e9e9877..e17a123 100644
--- a/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckScoreAndDangerLog.java
+++ b/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckScoreAndDangerLog.java
@@ -7,6 +7,7 @@
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 
 @Data
 @TableName("tb_special_check_score_and_danger_log")
@@ -65,4 +66,14 @@
     private LocalDateTime reportTime;
 
     private Byte reportStatus;
+
+    /**
+     * 上报时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date zhunReportTime;
+    /**
+     * 上报状态 1-待上报;2-已上报;3-不上报
+     */
+    private Byte zhunReportStatus;
 }
diff --git a/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckTaskLog.java b/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckTaskLog.java
index 0e83913..2273631 100644
--- a/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckTaskLog.java
+++ b/src/main/java/com/ruoyi/project/tr/specialCheck/domin/TbSpecialCheckTaskLog.java
@@ -7,6 +7,7 @@
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 
 @Data
 @TableName("tb_special_check_task_log")
@@ -49,4 +50,15 @@
     private LocalDateTime reportTime;
 
     private Byte reportStatus;
+
+    /**
+     * 上报时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date zhunReportTime;
+    /**
+     * 上报状态 1-待上报;2-已上报;3-不上报
+     */
+    private Byte zhunReportStatus;
+
 }
diff --git a/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckScoreAndDangerLogMapper.java b/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckScoreAndDangerLogMapper.java
index 968f1d5..ef49992 100644
--- a/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckScoreAndDangerLogMapper.java
+++ b/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckScoreAndDangerLogMapper.java
@@ -1,5 +1,6 @@
 package com.ruoyi.project.tr.specialCheck.mapper;
 
+import com.ruoyi.doublePrevention.entity.ZDReport.HandlerZDReportParam;
 import com.ruoyi.project.tr.specialCheck.domin.BO.HandlerSpecialCheckReportParam;
 import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckItemDangerLogBO;
 import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckItemDangerLogUpdateBO;
@@ -30,4 +31,10 @@
     TbSpecialCheckScoreAndDangerLog getSpecialCheckScoreAndDangerLogById(String id);
 
     List<TbSpecialCheckScoreAndDangerLog> listScoreAndDangerLogReportList();
+
+    List<TbSpecialCheckScoreAndDangerLog> listCheckDangerList();
+
+    int updateEventReportStatusZhunDong(HandlerZDReportParam handlerZDReportParam);
+
+    int updateEventReportStatusZhunDongSp(HandlerZDReportParam handlerZDReportParam);
 }
diff --git a/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckTaskLogMapper.java b/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckTaskLogMapper.java
index 9618a35..0e9b103 100644
--- a/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckTaskLogMapper.java
+++ b/src/main/java/com/ruoyi/project/tr/specialCheck/mapper/TbSpecialCheckTaskLogMapper.java
@@ -1,6 +1,7 @@
 package com.ruoyi.project.tr.specialCheck.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.doublePrevention.entity.ZDReport.HandlerZDReportParam;
 import com.ruoyi.doublePrevention.repository.param.HandlerCJReportParam;
 import com.ruoyi.doublePrevention.vo.ResultVO;
 import com.ruoyi.project.tr.specialCheck.domin.BO.HandlerSpecialCheckReportParam;
@@ -19,6 +20,10 @@
 
     int save(TbSpecialCheckTaskLog tbSpecialCheckTaskLog);
 
+    int updateEventReportStatusZhunDong(HandlerZDReportParam handlerZDReportParam);
+
+    List<TbSpecialCheckTaskLog> listZDCheckRecordLog();
+
     TbSpecialCheckTaskLog getSpecialCheckTaskLogByIndexId(Long indexId);
 
     int updateSpecialCheckTaskLogById(TbSpecialCheckTaskLogUpdateBO updateBO);
diff --git a/src/main/resources/mybatis/tr/TbSpecialCheckScoreAndDangerLogMapper.xml b/src/main/resources/mybatis/tr/TbSpecialCheckScoreAndDangerLogMapper.xml
index 5f71865..6158cc5 100644
--- a/src/main/resources/mybatis/tr/TbSpecialCheckScoreAndDangerLogMapper.xml
+++ b/src/main/resources/mybatis/tr/TbSpecialCheckScoreAndDangerLogMapper.xml
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.tr.specialCheck.mapper.TbSpecialCheckScoreAndDangerLogMapper">
-
     <resultMap id="BaseResultMap" type="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog">
         <id property="indexId" column="index_id"/>
         <result property="id" column="id"/>
@@ -32,7 +31,7 @@
     </resultMap>
 
 
-<!--    List<TbSpecialCheckItemDangerLog> selectSpecialCheckScoreAndDangerLogPage(TbSpecialCheckItemDangerLogBO itemDangerLogBO);-->
+    <!--    List<TbSpecialCheckItemDangerLog> selectSpecialCheckScoreAndDangerLogPage(TbSpecialCheckItemDangerLogBO itemDangerLogBO);-->
     <select id="selectSpecialCheckScoreAndDangerLogPage" resultMap="BaseResultMap">
         select * from tb_special_check_score_and_danger_log
         <where>
@@ -44,78 +43,161 @@
                 and check_type like concat('%',#{checkType},'%')
             </if>
             <if test="reportStatus != null">
-            and report_status = #{reportStatus}
+                and report_status = #{reportStatus}
             </if>
-            order by  create_date desc
+            order by create_date desc
         </where>
     </select>
-<!--    TbSpecialCheckItemDangerLog getSpecialCheckScoreAndDangerLogByIndexId(Long indexId);;-->
+    <!--    TbSpecialCheckItemDangerLog getSpecialCheckScoreAndDangerLogByIndexId(Long indexId);;-->
     <select id="getSpecialCheckScoreAndDangerLogByIndexId" resultMap="BaseResultMap">
-        select * from tb_special_check_score_and_danger_log
-        where deleted = 0 and index_id = #{indexId}
+        select *
+        from tb_special_check_score_and_danger_log
+        where deleted = 0
+          and index_id = #{indexId}
     </select>
 
-<!--    TbSpecialCheckTaskLog save(TbSpecialCheckTaskLog tbSpecialCheckTaskLog);-->
+    <!--    TbSpecialCheckTaskLog save(TbSpecialCheckTaskLog tbSpecialCheckTaskLog);-->
     <insert id="save" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog">
         insert into tb_special_check_score_and_danger_log
-<!--        (index_id,company_code)values(null,#{companyCode},#{hazardCode})-->
+        <!--        (index_id,company_code)values(null,#{companyCode},#{hazardCode})-->
         <trim prefix="(" suffix=")" suffixOverrides=",">
             index_id,
-            <if test="id != null ">id,</if>
-            <if test="companyCode != null ">company_code,</if>
+            <if test="id != null ">
+                id,
+            </if>
+            <if test="companyCode != null ">
+                company_code,
+            </if>
 
-            <if test="dangerId != null ">danger_id,</if>
-            <if test="dangerName != null ">danger_name,</if>
-            <if test="taskId != null ">task_id,</if>
-            <if test="checkType != null ">check_type,</if>
-            <if test="checkItemId != null ">check_item_id,</if>
-            <if test="checkScoreId != null ">check_score_id,</if>
-            <if test="checkDate != null ">check_date,</if>
+            <if test="dangerId != null ">
+                danger_id,
+            </if>
+            <if test="dangerName != null ">
+                danger_name,
+            </if>
+            <if test="taskId != null ">
+                task_id,
+            </if>
+            <if test="checkType != null ">
+                check_type,
+            </if>
+            <if test="checkItemId != null ">
+                check_item_id,
+            </if>
+            <if test="checkScoreId != null ">
+                check_score_id,
+            </if>
+            <if test="checkDate != null ">
+                check_date,
+            </if>
 
-            <if test="checkPay != null ">check_pay,</if>
-            <if test="harmType != null ">harm_type,</if>
-            <if test="isReject != null ">is_reject,</if>
-            <if test="deductPoint != null ">deduct_point,</if>
-            <if test="deductIllustrate != null ">deduct_illustrate,</if>
+            <if test="checkPay != null ">
+                check_pay,
+            </if>
+            <if test="harmType != null ">
+                harm_type,
+            </if>
+            <if test="isReject != null ">
+                is_reject,
+            </if>
+            <if test="deductPoint != null ">
+                deduct_point,
+            </if>
+            <if test="deductIllustrate != null ">
+                deduct_illustrate,
+            </if>
 
-            <if test="deleted != null">deleted,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createDate != null">create_date,</if>
-            <if test="updateBy != null ">update_by,</if>
-            <if test="updateDate != null ">update_date,</if>
+            <if test="deleted != null">
+                deleted,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createDate != null">
+                create_date,
+            </if>
+            <if test="updateBy != null ">
+                update_by,
+            </if>
+            <if test="updateDate != null ">
+                update_date,
+            </if>
             report_time,
-            <if test="reportStatus != null ">report_status,</if>
+            <if test="reportStatus != null ">
+                report_status,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             null,
-            <if test="id != null ">#{id},</if>
-            <if test="companyCode != null ">#{companyCode},</if>
+            <if test="id != null ">
+                #{id},
+            </if>
+            <if test="companyCode != null ">
+                #{companyCode},
+            </if>
 
-            <if test="dangerId != null ">#{dangerId},</if>
-            <if test="dangerName != null ">#{dangerName},</if>
-            <if test="taskId != null ">#{taskId},</if>
-            <if test="checkType != null ">#{checkType},</if>
-            <if test="checkItemId != null ">#{checkItemId},</if>
-            <if test="checkScoreId != null ">#{checkScoreId},</if>
-            <if test="checkDate != null">#{checkDate},</if>
-            <if test="checkPay != null ">#{checkPay},</if>
-            <if test="harmType != null ">#{harmType},</if>
-            <if test="isReject != null ">#{isReject},</if>
-            <if test="deductPoint != null ">#{deductPoint},</if>
-            <if test="deductIllustrate != null ">#{deductIllustrate},</if>
+            <if test="dangerId != null ">
+                #{dangerId},
+            </if>
+            <if test="dangerName != null ">
+                #{dangerName},
+            </if>
+            <if test="taskId != null ">
+                #{taskId},
+            </if>
+            <if test="checkType != null ">
+                #{checkType},
+            </if>
+            <if test="checkItemId != null ">
+                #{checkItemId},
+            </if>
+            <if test="checkScoreId != null ">
+                #{checkScoreId},
+            </if>
+            <if test="checkDate != null">
+                #{checkDate},
+            </if>
+            <if test="checkPay != null ">
+                #{checkPay},
+            </if>
+            <if test="harmType != null ">
+                #{harmType},
+            </if>
+            <if test="isReject != null ">
+                #{isReject},
+            </if>
+            <if test="deductPoint != null ">
+                #{deductPoint},
+            </if>
+            <if test="deductIllustrate != null ">
+                #{deductIllustrate},
+            </if>
 
-            <if test="deleted != null ">#{deleted},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createDate != null">#{createDate},</if>
-            <if test="updateBy != null ">#{updateBy},</if>
-            <if test="updateDate != null ">#{updateDate},</if>
+            <if test="deleted != null ">
+                #{deleted},
+            </if>
+            <if test="createBy != null">
+                #{createBy},
+            </if>
+            <if test="createDate != null">
+                #{createDate},
+            </if>
+            <if test="updateBy != null ">
+                #{updateBy},
+            </if>
+            <if test="updateDate != null ">
+                #{updateDate},
+            </if>
             null,
-            <if test="reportStatus != null ">#{reportStatus},</if>
+            <if test="reportStatus != null ">
+                #{reportStatus},
+            </if>
         </trim>
     </insert>
 
-<!-- int updateSpecialCheckScoreAndDangerLogById(TbSpecialCheckScoreAndDangerLog scoreAndDangerLog);-->
-    <update id="updateSpecialCheckScoreAndDangerLogById" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog">
+    <!-- int updateSpecialCheckScoreAndDangerLogById(TbSpecialCheckScoreAndDangerLog scoreAndDangerLog);-->
+    <update id="updateSpecialCheckScoreAndDangerLogById"
+            parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog">
         update tb_special_check_score_and_danger_log
         <set>
             <if test="dangerId != null ">
@@ -158,7 +240,7 @@
                 report_status = #{reportStatus},
             </if>
             <if test="updateBy != null">
-                update_by  = #{updateBy},
+                update_by = #{updateBy},
             </if>
             <if test="updateDate != null">
                 update_date = #{updateDate},
@@ -167,8 +249,9 @@
         where index_id = #{indexId} and deleted = 0
     </update>
 
-<!--    int deleteTbSpecialCheckScoreAndDangerLog(TbSpecialCheckItemDangerLog tbSpecialCheckItemDangerLog);-->
-    <update id="deleteTbSpecialCheckScoreAndDangerLog" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog">
+    <!--    int deleteTbSpecialCheckScoreAndDangerLog(TbSpecialCheckItemDangerLog tbSpecialCheckItemDangerLog);-->
+    <update id="deleteTbSpecialCheckScoreAndDangerLog"
+            parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog">
         update tb_special_check_score_and_danger_log
         <set>
             <if test="deleted != null ">
@@ -178,35 +261,66 @@
                 report_status = #{reportStatus},
             </if>
             <if test="updateBy != null">
-                update_by  = #{updateBy},
+                update_by = #{updateBy},
             </if>
             <if test="updateDate != null">
                 update_date = #{updateDate},
             </if>
         </set>
-        where index_id = #{indexId}  and deleted = 0
+        where index_id = #{indexId} and deleted = 0
     </update>
-<!--    List<TbSpecialCheckItemDangerLog> listItemDangerReportTask();-->
+    <!--    List<TbSpecialCheckItemDangerLog> listItemDangerReportTask();-->
     <select id="listItemDangerReportTask" resultMap="BaseResultMap">
-        select * from tb_special_check_score_and_danger_log
-        where deleted = 0 and report_status = 1
+        select *
+        from tb_special_check_score_and_danger_log
+        where deleted = 0
+          and report_status = 1
     </select>
-<!--    void updateItemDangerReportStatusById(HandlerSpecialCheckReportParam handlerCJReportParam);-->
-    <update id="updateItemDangerReportStatusById" >
-        update tb_special_check_score_and_danger_log set
-            report_status =  #{reportStatus},
-            report_time = #{reportTime}
-        where id = #{id}  and deleted = 0
+    <!--    void updateItemDangerReportStatusById(HandlerSpecialCheckReportParam handlerCJReportParam);-->
+    <update id="updateItemDangerReportStatusById">
+        update tb_special_check_score_and_danger_log
+        set report_status = #{reportStatus},
+            report_time   = #{reportTime}
+        where id = #{id}
+          and deleted = 0
     </update>
-<!--    TbSpecialCheckItemDangerLog getSpecialCheckScoreAndDangerLogById(String id);-->
+    <!--    TbSpecialCheckItemDangerLog getSpecialCheckScoreAndDangerLogById(String id);-->
     <select id="getSpecialCheckScoreAndDangerLogById" resultMap="BaseResultMap">
-        select * from tb_special_check_score_and_danger_log
-        where deleted = 0 and id = #{id}
+        select *
+        from tb_special_check_score_and_danger_log
+        where deleted = 0
+          and id = #{id}
     </select>
-<!--    List<TbSpecialCheckScoreAndDangerLog> listScoreAndDangerLogReportList();-->
+    <!--    List<TbSpecialCheckScoreAndDangerLog> listScoreAndDangerLogReportList();-->
     <select id="listScoreAndDangerLogReportList" resultMap="BaseResultMap">
-        select * from tb_special_check_score_and_danger_log
-        where deleted = 0 and report_status = 1
+        select *
+        from tb_special_check_score_and_danger_log
+        where deleted = 0
+          and report_status = 1
     </select>
 
+
+    <update id="updateEventReportStatusZhunDong">
+        update tb_special_check_score_and_danger_log
+        set zhun_report_status = #{zhunReportStatus},
+            zhun_report_time   = #{zhunReportTime}
+        where id = #{id}
+    </update>
+
+    <update id="updateEventReportStatusZhunDongSp">
+        update tb_special_check_score_and_danger_log
+        set zhun_report_status = 8,
+            zhun_report_time   = #{zhunReportTime}
+        where danger_id = #{id}
+    </update>
+
+
+    <select id="listCheckDangerList" resultMap="BaseResultMap">
+        SELECT a.*
+        FROM tb_special_check_score_and_danger_log a
+                 INNER JOIN prevent_cj_report_danger_info b
+                            on a.danger_id = b.id and b.deleted = 0 and b.zhun_report_status = 2
+        where a.deleted = 0 and a.report_status = 1
+        limit 20
+    </select>
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/mybatis/tr/TbSpecialCheckTaskLogMapper.xml b/src/main/resources/mybatis/tr/TbSpecialCheckTaskLogMapper.xml
index 75ea3b6..f6efa44 100644
--- a/src/main/resources/mybatis/tr/TbSpecialCheckTaskLogMapper.xml
+++ b/src/main/resources/mybatis/tr/TbSpecialCheckTaskLogMapper.xml
@@ -22,6 +22,8 @@
         <result property="updateDate" column="update_date"/>
         <result property="reportTime" column="report_time"/>
         <result property="reportStatus" column="report_status"/>
+<!--        <result property="zhunReportTime" column="zhun_report_time"/>-->
+<!--        <result property="zhunReportStatus" column="zhun_report_status"/>-->
     </resultMap>
 
 
@@ -39,6 +41,9 @@
             <if test="reportStatus != null">
             and report_status = #{reportStatus}
             </if>
+<!--            <if test="zhunReportStatus != null">-->
+<!--            and zhun_report_status = #{zhunReportStatus}-->
+<!--            </if>-->
             order by  create_date desc
         </where>
     </select>
@@ -150,6 +155,12 @@
         where deleted = 0 and report_status = 1
     </select>
 
+
+    <select id="listZDCheckRecordLog" resultMap="BaseResultMap">
+        select * from tb_special_check_task_log
+        where deleted = 0 and zhun_report_status = 1 limit 20
+    </select>
+
     <select id="listTestReportTaskTest" resultMap="BaseResultMap">
         select * from tb_special_check_task_log
         where deleted = 0  and create_date &gt;= '2024-01-01 00:00:00' and create_date &lt;= '2024-06-16 23:59:59'
@@ -163,4 +174,11 @@
             report_time = #{reportTime}
         where id = #{id}  and deleted = 0
     </update>
+
+    <update id="updateEventReportStatusZhunDong">
+        update tb_special_check_task_log set
+           zhun_report_status =  #{zhunReportStatus},
+           zhun_report_time = #{zhunReportTime}
+        where id = #{id}
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.2