From d59ce37bc27d01da323b79c10200e93796865fee Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期五, 02 九月 2022 10:09:42 +0800
Subject: [PATCH] fix

---
 incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentReportServiceImpl.java |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentReportServiceImpl.java b/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentReportServiceImpl.java
index 701100c..69ee086 100644
--- a/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentReportServiceImpl.java
+++ b/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentReportServiceImpl.java
@@ -14,12 +14,11 @@
 import com.gkhy.safePlatform.incidentManage.exception.AccidentException;
 import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportFileReqDTO;
 import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportReqDTO;
-import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportDetailRespDTO;
-import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportFileRespDTO;
-import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportPageRespDTO;
+import com.gkhy.safePlatform.incidentManage.model.dto.resp.*;
 import com.gkhy.safePlatform.incidentManage.query.AccidentReportQuery;
 import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery;
 import com.gkhy.safePlatform.incidentManage.service.AccidentReportService;
+import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressFileInfoService;
 import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressInfoService;
 import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportFileInfoService;
 import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportInfoService;
@@ -46,6 +45,9 @@
 
     @Autowired
     private AccidentExpressInfoService accidentExpressInfoService;
+
+    @Autowired
+    private AccidentExpressFileInfoService accidentExpressFileInfoService;
 
 
     @Override
@@ -105,7 +107,6 @@
         accidentReportInfo.setDelFlag(false);
         accidentReportInfo.setCreateUid(uid);
         accidentReportInfo.setGmtCreate(nowDate);
-        accidentReportInfo.setStatus(false);
         accidentReportInfoService.addAccidentReport(accidentReportInfo);
         //2.新增事故报告附件
         if (!CollectionUtils.isEmpty(accidentReportReqDTO.getFileList())) {
@@ -136,12 +137,20 @@
             throw new AccidentException(AccidentResultCodes.ACCIDENT_REPORT_NOT_EXIST);
         } else {
             BeanUtils.copyProperties(AccidentReportInfoDetailDO, AccidentReportDetailRespDTO);
-            //查找对应的附件
+            //查找事故报告对应的附件
             List<AccidentReportFileInfoDO> AccidentReportFileInfoDOList = accidentReportFileInfoService.selectByAccidentReportId(id);
             if (!CollectionUtils.isEmpty(AccidentReportFileInfoDOList)) {
                 List<AccidentReportFileRespDTO> accidentReportFileRespDTOList = BeanCopyUtils.copyBeanList(AccidentReportFileInfoDOList, AccidentReportFileRespDTO.class);
                 AccidentReportDetailRespDTO.setFileList(accidentReportFileRespDTOList);
             }
+            //  查找事故快报对应的附件
+            List<AccidentExpressFileInfoDO> AccidentExpressFileInfoDOList = accidentExpressFileInfoService.selectByAccidentExpressId(AccidentReportDetailRespDTO.getAccidentExpressId());
+            if (!CollectionUtils.isEmpty(AccidentExpressFileInfoDOList)) {
+                List<AccidentExpressFileRespDTO> accidentExpressFileRespDTOList = BeanCopyUtils.copyBeanList(AccidentExpressFileInfoDOList, AccidentExpressFileRespDTO.class);
+                AccidentReportDetailRespDTO.setExpressFileList(accidentExpressFileRespDTOList);
+            }
+
+
             return new ResultVO<>(ResultCodes.OK, AccidentReportDetailRespDTO);
         }
     }
@@ -220,6 +229,7 @@
         }
     }
 
+
     private void deleteAccidentReport(Long id) {
         //查询是否存在
         AccidentReportInfoDetailDO AccidentReportInfoDetailDO = accidentReportInfoService.selectAccidentReportById(id);

--
Gitblit v1.9.2