| | |
| | | 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; |
| | |
| | | private EmergencySuppliesInspectInfoService emergencySuppliesInspectInfoService; |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesInspectUserInfoService emergencySuppliesInspectUserInfoService; |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesMaintainInfoService emergencySuppliesMaintainInfoService; |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesMaintainUserInfoService emergencySuppliesMaintainUserInfoService; |
| | | |
| | | |
| | | @DubboReference(check = false) |
| | |
| | | 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); |
| | | } |
| | | } |