From 7be0d5b901b999d2347774df3cc1a64927838bb3 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期二, 15 四月 2025 10:10:35 +0800
Subject: [PATCH] 优化每年专项数据获取

---
 src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java b/src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java
index 131995e..58c4742 100644
--- a/src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java
+++ b/src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java
@@ -1,5 +1,6 @@
 package com.ruoyi.project.tr.specialCheck.controller;
 
+import com.ruoyi.common.constant.DualControlConstants;
 import com.ruoyi.common.utils.BeanCopyUtils;
 import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure;
 import com.ruoyi.doublePrevention.entity.dto.req.PreventRiskControlMeasureDeleteReqDTO;
@@ -9,12 +10,13 @@
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.dc.accidentInformation.domain.AccidentInformation;
+import com.ruoyi.project.enumerate.DcAttachmentTypeEnum;
+import com.ruoyi.project.system.attachment.domain.Attachment;
 import com.ruoyi.project.tr.report.domain.Danger;
 import com.ruoyi.project.tr.riskList.domain.RiskList;
 import com.ruoyi.project.tr.riskList.service.IRiskListService;
-import com.ruoyi.project.tr.specialCheck.domin.BO.TbBaseCheckTaskBO;
-import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckTaskLogBO;
-import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckTaskLogUpdateBO;
+import com.ruoyi.project.tr.specialCheck.domin.BO.*;
 import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckTaskLogDTO;
 import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckTaskLogDateDTO;
 import com.ruoyi.project.tr.specialCheck.domin.TbBaseCheckTask;
@@ -87,6 +89,8 @@
     {
         List<RiskList> riskList = riskListService.listHazardSource();
         mmap.put("hazardList", riskList);
+        List<TbBaseCheckTask> listResult = tbBaseCheckService.listTbBaseCheckTask();
+        mmap.put("tbBaseCheckTask", listResult);
         return prefix + "/add";
     }
 
@@ -96,9 +100,9 @@
      */
     @PostMapping("/add")
     @ResponseBody
-    public AjaxResult addSpecialTask(TbSpecialCheckTaskLog tbSpecialCheckTaskLog){
+    public AjaxResult addSpecialTask(TbSpecialCheckTaskLogEditBO taskLogEditBO){
 
-        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.addSpecialTask(tbSpecialCheckTaskLog);
+        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.addSpecialTask(taskLogEditBO);
         String code = resultVO.getCode();
         if ("200".equals(code)){
             return toAjax(1);
@@ -124,13 +128,32 @@
     }
 
     /**
+     *
+     */
+    @GetMapping("/detail/{indexId}")
+    public String detail(@PathVariable("indexId") Long indexId, ModelMap mmap)
+    {
+        TbSpecialCheckTaskLog specialCheckTaskLog = specialCheckTaskService.getSpecialCheckTaskLogByIndexId(indexId);
+
+        TbSpecialCheckTaskLogDateDTO tbSpecialCheckTaskLogDateDTO = BeanCopyUtils.copyBean(specialCheckTaskLog, TbSpecialCheckTaskLogDateDTO.class);
+        Instant instant = specialCheckTaskLog.getCheckDate().atZone(ZoneId.systemDefault()).toInstant();
+        tbSpecialCheckTaskLogDateDTO.setCheckDate(Date.from(instant));
+        mmap.put("specialCheckTaskLog",tbSpecialCheckTaskLogDateDTO);
+        List<RiskList> riskList = riskListService.listHazardSource();
+        mmap.put("hazardList", riskList);
+        List<TbBaseCheckTask> listResult = tbBaseCheckService.listTbBaseCheckTask();
+        mmap.put("tbBaseCheckTask", listResult);
+        return prefix + "/detail";
+    }
+
+    /**
      * 修改保存
      */
     @PostMapping("/edit")
     @ResponseBody
-    public AjaxResult editSave(TbSpecialCheckTaskLogUpdateBO updateBO)
+    public AjaxResult editSave(TbSpecialCheckTaskLogEditBO taskLogEditBO)
     {
-        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.updateSpecialCheckTaskLog(updateBO);
+        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.updateSpecialCheckTaskLog(taskLogEditBO);
         String code = resultVO.getCode();
         if ("200".equals(code)){
             return toAjax(1);

--
Gitblit v1.9.2