diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java index 74483df1b1..06d8a2aee5 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -65,4 +67,13 @@ public class ClosedIssueListResultDTO implements Serializable { * 发布议题的图片 */ private List issueImgs; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index e5a8e0639e..7d010949fe 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -509,9 +509,7 @@ public class IssueServiceImpl implements IssueService { TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); form.setTopicIdList(topicIds); Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (!topicDetailsResult.success()) { - logger.error("调用resi-group批量查询详情失败"); - } else { + if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { List topicDetails = topicDetailsResult.getData(); HashMap rtm = convertTopicDetailList2Map(topicDetails); issueList.forEach(vi -> { @@ -521,8 +519,35 @@ public class IssueServiceImpl implements IssueService { vi.setTopicContent(rr == null ? "" :rr.getTopicContent()); vi.setLongitude(rr == null ? "" : rr.getLongitude()); vi.setLatitude(rr == null ? "" : rr.getLatitude()); + // 赋值话题详情 + if(null!=rr){ + TopicInfoComDTO topicInfoDTO=new TopicInfoComDTO(); + topicInfoDTO.setTopicId(rr.getTopicId()); + topicInfoDTO.setTopicContent(rr.getTopicContent()); + topicInfoDTO.setTopicImgs(rr.getTopicImgs()); + topicInfoDTO.setTopicVoices(rr.getTopicVoices()); + topicInfoDTO.setPublishedUser(rr.getReleaseUserName()); + topicInfoDTO.setReleaseTime(rr.getReleaseTime()); + vi.setTopicInfo(topicInfoDTO); + } }); } + // 来源于事件的 + List icEventIds = issueList.stream().filter(t -> t.getSourceType().equals("ic_event")).map(i -> i.getSourceId()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !CollectionUtils.isEmpty(eventInfoRes.getData())) { + Map eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getId, o -> o, (o1, o2) -> o1)); + issueList.forEach(vi -> { + IcEventDTO event = eventMap.get(vi.getSourceId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event, IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } + } } return issueList;