Browse Source

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

dev_shibei_match
wangchao 5 years ago
parent
commit
503d9e547e
  1. 23
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

23
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -650,10 +650,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resultDTO.setTopicImgs(attachmentUrls);
//3.拿取用户信息
//ResiTopicDTO topic = get(topicId);
ResiGroupEntity group = resiGroupDao.selectById(topicDetail.getGroupId());
//ResiGroupEntity group = resiGroupDao.selectById(topicDetail.getGroupId());
ResiGroupMemberInfoRedisDTO memberRedis =
resiGroupMemberRedis.get(group.getId(),topicDetail.getCreatedBy());
resiGroupMemberRedis.get(topicDetail.getGroupId(),topicDetail.getCreatedBy());
if(null != memberRedis && StringUtils.isNotBlank(memberRedis.getUserId())){
resultDTO.setReleaseUserName(StringUtils.isBlank(memberRedis.getUserShowName()) ? "" : memberRedis.getUserShowName());
resultDTO.setReleaseUserHeadPhoto(StringUtils.isBlank(memberRedis.getUserHeadPhoto()) ? "" : memberRedis.getUserHeadPhoto());
@ -680,7 +680,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
closeDetail.setCloseDateTime(records.get(0).getCreatedTime().getTime()/NumConstant.ONE_THOUSAND);
ResiGroupMemberInfoRedisDTO closedBy =
resiGroupMemberRedis.get(group.getId(),records.get(0).getCreatedBy());
resiGroupMemberRedis.get(topicDetail.getGroupId(),records.get(0).getCreatedBy());
if(null != closedBy){
closeDetail.setCloseUserName(closedBy.getUserShowName());
}
@ -690,8 +690,19 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//4.获取用户徽章的信息
List<String> userId = new LinkedList<>();userId.add(topicDetail.getCreatedBy());
String customerId;
ResiGroupInfoRedisDTO groupCache = resiGroupRedis.get(topicDetail.getGroupId());
if(null == groupCache || StringUtils.isBlank(groupCache.getCustomerId())){
ResiGroupEntity groupEntity = resiGroupDao.selectById(topicDetail.getGroupId());
if(null == groupEntity || StringUtils.isBlank(groupEntity.getCustomerId())){
log.error("com.epmet.modules.topic.service.impl.ResiTopicServiceImpl.getTopicDetail,获取不到组信息,话题Id:{}小组Id:{}",topicId,topicDetail.getGroupId());
throw new RenException(ModuleConstant.NO_SUCH_GROUP);
}else customerId = groupEntity.getCustomerId();
}else customerId = groupCache.getCustomerId();
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(new UserGroupFormDTO(group.getCustomerId(), userId));
= userOpenFeignClient.userShowBadge(new UserGroupFormDTO(customerId, userId));
if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){
resultDTO.setBadgeList(
CollectionUtils.isEmpty(badgeR.getData().get(topicDetail.getCreatedBy())) ?
@ -1460,7 +1471,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
new OrgInfoFormDTO(OrgInfoConstant.GRID,result.stream().map(ParticipatedTopicUnitResultDTO :: getTopicReleaseGridName).distinct().collect(Collectors.toList())));
if(gridR.success() && !CollectionUtils.isEmpty(gridR.getData())){
return result.stream().flatMap(topic -> gridR.getData().stream() .filter(grid -> StringUtils.equals(grid.getOrgId(),topic.getTopicReleaseGridName())).map(orgInfo -> {
topic.setTopicReleaseGridName(orgInfo.getOrgId());
topic.setTopicReleaseGridName(orgInfo.getOrgName());
return topic;
})).collect(Collectors.toList());
} return Collections.EMPTY_LIST;

Loading…
Cancel
Save