emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencySuppliesController.java
@@ -24,7 +24,7 @@ private EmergencySuppliesService emergencySuppliesService; /** * 应急预案列表 * 应急物资列表 */ @RequestMapping(value = "/page/list" ,method = RequestMethod.POST) private ResultVO<List<EmergencySuppliesPageRespDTO>> list (@RequestBody PageQuery<EmergencySuppliesQuery> pageQuery){ @@ -33,7 +33,7 @@ } /** * 应急预案新增 * 应急物资新增 */ @RequestMapping(value = "/add",method = RequestMethod.POST) public ResultVO addEmergencySupplies(Authentication authentication, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { @@ -42,7 +42,7 @@ } /** * 应急预案详情 * 应急物资详情 */ @RequestMapping(value = "/info/{id}",method = RequestMethod.GET) public ResultVO<EmergencySuppliesDetailRespDTO> getEmergencySuppliesById(@PathVariable("id")Long id){ @@ -50,7 +50,7 @@ } /** * 应急预案修改 * 应急物资修改 */ @RequestMapping(value = "/update",method = RequestMethod.POST) public ResultVO updateEmergencySupplies(Authentication authentication, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { @@ -59,7 +59,7 @@ } /** * 应急预案删除/批量删除 * 应急物资删除/批量删除 */ @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) public ResultVO batchDeleteEmergencySupplies(@RequestBody Long[] ids){ emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/model/dto/resp/EmergencySuppliesDetailRespDTO.java
@@ -4,11 +4,35 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesMaintainInfoDetailDO; import com.gkhy.safePlatform.emergency.model.dto.req.EmergencySuppliesInspectReqDTO; import com.gkhy.safePlatform.emergency.model.dto.req.EmergencySuppliesMaintainReqDTO; import java.util.Date; import java.util.List; public class EmergencySuppliesDetailRespDTO { private List<EmergencySuppliesMaintainDetailRespDTO> maintainList; private List<EmergencySuppliesInspectDetailRespDTO> inspectList; public List<EmergencySuppliesMaintainDetailRespDTO> getMaintainList() { return maintainList; } public void setMaintainList(List<EmergencySuppliesMaintainDetailRespDTO> maintainList) { this.maintainList = maintainList; } public List<EmergencySuppliesInspectDetailRespDTO> getInspectList() { return inspectList; } public void setInspectList(List<EmergencySuppliesInspectDetailRespDTO> inspectList) { this.inspectList = inspectList; } private String principalUserName; public String getPrincipalUserName() { emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencySuppliesInspectInfoRepository.java
@@ -25,4 +25,6 @@ void deleteEmergencySuppliesInspect(@Param("id") Long id); void deleteBySuppliesId(@Param("id")Long id); List<EmergencySuppliesInspectInfoDetailDO> selectEmergencySuppliesInspectBySuppliesId(Long id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencySuppliesMaintainInfoRepository.java
@@ -25,4 +25,6 @@ void deleteEmergencySuppliesMaintain(@Param("id") Long id); void deleteBySuppliesId(@Param("id")Long id); List<EmergencySuppliesMaintainInfoDetailDO> selectEmergencySuppliesMaintainBySuppliesId(Long id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencyWorkApproveInfoRepository.java
@@ -24,5 +24,5 @@ void deleteWorkApproveById(@Param("id") Long id); void selectWorkApproveByRelateTypeAndRelateId(@Param("type")Integer type, @Param("id")Long id); List<EmergencyWorkApproveInfoDetailDO> selectWorkApproveByRelateTypeAndRelateId(@Param("type")Integer type, @Param("id")Long id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/EmergencySuppliesInspectInfoService.java
@@ -23,4 +23,6 @@ void deleteEmergencySuppliesInspect(Long SuppliesInspectId); void deleteBySuppliesId(Long id); List<EmergencySuppliesInspectInfoDetailDO> selectEmergencySuppliesInspectBySuppliesId(Long id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/EmergencySuppliesMaintainInfoService.java
@@ -23,4 +23,6 @@ void deleteEmergencySuppliesMaintain(Long SuppliesMaintainId); void deleteBySuppliesId(Long id); List<EmergencySuppliesMaintainInfoDetailDO> selectEmergencySuppliesMaintainBySuppliesId(Long id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/EmergencyWorkApproveInfoService.java
@@ -24,5 +24,5 @@ void deleteWorkApproveById(Long teamId); List<EmergencyWorkApproveInfoPageDO> selectWorkApproveByRelateTypeAndRelateId(Integer type, Long id); List<EmergencyWorkApproveInfoDetailDO> selectWorkApproveByRelateTypeAndRelateId(Integer type, Long id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/impl/EmergencySuppliesInspectInfoServiceImpl.java
@@ -49,5 +49,10 @@ emergencySuppliesInspectInfoRepository.deleteBySuppliesId(id); } @Override public List<EmergencySuppliesInspectInfoDetailDO> selectEmergencySuppliesInspectBySuppliesId(Long id) { return emergencySuppliesInspectInfoRepository.selectEmergencySuppliesInspectBySuppliesId(id); } } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/impl/EmergencySuppliesMaintainInfoServiceImpl.java
@@ -49,5 +49,10 @@ emergencySuppliesMaintainInfoRepository.deleteBySuppliesId(id); } @Override public List<EmergencySuppliesMaintainInfoDetailDO> selectEmergencySuppliesMaintainBySuppliesId(Long id) { return emergencySuppliesMaintainInfoRepository.selectEmergencySuppliesMaintainBySuppliesId(id); } } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/impl/EmergencyWorkApproveServiceImpl.java
@@ -45,9 +45,8 @@ } @Override public List<EmergencyWorkApproveInfoPageDO> selectWorkApproveByRelateTypeAndRelateId(Integer type, Long id) { emergencyWorkApproveInfoRepository.selectWorkApproveByRelateTypeAndRelateId(type,id); return null; public List<EmergencyWorkApproveInfoDetailDO> selectWorkApproveByRelateTypeAndRelateId(Integer type, Long id) { return emergencyWorkApproveInfoRepository.selectWorkApproveByRelateTypeAndRelateId(type,id); } emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/impl/EmergencyPlanServiceImpl.java
@@ -70,11 +70,11 @@ //获取对应的审批记录 Integer type = ApproveStatus.EMERGENCY.getStatus(); List<EmergencyWorkApproveInfoPageDO> emergencyWorkApproveInfoPageDOList = emergencyWorkApproveInfoService.selectWorkApproveByRelateTypeAndRelateId(type,emergencyPlanPageRespDTO.getId()); List<EmergencyWorkApproveInfoDetailDO> emergencyWorkApproveInfoDetailDOList = emergencyWorkApproveInfoService.selectWorkApproveByRelateTypeAndRelateId(type,emergencyPlanPageRespDTO.getId()); if (!CollectionUtils.isEmpty(emergencyWorkApproveInfoPageDOList)) { emergencyPlanPageRespDTO.setApproveStatus(emergencyWorkApproveInfoPageDOList.get(0).getApproveStatus()); emergencyPlanPageRespDTO.setApprovePersonId(emergencyWorkApproveInfoPageDOList.get(0).getApprovePersonId()); if (!CollectionUtils.isEmpty(emergencyWorkApproveInfoDetailDOList)) { emergencyPlanPageRespDTO.setApproveStatus(emergencyWorkApproveInfoDetailDOList.get(0).getApproveStatus()); emergencyPlanPageRespDTO.setApprovePersonId(emergencyWorkApproveInfoDetailDOList.get(0).getApprovePersonId()); // 审批中 判断审批人是否人与当前登录人 if (emergencyPlanPageRespDTO.getApproveStatus()!=null && emergencyPlanPageRespDTO.getApproveStatus()==2){ emergencyPlanPageRespDTO.setCheckApprove(emergencyPlanPageRespDTO.getApprovePersonId().equals(uid)); emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/impl/EmergencySuppliesServiceImpl.java
@@ -15,12 +15,14 @@ import com.gkhy.safePlatform.emergency.model.dto.resp.*; import com.gkhy.safePlatform.emergency.query.EmergencySuppliesQuery; import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; import com.gkhy.safePlatform.emergency.service.EmergencySuppliesMaintainService; import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService; import com.gkhy.safePlatform.emergency.service.baseService.*; import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.Date; import java.util.HashMap; @@ -37,7 +39,13 @@ private EmergencySuppliesInspectInfoService emergencySuppliesInspectInfoService; @Autowired private EmergencySuppliesInspectUserInfoService emergencySuppliesInspectUserInfoService; @Autowired private EmergencySuppliesMaintainInfoService emergencySuppliesMaintainInfoService; @Autowired private EmergencySuppliesMaintainUserInfoService emergencySuppliesMaintainUserInfoService; @DubboReference(check = false) @@ -108,6 +116,36 @@ throw new EmergencyException(EmergencyResultCodes.SUPPLIES_NOT_EXIST); }else{ BeanUtils.copyProperties(emergencySuppliesInfoDetailDO,emergencySuppliesDetailRespDTO); // 查找检查记录 List<EmergencySuppliesInspectInfoDetailDO> inspectDetailDOList = emergencySuppliesInspectInfoService.selectEmergencySuppliesInspectBySuppliesId(emergencySuppliesDetailRespDTO.getId()); if (!CollectionUtils.isEmpty(inspectDetailDOList)){ List<EmergencySuppliesInspectDetailRespDTO> inspectList = BeanCopyUtils.copyBeanList(inspectDetailDOList,EmergencySuppliesInspectDetailRespDTO.class); // 创建人 for (EmergencySuppliesInspectDetailRespDTO emergencySuppliesInspectDetailRespDTO :inspectList){ List<EmergencySuppliesInspectUserInfoDO> inspectUserDOList = emergencySuppliesInspectUserInfoService.selectEmergencySuppliesInspectUserBySuppliesInspectId(emergencySuppliesInspectDetailRespDTO.getId()); if (!CollectionUtils.isEmpty(inspectUserDOList)){ List<EmergencySuppliesInspectUserRespDTO> inspectUserList = BeanCopyUtils.copyBeanList(inspectUserDOList,EmergencySuppliesInspectUserRespDTO.class); emergencySuppliesInspectDetailRespDTO.setUserList(inspectUserList); } } emergencySuppliesDetailRespDTO.setInspectList(inspectList); } // 查找保养记录 List<EmergencySuppliesMaintainInfoDetailDO> maintainDetailDOList = emergencySuppliesMaintainInfoService.selectEmergencySuppliesMaintainBySuppliesId(emergencySuppliesDetailRespDTO.getId()); if (!CollectionUtils.isEmpty(maintainDetailDOList)){ List<EmergencySuppliesMaintainDetailRespDTO> maintainList = BeanCopyUtils.copyBeanList(maintainDetailDOList,EmergencySuppliesMaintainDetailRespDTO.class); // 创建人 for (EmergencySuppliesMaintainDetailRespDTO emergencySuppliesMaintainDetailRespDTO :maintainList){ List<EmergencySuppliesMaintainUserInfoDO> maintainUserDOList = emergencySuppliesMaintainUserInfoService.selectEmergencySuppliesMaintainUserBySuppliesMaintainId(emergencySuppliesMaintainDetailRespDTO.getId()); if (!CollectionUtils.isEmpty(maintainUserDOList)){ List<EmergencySuppliesMaintainUserRespDTO> maintainUserList = BeanCopyUtils.copyBeanList(maintainUserDOList,EmergencySuppliesMaintainUserRespDTO.class); emergencySuppliesMaintainDetailRespDTO.setUserList(maintainUserList); } } emergencySuppliesDetailRespDTO.setMaintainList(maintainList); } return new ResultVO<>(ResultCodes.OK,emergencySuppliesDetailRespDTO); } } emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencySuppliesInspectInfoMapper.xml
@@ -75,6 +75,20 @@ a.del_flag = 0 and a.id = #{id} </select> <select id="selectEmergencySuppliesInspectBySuppliesId" resultMap="emergencySuppliesInspectInfoDetailDOResult"> SELECT a.id, a.`supplies_id`, a.`inspect_result`, a.`inspect_time`, b.`name` AS suppliesName FROM emergency_supplies_inspect a LEFT JOIN emergency_supplies b ON a.supplies_id = b.id WHERE a.del_flag = 0 and a.supplies_id = #{id} </select> <update id="updateEmergencySuppliesInspect" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInspectInfo"> update emergency_supplies_inspect <trim prefix="SET" suffixOverrides=","> emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencySuppliesMaintainInfoMapper.xml
@@ -76,6 +76,22 @@ a.del_flag = 0 and a.id = #{id} </select> <select id="selectEmergencySuppliesMaintainBySuppliesId" resultMap="emergencySuppliesMaintainInfoDetailDOResult"> SELECT a.id, a.`supplies_id`, a.`maintain_result`, a.`maintain_time`, b.`name` AS suppliesName FROM emergency_supplies_maintain a LEFT JOIN emergency_supplies b ON a.supplies_id = b.id WHERE a.del_flag = 0 and a.supplies_id = #{id} </select> <update id="updateEmergencySuppliesMaintain" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesMaintainInfo"> update emergency_supplies_maintain <trim prefix="SET" suffixOverrides=",">