From 6020d198982da25a50ff7b24bfe2fc50ae72e106 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 12 Nov 2020 15:39:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=20=E5=B1=85=E6=B0=91=E6=AE=B5=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=20=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E8=BF=87=E7=9A=84=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiTopicServiceImpl.java | 1 + .../service/impl/ResiTopicServiceImpl.java | 31 ++++++++++++- .../person/controller/TopicController.java | 44 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java index 23dbd83fe9..a51eebbed6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java @@ -79,6 +79,7 @@ public class ResiTopicServiceImpl implements ResiTopicService { govTopic.setTopicRealseTime(top.getReleaseTime()); govTopic.setTopicFirstPhoto(top.getFirstPhoto()); govTopic.setTopicState(top.getStatus()); + govTopic.setBadgeList(top.getBadgeList()); topicsResult.add(govTopic); }); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index c207a9f736..a2dd0defc8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -371,7 +371,36 @@ public class ResiTopicServiceImpl extends BaseServiceImpl>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(), + latestTenTopics.stream() + .filter(top -> StringUtils.equals("other",top.getReleaseUserFlag())) + .map(ResiTopicIncludeIssueInfoResultDTO::getUserId) + .distinct().collect(Collectors.toList()))); + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ + Map> badgeM = badgeR.getData(); + latestTenTopics.forEach(top -> { + if(StringUtils.equals("other",top.getReleaseUserFlag())){ + top.setBadgeList( + CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ? + Collections.EMPTY_LIST : + badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList()) + ); + }else top.setBadgeList(Collections.EMPTY_LIST); + }); + + }else latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); + + } + + + } return new Result>().ok(latestTenTopics); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java new file mode 100644 index 0000000000..d49c9c3c52 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java @@ -0,0 +1,44 @@ +package com.epmet.modules.person.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description 个人中心-话题 + * @ClassName TopicController + * @Auth wangc + * @Date 2020-11-12 14:33 + */ +@RestController +@RequestMapping("topic") +public class TopicController { + + @Autowired + private ResiGroupOpenFeignClient groupFeign; + + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + @PostMapping("my-part-topics") + Result> myPartTopics(@LoginUser TokenDto token , @RequestBody CustomerPageFormDTO param){ + param.setUserId(token.getUserId()); + ValidatorUtils.validateEntity(param); + return groupFeign.myPartTopics(param); + } +}