|
@ -614,7 +614,9 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
LatestListFormDTO latestListForm = formDTO.getLatestListForm(); |
|
|
LatestListFormDTO latestListForm = formDTO.getLatestListForm(); |
|
|
latestListForm.setPageNo((latestListForm.getPageNo() - NumConstant.ONE) * latestListForm.getPageSize()); |
|
|
latestListForm.setPageNo((latestListForm.getPageNo() - NumConstant.ONE) * latestListForm.getPageSize()); |
|
|
List<IssueEntity> entityList = baseDao.selectIssueList(issueIdList, latestListForm); |
|
|
List<IssueEntity> entityList = baseDao.selectIssueList(issueIdList, latestListForm); |
|
|
|
|
|
if (null == entityList || entityList.size() < NumConstant.ONE) { |
|
|
|
|
|
throw new RenException(IssueConstant.SELECT_EXCEPTION); |
|
|
|
|
|
} |
|
|
//3:遍历封装数据
|
|
|
//3:遍历封装数据
|
|
|
entityList.forEach(issue -> { |
|
|
entityList.forEach(issue -> { |
|
|
listRelation.forEach(relation -> { |
|
|
listRelation.forEach(relation -> { |
|
@ -649,11 +651,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
return returnList; |
|
|
return returnList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//2:根据议题Id查询议题投票情况
|
|
|
//2:调用epmet-user服务,查询议题发起人基本信息
|
|
|
List<String> issueIdList = entityList.stream().map(IssueEntity::getId).collect(Collectors.toList()); |
|
|
|
|
|
List<IssueVoteStatisticalEntity> StatisticalList = issueVoteStatisticalDao.selectListByissueId(issueIdList); |
|
|
|
|
|
|
|
|
|
|
|
//3:调用epmet-user服务,查询议题发起人基本信息
|
|
|
|
|
|
List<String> userIdList = entityList.stream().map(IssueEntity::getCreatedBy).collect(Collectors.toList()); |
|
|
List<String> userIdList = entityList.stream().map(IssueEntity::getCreatedBy).collect(Collectors.toList()); |
|
|
UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); |
|
|
UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); |
|
|
userResiInfoListFormDTO.setUserIdList(userIdList); |
|
|
userResiInfoListFormDTO.setUserIdList(userIdList); |
|
@ -663,7 +661,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
} |
|
|
} |
|
|
List<UserResiInfoResultDTO> userInfoList = listResult.getData(); |
|
|
List<UserResiInfoResultDTO> userInfoList = listResult.getData(); |
|
|
|
|
|
|
|
|
//4:调用resi-group服务,批量查询话题内容
|
|
|
//3:调用resi-group服务,批量查询话题内容
|
|
|
List<String> topicIdList = entityList.stream().map(IssueEntity::getSourceId).collect(Collectors.toList()); |
|
|
List<String> topicIdList = entityList.stream().map(IssueEntity::getSourceId).collect(Collectors.toList()); |
|
|
Result<List<ResiTopicDTO>> resultTopicList = resiGroupFeignClient.getTopicList(topicIdList); |
|
|
Result<List<ResiTopicDTO>> resultTopicList = resiGroupFeignClient.getTopicList(topicIdList); |
|
|
if (!resultTopicList.success() || null == resultTopicList.getData()) { |
|
|
if (!resultTopicList.success() || null == resultTopicList.getData()) { |
|
@ -671,19 +669,15 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
} |
|
|
} |
|
|
List<ResiTopicDTO> topicList = resultTopicList.getData(); |
|
|
List<ResiTopicDTO> topicList = resultTopicList.getData(); |
|
|
|
|
|
|
|
|
//5:遍历组装对象
|
|
|
//4:遍历组装对象
|
|
|
entityList.forEach(issue -> { |
|
|
entityList.forEach(issue -> { |
|
|
LatestIssueListResultDTO resultDTO = new LatestIssueListResultDTO(); |
|
|
LatestIssueListResultDTO resultDTO = new LatestIssueListResultDTO(); |
|
|
resultDTO.setIssueId(issue.getId()); |
|
|
resultDTO.setIssueId(issue.getId()); |
|
|
resultDTO.setIssueTitle(issue.getIssueTitle()); |
|
|
resultDTO.setIssueTitle(issue.getIssueTitle()); |
|
|
StatisticalList.forEach(sta -> { |
|
|
resultDTO.setCreateIssueTime(issue.getCreatedTime().getTime()/1000); |
|
|
if (issue.getId().equals(sta.getIssueId())) { |
|
|
|
|
|
//表达态度总人数
|
|
|
|
|
|
resultDTO.setVotedCount(sta.getSupportCount() + sta.getOppositionCount()); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
userInfoList.forEach(user -> { |
|
|
userInfoList.forEach(user -> { |
|
|
if (issue.getCreatedBy().equals(user.getUserId())) { |
|
|
if (issue.getCreatedBy().equals(user.getUserId())) { |
|
|
|
|
|
resultDTO.setStaffHeadPhoto(user.getHeadPhoto()); |
|
|
//话题发起人昵称
|
|
|
//话题发起人昵称
|
|
|
resultDTO.setIssuePublisherName(user.getShowName()); |
|
|
resultDTO.setIssuePublisherName(user.getShowName()); |
|
|
} |
|
|
} |
|
|