From 4f7caa486fbae3366f9cd862f67a05c7779e38b0 Mon Sep 17 00:00:00 2001 From: 16639036659 <577530412@qq.com> Date: 星期三, 19 六月 2024 08:53:57 +0800 Subject: [PATCH] 临时提交 --- src/main/java/com/ruoyi/project/tr/specialCheck/controller/TBSpecialCheckTaskLogController.java | 46 +++++++++++++++++++++++++++++++++++++++------- 1 files changed, 39 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 c4eba28..a1630ea 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,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,17 @@ 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.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 +30,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; /** @@ -101,16 +111,38 @@ } } - @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 + "/edit"; } -- Gitblit v1.9.2