diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java index 3c676185b9..88ad6068c7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.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; @@ -75,4 +77,13 @@ public class ResolvedResultDTO 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 820c7b8a29..e5a8e0639e 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 @@ -651,7 +651,7 @@ public class IssueServiceImpl implements IssueService { Result> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { - // 3、如果存在议题来源于话题 + // 3.1、如果存在议题来源于话题 List topicIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(topicIds)) { // 3.1 查询话题详情 @@ -667,6 +667,23 @@ public class IssueServiceImpl implements IssueService { }); } } + //3.2 如果存在议题来源于事件 + List icEventIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("ic_event")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !CollectionUtils.isEmpty(eventInfoRes.getData())) { + //key:议题id;value:事件信息 + Map eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getOperationId, o -> o, (o1, o2) -> o1)); + resultList.forEach(vi -> { + IcEventDTO event = eventMap.get(vi.getIssueId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event,IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } + } Map issueMap=issueRes.getData().stream().collect(Collectors.toMap(IssueProfileDTO::getIssueId, o -> o, (o1, o2) -> o1)); // 赋值话题信息、议题来源、议题图片 resultList.forEach(vi -> { @@ -677,6 +694,17 @@ public class IssueServiceImpl implements IssueService { vi.setLongitude(rr == null ? StrConstant.EPMETY_STR : rr.getLongitude()); vi.setLatitude(rr == null ? StrConstant.EPMETY_STR : rr.getLatitude()); vi.setTopicId(null == rr ? StrConstant.EPMETY_STR : rr.getTopicId()); + // 赋值话题详情 + 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); + } IssueProfileDTO issue = issueMap.get(vi.getIssueId()); vi.setIssueSourceType(null != issue ? issue.getIssueSourceType() : StrConstant.EPMETY_STR); vi.setIssueImgs(null != issue ? issue.getIssueImgs() : new ArrayList<>());