Commit db4fa6d2367d5b010d5528b5688c5c241cd2c8f7
1 parent
fd83a3e5
工单管理详情图片返回数组
Showing
2 changed files
with
16 additions
and
3 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java
| @@ -136,7 +136,7 @@ public class MainInfoRespVO { | @@ -136,7 +136,7 @@ public class MainInfoRespVO { | ||
| 136 | private LocalDateTime createTime; | 136 | private LocalDateTime createTime; |
| 137 | 137 | ||
| 138 | @Schema(description = "文件名称") | 138 | @Schema(description = "文件名称") |
| 139 | - private String fileNames; | 139 | + private List<String> fileNames; |
| 140 | 140 | ||
| 141 | @Schema(description = "共同处理人") | 141 | @Schema(description = "共同处理人") |
| 142 | private Set<Long> coHandlers; | 142 | private Set<Long> coHandlers; |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/maininfo/MainInfoConvert.java
| @@ -10,6 +10,7 @@ import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | @@ -10,6 +10,7 @@ import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | ||
| 10 | import org.mapstruct.Mapper; | 10 | import org.mapstruct.Mapper; |
| 11 | import org.mapstruct.factory.Mappers; | 11 | import org.mapstruct.factory.Mappers; |
| 12 | 12 | ||
| 13 | +import java.util.Arrays; | ||
| 13 | import java.util.List; | 14 | import java.util.List; |
| 14 | import java.util.Map; | 15 | import java.util.Map; |
| 15 | import java.util.Objects; | 16 | import java.util.Objects; |
| @@ -31,7 +32,13 @@ public interface MainInfoConvert { | @@ -31,7 +32,13 @@ public interface MainInfoConvert { | ||
| 31 | MainInfoRespVO mainInfoVo = BeanUtils.toBean(mainInfoDO, MainInfoRespVO.class); | 32 | MainInfoRespVO mainInfoVo = BeanUtils.toBean(mainInfoDO, MainInfoRespVO.class); |
| 32 | if (attachmentMap != null && !attachmentMap.isEmpty()) { | 33 | if (attachmentMap != null && !attachmentMap.isEmpty()) { |
| 33 | AttachmentDO attachmentDO = attachmentMap.get(mainInfoDO.getOrderNo()); | 34 | AttachmentDO attachmentDO = attachmentMap.get(mainInfoDO.getOrderNo()); |
| 34 | - mainInfoVo.setFileNames(attachmentDO.getFileNames()); | 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 | } | 42 | } |
| 36 | return mainInfoVo; | 43 | return mainInfoVo; |
| 37 | }); | 44 | }); |
| @@ -43,7 +50,13 @@ public interface MainInfoConvert { | @@ -43,7 +50,13 @@ public interface MainInfoConvert { | ||
| 43 | if (mainInfoDO != null) { | 50 | if (mainInfoDO != null) { |
| 44 | if (attachmentMap != null && !attachmentMap.isEmpty()) { | 51 | if (attachmentMap != null && !attachmentMap.isEmpty()) { |
| 45 | AttachmentDO attachmentDO = attachmentMap.get(mainInfoDO.getOrderNo()); | 52 | AttachmentDO attachmentDO = attachmentMap.get(mainInfoDO.getOrderNo()); |
| 46 | - mainInfoVo.setFileNames(attachmentDO.getFileNames()); | 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); | ||
| 47 | } | 60 | } |
| 48 | mainInfoVo.setCompanyName(deptName); | 61 | mainInfoVo.setCompanyName(deptName); |
| 49 | if (mainInfoVo.getCoHandlers() != null && !mainInfoVo.getCoHandlers().isEmpty()) { | 62 | if (mainInfoVo.getCoHandlers() != null && !mainInfoVo.getCoHandlers().isEmpty()) { |