From c188e4980adbe855c237c0c9f8bd2910298323d7 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期一, 01 八月 2022 14:30:54 +0800
Subject: [PATCH] 事故快报伤亡

---
 incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentExpressServiceImpl.java |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentExpressServiceImpl.java b/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentExpressServiceImpl.java
index 6ae47a0..f5e88bb 100644
--- a/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentExpressServiceImpl.java
+++ b/incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/impl/AccidentExpressServiceImpl.java
@@ -10,14 +10,17 @@
 import com.gkhy.safePlatform.incidentManage.entity.*;
 import com.gkhy.safePlatform.incidentManage.enums.AccidentResultCodes;
 import com.gkhy.safePlatform.incidentManage.exception.AccidentException;
+import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentExpressCasualtyReqDTO;
 import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentExpressFileReqDTO;
 import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentExpressReqDTO;
+import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentExpressCasualtyRespDTO;
 import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentExpressDetailRespDTO;
 import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentExpressFileRespDTO;
 import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentExpressPageRespDTO;
 import com.gkhy.safePlatform.incidentManage.query.AccidentExpressQuery;
 import com.gkhy.safePlatform.incidentManage.query.db.AccidentExpressDBQuery;
 import com.gkhy.safePlatform.incidentManage.service.AccidentExpressService;
+import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressCasualtyInfoService;
 import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressFileInfoService;
 import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressInfoService;
 import org.springframework.beans.BeanUtils;
@@ -39,6 +42,9 @@
     @Autowired
     private AccidentExpressFileInfoService accidentExpressFileInfoService;
 
+    @Autowired
+    private AccidentExpressCasualtyInfoService accidentExpressCasualtyInfoService;
+
 
     @Override
     public SearchResultVO<List<AccidentExpressPageRespDTO>> selectAccidentExpressList(PageQuery<AccidentExpressQuery> query) {
@@ -55,7 +61,7 @@
         List<AccidentExpressPageRespDTO> respList = BeanCopyUtils.copyBeanList(accidentExpressInfoPageDOList, AccidentExpressPageRespDTO.class);
 
         respList.forEach(AccidentExpressPageRespDTO ->{
-
+            // 设置人员名称
         });
 
         return new SearchResultVO<>(
@@ -206,6 +212,33 @@
         }
     }
 
+    @Override
+    public ResultVO selectAccidentExpressCasualtyList(Long accidentExpressId) {
+        List<AccidentExpressCasualtyInfoDO> accidentExpressCasualtyInfoDOList = accidentExpressCasualtyInfoService.selectByAccidentExpressId(accidentExpressId);
+        List<AccidentExpressCasualtyRespDTO> respList =BeanCopyUtils.copyBeanList(accidentExpressCasualtyInfoDOList, AccidentExpressCasualtyRespDTO.class);
+        return new ResultVO<>(ResultCodes.OK,respList);
+    }
+
+    @Override
+    public ResultVO addAccidentExpressCasualty(Long uid, AccidentExpressCasualtyReqDTO accidentExpressCasualtyReqDTO) {
+        if (accidentExpressCasualtyReqDTO.getAccidentExpressId()==null){
+            throw new AccidentException(AccidentResultCodes.ACCIDENT_EXPRESS_NULL);
+        }else{
+            AccidentExpressCasualtyInfo accidentExpressCasualtyInfo = new AccidentExpressCasualtyInfo();
+            BeanUtils.copyProperties(accidentExpressCasualtyReqDTO,accidentExpressCasualtyInfo);
+            accidentExpressCasualtyInfo.setDelFlag(false);
+            accidentExpressCasualtyInfo.setGmtCreate(new Date());
+            accidentExpressCasualtyInfo.setCreateUid(uid);
+            accidentExpressCasualtyInfoService.addAccidentExpressCasualty(accidentExpressCasualtyInfo);
+            return new ResultVO(ResultCodes.OK);
+        }
+    }
+
+    @Override
+    public ResultVO delAccidentExpressCasualty(Long accidentExpressId) {
+        accidentExpressCasualtyInfoService.deleteAccidentExpressCasualtyById(accidentExpressId);
+        return new ResultVO(ResultCodes.OK);
+    }
 
 
 

--
Gitblit v1.9.2