| | |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_ENUM_STATUS_NOT_EXIST); |
| | | } |
| | | } |
| | | |
| | | public List<EmergencySuppliesInfoRespDTO> getEmergencySupplies(){ |
| | | List<EmergencySuppliesInfo> allEmergencySupplies = emergencySuppliesInfoService.getAllEmergencySupplies(); |
| | | List<EmergencySuppliesInfoRespDTO> collect = allEmergencySupplies.stream().map(es -> { |
| | | EmergencySuppliesInfoRespDTO e = new EmergencySuppliesInfoRespDTO(); |
| | | BeanUtils.copyProperties(es,e); |
| | | e.setClassificationName(EmergencySuppliesClassificationEnum.getByCode(es.getClassification()).getValue()); |
| | | ResultVO<DepInfoRPCRespDTO> rpcResult = accountDepartmentService.getDepInfoByDepId(es.getDepartmentId()); |
| | | if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) { |
| | | if (rpcResult.getData() != null) { |
| | | DepInfoRPCRespDTO dep = (DepInfoRPCRespDTO) rpcResult.getData(); |
| | | e.setDepartmentName(dep.getDepName()); |
| | | } |
| | | } |
| | | return e; |
| | | }).collect(Collectors.toList()); |
| | | return collect; |
| | | |
| | | } |
| | | } |