双重预防项目-国泰新华二开定制版
heheng
2025-06-20 40e6b02f26a7c0a1911a69b951c948f582df4032
src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java
@@ -1,5 +1,7 @@
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;
import com.ruoyi.doublePrevention.vo.ResultVO;
@@ -8,12 +10,16 @@
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.Test.DealDataTask;
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;
import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog;
import com.ruoyi.project.tr.specialCheck.service.SpecialCheckTaskService;
@@ -23,6 +29,9 @@
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.sql.Date;
import java.time.Instant;
import java.time.ZoneId;
import java.util.List;
/**
@@ -47,17 +56,22 @@
    @GetMapping()
    public String selectTbBaseCheckTaskPage(ModelMap mmap)
//    @GetMapping()
//    public String selectTbBaseCheckTaskPage(ModelMap mmap)
//    {
//        return prefix + "/specialCheckTaskLog";
//    }
    @GetMapping("{id}")
    public String specialCheckTaskLog(@PathVariable("id")String id,ModelMap modelMap)
    {
        modelMap.put("id",id);
        return prefix + "/specialCheckTaskLog";
    }
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo selectSpecialCheckTaskLogPage(@RequestBody TbSpecialCheckTaskLogBO specialCheckTaskLogBO)
    public TableDataInfo selectSpecialCheckTaskLogPage(TbSpecialCheckTaskLogBO specialCheckTaskLogBO)
    {
        ResultVO<List<TbSpecialCheckTaskLog>> resultVO = specialCheckTaskService.selectSpecialCheckTaskLogPage(specialCheckTaskLogBO);
@@ -74,9 +88,10 @@
    @GetMapping("/add")
    public String add(ModelMap mmap)
    {
        ResultVO<List<RiskList>> resultVO = riskListService.listHazardSource();
        Object data = resultVO.getData();
        mmap.put("hazardList", data);
        List<RiskList> riskList = riskListService.listHazardSource();
        mmap.put("hazardList", riskList);
        List<TbBaseCheckTask> listResult = tbBaseCheckService.listTbBaseCheckTask();
        mmap.put("tbBaseCheckTask", listResult);
        return prefix + "/add";
    }
@@ -86,9 +101,9 @@
     */
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSpecialTask(@RequestBody 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);
@@ -97,17 +112,39 @@
        }
    }
    @GetMapping("/edit/{id}")
    @GetMapping("/edit/{indexId}")
    public String edit(@PathVariable("indexId") Long indexId, ModelMap mmap)
    {
        TbSpecialCheckTaskLog specialCheckTaskLogByIndexId = specialCheckTaskService.getSpecialCheckTaskLogByIndexId(indexId);
        mmap.put("specialCheckTaskLog",specialCheckTaskLogByIndexId);
        TbSpecialCheckTaskLog specialCheckTaskLog = specialCheckTaskService.getSpecialCheckTaskLogByIndexId(indexId);
        TbBaseCheckTaskBO tbBaseCheckTaskBO = new TbBaseCheckTaskBO();
        ResultVO<List<TbBaseCheckTask>> listResultVO = tbBaseCheckService.selectTbBaseCheckTaskPage(tbBaseCheckTaskBO);
        Object data = listResultVO.getData();
        mmap.put("tbBaseCheckTask", data);
        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 + "/edit";
    }
    /**
     *
     */
    @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";
    }
    /**
@@ -115,9 +152,9 @@
     */
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(@RequestBody 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);
@@ -129,7 +166,7 @@
    @PostMapping("/remove")
    @ResponseBody
    public AjaxResult remove(@RequestBody TbSpecialCheckTaskLogUpdateBO updateBO){
    public AjaxResult remove(TbSpecialCheckTaskLogUpdateBO updateBO){
        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.deleteTbSpecialCheckTaskLog(updateBO);
        String code = resultVO.getCode();
        if ("200".equals(code)){
@@ -139,6 +176,18 @@
        }
    }
//
//    @Autowired
//    private DealDataTask dealDataTask;
//
//    @GetMapping("/dealDataTask")
//    public AjaxResult dealDataTask()
//    {
//        dealDataTask.dealData();
//        return success();
//    }
}