From bcce1d954823f53ff7c4a20e6a5d967aea648395 Mon Sep 17 00:00:00 2001 From: wangqian <1406304305@qq.com> Date: Sat, 30 May 2026 19:15:50 +0800 Subject: [PATCH] 首页查询详情图片数组bug修改 --- urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml | 2 +- urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/AppMainInfoController.java | 26 +++++++++++++++++++------- urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml b/urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml index b42e5a6..0760bc6 100644 --- a/urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml +++ b/urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml @@ -597,7 +597,7 @@ SUM(CASE WHEN w.status = 2 THEN 1 ELSE 0 END) AS finish, SUM(CASE WHEN w.status != 2 THEN 1 ELSE 0 END) AS ongoing FROM system_dept d - LEFT JOIN workorder_main_info w ON w.worker_company_id = d.id + LEFT JOIN workorder_main_info w ON w.worker_company_id = d.id and w.deleted = 0 WHERE w.order_type !='Q' diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/AppMainInfoController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/AppMainInfoController.java index bb98588..7ff48d1 100644 --- a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/AppMainInfoController.java +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/AppMainInfoController.java @@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RestController; import java.io.IOException; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; @@ -69,13 +70,24 @@ public class AppMainInfoController { List attachmentDOList = attachmentService.getAttachmentByOrderNo(Arrays.asList(mainInfo.getOrderNo())); if (!CollectionUtils.isEmpty(attachmentDOList)) { attachmentMap = attachmentDOList.stream() - .collect(Collectors.groupingBy( - AttachmentDO::getBusiType, - Collectors.mapping( - AttachmentDO::getFileNames, - Collectors.toList() - ) - )); + .flatMap(att -> { + // 1. 取出逗号分隔的字符串 + String fileNames = att.getFileNames(); + if (fileNames == null || fileNames.isEmpty()) { + return Stream.empty(); + } + // 2. 按逗号切割,去掉空字符串,转成 Stream + return Arrays.stream(fileNames.split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + // 把 业务类型 和 文件名 绑定一起返回 + .map(fileName -> new AbstractMap.SimpleEntry<>(att.getBusiType(), fileName)); + }) + // 3. 按业务类型分组,收集成 List + .collect(Collectors.groupingBy( + Map.Entry::getKey, + Collectors.mapping(Map.Entry::getValue, Collectors.toList()) + )); } } diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java index acc5f78..e6abe66 100644 --- a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java @@ -118,7 +118,7 @@ public class MainInfoServiceImpl implements MainInfoService { if ("1".equals(pageReqVO.getQueryType())) { //全域督察员查询自己发起的工单 List userIds = roleApi.getUserIdsByRoleCode(CommonConstants.INSPECTOR_ROLE_KEY); - if (userIds.contains(getLoginUserId())) { + if (!userIds.contains(getLoginUserId())) { pageReqVO.setUserId(getLoginUserId()); pageReqVO.setWorkerCompanyId(null); } -- libgit2 0.21.4