|
|
@ -42,12 +42,15 @@ import com.epmet.commons.tools.utils.SendMqMsgUtils; |
|
|
|
import com.epmet.dto.form.CommonGridIdFormDTO; |
|
|
|
import com.epmet.dto.form.UserResiInfoListFormDTO; |
|
|
|
import com.epmet.dto.result.CommonDataFilterResultDTO; |
|
|
|
import com.epmet.dto.result.UserInfoResultDTO; |
|
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
|
import com.epmet.modules.comment.entity.ResiTopicCommentEntity; |
|
|
|
import com.epmet.modules.constant.ResiGroupRedisKeys; |
|
|
|
import com.epmet.modules.constant.WxmpSubscribeConstant; |
|
|
|
import com.epmet.modules.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.modules.feign.GovOrgFeignClient; |
|
|
|
import com.epmet.modules.group.dao.ResiGroupDao; |
|
|
|
import com.epmet.modules.group.entity.ResiGroupEntity; |
|
|
|
import com.epmet.modules.group.redis.ResiGroupRedis; |
|
|
|
import com.epmet.modules.member.dao.ResiGroupMemberDao; |
|
|
|
import com.epmet.modules.member.redis.ResiGroupMemberRedis; |
|
|
@ -62,6 +65,7 @@ import com.epmet.resi.group.constant.TopicConstant; |
|
|
|
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; |
|
|
|
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; |
|
|
|
import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; |
|
|
|
import com.epmet.resi.group.dto.group.ResiGroupDTO; |
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; |
|
|
|
import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; |
|
|
@ -119,6 +123,9 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen |
|
|
|
@Autowired |
|
|
|
private GovOrgFeignClient govOrgFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
ResiGroupDao resiGroupDao; |
|
|
|
|
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
private String scanApiUrl; |
|
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
@ -328,32 +335,46 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen |
|
|
|
//获取groupId
|
|
|
|
ResiTopicDTO topic = |
|
|
|
resiTopicService.get(commentFormDTO.getTopicId()); |
|
|
|
/*List<String> userIdList = new ArrayList<>(); |
|
|
|
for (ResiCommentResultDTO comment : comments) { |
|
|
|
userIdList.add(comment.getUserId()); |
|
|
|
} |
|
|
|
UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO(); |
|
|
|
formDTO.setUserIdList(userIdList); |
|
|
|
Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult = epmetUserFeignClient.getUserResiInfoList(formDTO); |
|
|
|
if (userResiInfoDTOListResult.success() && null != userResiInfoDTOListResult.getData()) { |
|
|
|
if (userResiInfoDTOListResult.getData().size() > 0) { |
|
|
|
for (UserResiInfoResultDTO resiUser : userResiInfoDTOListResult.getData()) { |
|
|
|
for (ResiCommentResultDTO comment : comments) { |
|
|
|
if (StringUtils.equals(comment.getUserId(), resiUser.getUserId())) { |
|
|
|
comment.setCommentUserHeadPhoto(resiUser.getHeadPhoto()); |
|
|
|
comment.setCommentUserName(resiUser.getShowName()); |
|
|
|
continue; |
|
|
|
/*List<String> userIdList = new ArrayList<>(); |
|
|
|
for (ResiCommentResultDTO comment : comments) { |
|
|
|
userIdList.add(comment.getUserId()); |
|
|
|
} |
|
|
|
UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO(); |
|
|
|
formDTO.setUserIdList(userIdList); |
|
|
|
Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult = epmetUserFeignClient.getUserResiInfoList(formDTO); |
|
|
|
if (userResiInfoDTOListResult.success() && null != userResiInfoDTOListResult.getData()) { |
|
|
|
if (userResiInfoDTOListResult.getData().size() > 0) { |
|
|
|
for (UserResiInfoResultDTO resiUser : userResiInfoDTOListResult.getData()) { |
|
|
|
for (ResiCommentResultDTO comment : comments) { |
|
|
|
if (StringUtils.equals(comment.getUserId(), resiUser.getUserId())) { |
|
|
|
comment.setCommentUserHeadPhoto(resiUser.getHeadPhoto()); |
|
|
|
comment.setCommentUserName(resiUser.getShowName()); |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); |
|
|
|
}*/ |
|
|
|
setCacheUserInfo(topic.getGroupId(),comments); |
|
|
|
//支部小组人员返真实姓名
|
|
|
|
ResiGroupEntity entity = resiGroupDao.selectById(topic.getGroupId()); |
|
|
|
if("".equals(entity.getGroupType())){ |
|
|
|
List<String> userIds = comments.stream().map(m -> m.getUserId()).distinct().collect(Collectors.toList()); |
|
|
|
List<UserInfoResultDTO> userInfos = resiTopicService.disPoseUserInfo(entity.getGroupType(), userIds); |
|
|
|
comments.forEach(item -> { |
|
|
|
userInfos.forEach(u->{ |
|
|
|
if(item.getUserId().equals(u.getUserId())){ |
|
|
|
item.setCommentUserName(u.getReleaseUserName()); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); |
|
|
|
}*/ |
|
|
|
setCacheUserInfo(topic.getGroupId(),comments); |
|
|
|
} |
|
|
|
return new Result<List<ResiCommentResultDTO>>().ok(comments); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new Result<List<ResiCommentResultDTO>>().ok(comments); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|