Browse Source

Merge remote-tracking branch 'origin/dev_personal_center' into dev_temp

dev_shibei_match
wangchao 5 years ago
parent
commit
29203b2641
  1. 1
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java
  2. 31
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  3. 44
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java

1
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);
});
}

31
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<ResiTopicDao, ResiTopi
//2.2从缓存中查找用户信息
setCacheUserInfoWithIssue(groupId,latestTenTopics);
}
//3.用户徽章
//3.1首先需要拿到客户Id
ResiGroupEntity group = resiGroupDao.selectById(groupId);
if(null != group && StringUtils.isNotBlank(group.getCustomerId())){
Result<Map<String, List<UserBadgeUnitFormDTO>>> 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<String, List<UserBadgeUnitFormDTO>> 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<List<ResiTopicIncludeIssueInfoResultDTO>>().ok(latestTenTopics);
}

44
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<com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO>
* @author wangc
* @date 2020.11.11 23:20
*/
@PostMapping("my-part-topics")
Result<List<ParticipatedTopicUnitResultDTO>> myPartTopics(@LoginUser TokenDto token , @RequestBody CustomerPageFormDTO param){
param.setUserId(token.getUserId());
ValidatorUtils.validateEntity(param);
return groupFeign.myPartTopics(param);
}
}
Loading…
Cancel
Save