|
|
@ -563,30 +563,56 @@ public class IssueServiceImpl implements IssueService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ResolvedResultDTO> getClosedProjectList(ShiftProjectListFromDTO formDTO) { |
|
|
|
List<ResolvedResultDTO> resultList = govProjectOpenFeignClient.getResolvedList(formDTO).getData(); |
|
|
|
//查询项目(来源于议题的)已结案已解决的
|
|
|
|
Result<List<ResolvedResultDTO>> projectRes=govProjectOpenFeignClient.getResolvedList(formDTO); |
|
|
|
if(!projectRes.success()){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
} |
|
|
|
List<ResolvedResultDTO> resultList = projectRes.getData(); |
|
|
|
if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
List<String> topicIds = resultList.stream().map(ResolvedResultDTO::getSourceId).collect(Collectors.toList()); |
|
|
|
// 话题信息
|
|
|
|
HashMap<String, ResiTopicDetailResultDTO> rtm=new HashMap<>(); |
|
|
|
// 议题信息
|
|
|
|
//2、根据议题id查询话题id
|
|
|
|
List<String> issueIds = resultList.stream().map(ResolvedResultDTO::getIssueId).collect(Collectors.toList()); |
|
|
|
// 根据议题id查询话题id
|
|
|
|
Result<List<IssueProfileDTO>> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); |
|
|
|
|
|
|
|
if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { |
|
|
|
// 3、如果存在议题来源于话题
|
|
|
|
List<String> topicIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); |
|
|
|
if (!CollectionUtils.isEmpty(topicIds)) { |
|
|
|
// 3.1 查询话题详情
|
|
|
|
TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); |
|
|
|
form.setTopicIdList(topicIds); |
|
|
|
Result<List<ResiTopicDetailResultDTO>> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); |
|
|
|
if (!topicDetailsResult.success()) { |
|
|
|
logger.error("调用resi-group批量查询详情失败"); |
|
|
|
} else { |
|
|
|
if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { |
|
|
|
List<ResiTopicDetailResultDTO> topicDetails = topicDetailsResult.getData(); |
|
|
|
HashMap<String, ResiTopicDetailResultDTO> rtm = convertTopicDetailList2Map(topicDetails); |
|
|
|
topicDetails.stream().forEach(t -> { |
|
|
|
if(StringUtils.isNotBlank(t.getIssueId())){ |
|
|
|
rtm.put(t.getIssueId(), t); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String,IssueProfileDTO> issueMap=issueRes.getData().stream().collect(Collectors.toMap(IssueProfileDTO::getIssueId, o -> o, (o1, o2) -> o1)); |
|
|
|
// 赋值话题信息、议题来源、议题图片
|
|
|
|
resultList.forEach(vi -> { |
|
|
|
ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); |
|
|
|
ResiTopicDetailResultDTO rr = rtm.get(vi.getIssueId()); |
|
|
|
vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); |
|
|
|
vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); |
|
|
|
vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); |
|
|
|
vi.setLongitude(rr == null ? "" : rr.getLongitude()); |
|
|
|
vi.setLatitude(rr == null ? "" : rr.getLatitude()); |
|
|
|
vi.setTopicContent(rr == null ? StrConstant.EPMETY_STR : rr.getTopicContent()); |
|
|
|
vi.setLongitude(rr == null ? StrConstant.EPMETY_STR : rr.getLongitude()); |
|
|
|
vi.setLatitude(rr == null ? StrConstant.EPMETY_STR : rr.getLatitude()); |
|
|
|
vi.setTopicId(null == rr ? StrConstant.EPMETY_STR : rr.getTopicId()); |
|
|
|
IssueProfileDTO issue = issueMap.get(vi.getIssueId()); |
|
|
|
vi.setIssueSourceType(null != issue ? issue.getIssueSourceType() : StrConstant.EPMETY_STR); |
|
|
|
vi.setIssueImgs(null != issue ? issue.getIssueImgs() : new ArrayList<>()); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|