Commit 8cd2ca58aaaba9f54acae8969a0b5db6210a0a2c
1 parent
b784c0fd
工单管理修改
Showing
1 changed file
with
18 additions
and
14 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/maininfo/MainInfoConvert.java
| ... | ... | @@ -32,13 +32,15 @@ public interface MainInfoConvert { |
| 32 | 32 | MainInfoRespVO mainInfoVo = BeanUtils.toBean(mainInfoDO, MainInfoRespVO.class); |
| 33 | 33 | if (attachmentMap != null && !attachmentMap.isEmpty()) { |
| 34 | 34 | AttachmentDO attachmentDO = attachmentMap.get(mainInfoDO.getOrderNo()); |
| 35 | - String fileNamesStr = attachmentDO.getFileNames(); | |
| 36 | - List<String> fileNameList = fileNamesStr == null | |
| 37 | - ? List.of() | |
| 38 | - : Arrays.stream(fileNamesStr.split(",")) | |
| 39 | - .filter(fileName -> fileName != null && !fileName.trim().isEmpty()) // 过滤空字符串和空白 | |
| 40 | - .collect(Collectors.toList()); | |
| 41 | - mainInfoVo.setFileNames(fileNameList); | |
| 35 | + if (attachmentDO != null) { | |
| 36 | + String fileNamesStr = attachmentDO.getFileNames(); | |
| 37 | + List<String> fileNameList = fileNamesStr == null | |
| 38 | + ? List.of() | |
| 39 | + : Arrays.stream(fileNamesStr.split(",")) | |
| 40 | + .filter(fileName -> fileName != null && !fileName.trim().isEmpty()) // 过滤空字符串和空白 | |
| 41 | + .collect(Collectors.toList()); | |
| 42 | + mainInfoVo.setFileNames(fileNameList); | |
| 43 | + } | |
| 42 | 44 | } |
| 43 | 45 | return mainInfoVo; |
| 44 | 46 | }); |
| ... | ... | @@ -50,13 +52,15 @@ public interface MainInfoConvert { |
| 50 | 52 | if (mainInfoDO != null) { |
| 51 | 53 | if (attachmentMap != null && !attachmentMap.isEmpty()) { |
| 52 | 54 | AttachmentDO attachmentDO = attachmentMap.get(mainInfoDO.getOrderNo()); |
| 53 | - String fileNamesStr = attachmentDO.getFileNames(); | |
| 54 | - List<String> fileNameList = fileNamesStr == null | |
| 55 | - ? List.of() | |
| 56 | - : Arrays.stream(fileNamesStr.split(",")) | |
| 57 | - .filter(fileName -> fileName != null && !fileName.trim().isEmpty()) // 过滤空字符串和空白 | |
| 58 | - .collect(Collectors.toList()); | |
| 59 | - mainInfoVo.setFileNames(fileNameList); | |
| 55 | + if (attachmentDO != null) { | |
| 56 | + String fileNamesStr = attachmentDO.getFileNames(); | |
| 57 | + List<String> fileNameList = fileNamesStr == null | |
| 58 | + ? List.of() | |
| 59 | + : Arrays.stream(fileNamesStr.split(",")) | |
| 60 | + .filter(fileName -> fileName != null && !fileName.trim().isEmpty()) // 过滤空字符串和空白 | |
| 61 | + .collect(Collectors.toList()); | |
| 62 | + mainInfoVo.setFileNames(fileNameList); | |
| 63 | + } | |
| 60 | 64 | } |
| 61 | 65 | mainInfoVo.setCompanyName(deptName); |
| 62 | 66 | if (mainInfoVo.getCoHandlers() != null && !mainInfoVo.getCoHandlers().isEmpty()) { | ... | ... |