Commit bcce1d954823f53ff7c4a20e6a5d967aea648395

Authored by wangqian
1 parent 8502855c

首页查询详情图片数组bug修改

urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml
... ... @@ -597,7 +597,7 @@
597 597 SUM(CASE WHEN w.status = 2 THEN 1 ELSE 0 END) AS finish,
598 598 SUM(CASE WHEN w.status != 2 THEN 1 ELSE 0 END) AS ongoing
599 599 FROM system_dept d
600   - LEFT JOIN workorder_main_info w ON w.worker_company_id = d.id
  600 + LEFT JOIN workorder_main_info w ON w.worker_company_id = d.id and w.deleted = 0
601 601 WHERE w.order_type !='Q'
602 602 <!-- queryType = 1 时,才拼接 督察工单(IWO开头)条件 -->
603 603 <if test='queryType != null and queryType == "1"'>
... ...
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;
37 37 import java.io.IOException;
38 38 import java.util.*;
39 39 import java.util.stream.Collectors;
  40 +import java.util.stream.Stream;
40 41  
41 42 import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
42 43 import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
... ... @@ -69,13 +70,24 @@ public class AppMainInfoController {
69 70 List<AttachmentDO> attachmentDOList = attachmentService.getAttachmentByOrderNo(Arrays.asList(mainInfo.getOrderNo()));
70 71 if (!CollectionUtils.isEmpty(attachmentDOList)) {
71 72 attachmentMap = attachmentDOList.stream()
72   - .collect(Collectors.groupingBy(
73   - AttachmentDO::getBusiType,
74   - Collectors.mapping(
75   - AttachmentDO::getFileNames,
76   - Collectors.toList()
77   - )
78   - ));
  73 + .flatMap(att -> {
  74 + // 1. 取出逗号分隔的字符串
  75 + String fileNames = att.getFileNames();
  76 + if (fileNames == null || fileNames.isEmpty()) {
  77 + return Stream.empty();
  78 + }
  79 + // 2. 按逗号切割,去掉空字符串,转成 Stream
  80 + return Arrays.stream(fileNames.split(","))
  81 + .map(String::trim)
  82 + .filter(s -> !s.isEmpty())
  83 + // 把 业务类型 和 文件名 绑定一起返回
  84 + .map(fileName -> new AbstractMap.SimpleEntry<>(att.getBusiType(), fileName));
  85 + })
  86 + // 3. 按业务类型分组,收集成 List<String>
  87 + .collect(Collectors.groupingBy(
  88 + Map.Entry::getKey,
  89 + Collectors.mapping(Map.Entry::getValue, Collectors.toList())
  90 + ));
79 91 }
80 92 }
81 93  
... ...
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java
... ... @@ -118,7 +118,7 @@ public class MainInfoServiceImpl implements MainInfoService {
118 118 if ("1".equals(pageReqVO.getQueryType())) {
119 119 //全域督察员查询自己发起的工单
120 120 List<Long> userIds = roleApi.getUserIdsByRoleCode(CommonConstants.INSPECTOR_ROLE_KEY);
121   - if (userIds.contains(getLoginUserId())) {
  121 + if (!userIds.contains(getLoginUserId())) {
122 122 pageReqVO.setUserId(getLoginUserId());
123 123 pageReqVO.setWorkerCompanyId(null);
124 124 }
... ...