|
@ -2,6 +2,8 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
@ -28,6 +30,7 @@ import org.springframework.util.CollectionUtils; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -499,40 +502,53 @@ public class IssueServiceImpl implements IssueService { |
|
|
@Override |
|
|
@Override |
|
|
public List<PendingResultDTO> getProcessing(ShiftProjectListFromDTO formDTO) { |
|
|
public List<PendingResultDTO> getProcessing(ShiftProjectListFromDTO formDTO) { |
|
|
//1、查询由议题转的项目,且正在处理中的
|
|
|
//1、查询由议题转的项目,且正在处理中的
|
|
|
List<PendingResultDTO> resultList = govProjectOpenFeignClient.getPendingList(formDTO).getData(); |
|
|
Result<List<PendingResultDTO>> projectRes=govProjectOpenFeignClient.getPendingList(formDTO); |
|
|
|
|
|
if(!projectRes.success()){ |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
List<PendingResultDTO> resultList =projectRes.getData(); |
|
|
if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { |
|
|
if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
|
|
|
// 话题信息
|
|
|
|
|
|
HashMap<String, ResiTopicDetailResultDTO> rtm=new HashMap<>(); |
|
|
|
|
|
// 议题信息
|
|
|
//2、根据议题id查询话题id
|
|
|
//2、根据议题id查询话题id
|
|
|
List<String> issueIds = resultList.stream().map(PendingResultDTO::getIssueId).collect(Collectors.toList()); |
|
|
List<String> issueIds = resultList.stream().map(PendingResultDTO::getIssueId).collect(Collectors.toList()); |
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(issueIds)){ |
|
|
// 根据议题id查询话题id
|
|
|
//根据议题id查询话题id
|
|
|
Result<List<IssueProfileDTO>> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); |
|
|
Result<List<IssueProfileDTO>> issueRes=govIssueOpenFeignClient.getIssueProfile(issueIds); |
|
|
|
|
|
if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { |
|
|
if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { |
|
|
// 3、如果存在议题来源于话题
|
|
|
// 3、如果存在议题来源于话题
|
|
|
List<String> topicIds = issueRes.getData().stream().filter(t->t.getSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); |
|
|
List<String> topicIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); |
|
|
if(!CollectionUtils.isEmpty(topicIds)){ |
|
|
if (!CollectionUtils.isEmpty(topicIds)) { |
|
|
//3.1 查询话题详情
|
|
|
// 3.1 查询话题详情
|
|
|
TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); |
|
|
TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); |
|
|
form.setTopicIdList(topicIds); |
|
|
form.setTopicIdList(topicIds); |
|
|
Result<List<ResiTopicDetailResultDTO>> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); |
|
|
Result<List<ResiTopicDetailResultDTO>> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); |
|
|
if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { |
|
|
if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { |
|
|
List<ResiTopicDetailResultDTO> topicDetails = topicDetailsResult.getData(); |
|
|
List<ResiTopicDetailResultDTO> topicDetails = topicDetailsResult.getData(); |
|
|
HashMap<String, ResiTopicDetailResultDTO> rtm = convertTopicDetailList2MapV2(topicDetails); |
|
|
topicDetails.stream().forEach(t -> { |
|
|
resultList.forEach(vi -> { |
|
|
if(StringUtils.isNotBlank(t.getIssueId())){ |
|
|
ResiTopicDetailResultDTO rr = rtm.get(vi.getIssueId()); |
|
|
rtm.put(t.getIssueId(), t); |
|
|
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.setTopicId(null == rr ? "" : rr.getTopicId()); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
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.getIssueId()); |
|
|
|
|
|
vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); |
|
|
|
|
|
vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); |
|
|
|
|
|
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; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|