diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java new file mode 100644 index 0000000000..529bc6c34a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java @@ -0,0 +1,38 @@ +package com.epmet.commons.tools.dto.commondto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 13:08 + */ +@Data +public class IcEventComDTO implements Serializable { + private static final long serialVersionUID = -5166489408303997740L; + /** + * 事件Id + */ + private String icEventId; + /** + * 事件内容 + */ + private String eventContent; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 0:已回复 1:已转项目 2:已转需求3:转议题 + */ + private String operationType; + + /** + * 项目、需求ID、议题id + */ + private String operationId; +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java new file mode 100644 index 0000000000..65c001b97f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java @@ -0,0 +1,65 @@ +package com.epmet.commons.tools.dto.commondto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 13:06 + */ +@Data +public class TopicInfoComDTO implements Serializable { + private static final long serialVersionUID = 4242861917113716511L; + /** + * 话题id + */ + private String topicId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 图片列表 + */ + private List topicImgs; + + /** + * 话题语音-2022.10.10 + */ + private List topicVoices; + + /** + * 话题发表人(山东路168-尹女士) + */ + private String publishedUser; + + /** + * 话题发表时间 (时间戳 毫秒级) + */ + private Long publishedTime; + + + private String releaseTime; + + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 话题所属小组名称 + */ + private String groupName; + +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java index 52e03407c7..ce7311130c 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java @@ -16,7 +16,7 @@ public class IssueProfileDTO { private String longitude; private String latitude; /** - * 来源类型 话题:resi_topic;直接立议题:issue; + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event */ private String issueSourceType; /** diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java index f4b76f8b96..a21e2f47d1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.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 lombok.NoArgsConstructor; @@ -70,4 +72,13 @@ public class PendingResultDTO 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-client/src/main/java/com/epmet/dto/result/HallIcEventDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/HallIcEventDTO.java deleted file mode 100644 index 37abb5cd03..0000000000 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/HallIcEventDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @Author yzm - * @Date 2022/10/10 14:47 - */ -@Data -public class HallIcEventDTO implements Serializable { - private static final long serialVersionUID = -6245586010939647194L; - /** - * 事件Id - */ - private String icEventId; - /** - * 事件内容 - */ - private String eventContent; -} - diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java index 4025307ca0..9d58e5134f 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; -import com.epmet.dto.TopicInfoDTO; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -73,9 +74,9 @@ public class VotingIssueListResultDTO implements Serializable { /** * 话题信息-2022.10.10 */ - private TopicInfoDTO topicInfo; + private TopicInfoComDTO topicInfo; /** * 事件信息-2022.10.10 */ - private HallIcEventDTO icEventInfo; + 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 1a1bb6ea7a..820c7b8a29 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 @@ -2,6 +2,8 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; @@ -438,7 +440,7 @@ public class IssueServiceImpl implements IssueService { vi.setLatitude(rr == null ? "" : rr.getLatitude()); // 赋值话题详情 if(null!=rr){ - TopicInfoDTO topicInfoDTO=new TopicInfoDTO(); + TopicInfoComDTO topicInfoDTO=new TopicInfoComDTO(); topicInfoDTO.setTopicId(rr.getTopicId()); topicInfoDTO.setTopicContent(rr.getTopicContent()); topicInfoDTO.setTopicImgs(rr.getTopicImgs()); @@ -459,10 +461,9 @@ public class IssueServiceImpl implements IssueService { votingIssueList.forEach(vi -> { IcEventDTO event = eventMap.get(vi.getSourceId()); if (null != event) { - HallIcEventDTO hallIcEventDTO = new HallIcEventDTO(); - hallIcEventDTO.setIcEventId(event.getId()); - hallIcEventDTO.setEventContent(event.getEventContent()); - vi.setIcEventInfo(hallIcEventDTO); + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event, IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); } }); } @@ -555,7 +556,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 查询话题详情 @@ -571,6 +572,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 -> { @@ -581,6 +599,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<>());