| | |
| | | List<DeviceEventDTO> newDeviceEventDTOS = new ArrayList<>(); |
| | | List<String> codes = Arrays.asList(Constants.FTP_RESOURCE_PATH,Constants.DEVICE_EVENT_IMG); |
| | | List<SystemDictData> list = systemDictDataMapper.list(codes); |
| | | Map<String,SystemDictData> dataMap = list.stream().collect(Collectors.toMap(SystemDictData::getLabel, Function.identity())); |
| | | for (DeviceEventDTO dto:DeviceEventDTOList) { |
| | | if(StringUtils.isNotBlank(dto.getExtEventPictureURL()) |
| | | && !dto.getExtEventPictureURL().startsWith(HKConstants.IMG_INDEX) |
| | | && !dto.getExtEventPictureURL().startsWith(HKConstants.IMG_INDEX_ERROR)) { |
| | | if(null != list && list.size() > 0) { |
| | | Map<String,SystemDictData> dataMap = list.stream().collect(Collectors.toMap(SystemDictData::getLabel, Function.identity())); |
| | | if(StringUtils.isNotBlank(dto.getExtEventPictureURL())){ |
| | | dto.setExtEventPictureURL(dataMap.get(Constants.FTP_RESOURCE_PATH).getCode() |
| | | +dataMap.get(Constants.DEVICE_EVENT_IMG).getCode() |
| | | +dto.getExtEventPictureURL()); |
| | | } |
| | | } |
| | | }else{ |
| | | dto.setExtEventPictureURL(null); |
| | | } |
| | | dto.setEventTypeName(HKConstants.EventTypes.getName(dto.getEventType())) ; |
| | | try { |