Browse Source

项目抽取效率改进

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
7a88c5ac39
  1. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -127,17 +127,30 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
//获取项目信息
List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString, projectId);
factOriginProjectMainDailyService.deleteByDate(customerId, dateString,projectId);
List<IssueDTO> issueList = new ArrayList<>();
List<ResiTopicDTO> topicList = new ArrayList<>();
if (!CollectionUtils.isEmpty(projectList)) {
Map<String, ResiEventDTO> projectEventMap = projectService.getEventList(customerId);
//提取议题ID
List<String> issueIds =
projectList.stream().filter(item -> ProjectConstant.ISSUE.equals(item.getOrigin())).map(ProjectDTO::getOriginId).collect(Collectors.toList());
//获取议题信息
List<IssueDTO> issueList = issueService.getIssueInfoByIds(issueIds);
//提取话题ID
List<String> topicIds = issueList.stream().map(IssueDTO::getSourceId).collect(Collectors.toList());
//获取话题信息
List<ResiTopicDTO> topicList = topicService.getTopicByIds(topicIds);
if(CollectionUtils.isNotEmpty(issueIds)) {
//批次数量
int batchCount = 200;
//获取议题信息
for (int i = 0; i < issueIds.size(); i += batchCount) {
int lastIndex = Math.min(i + batchCount, issueIds.size());
issueList.addAll(issueService.getIssueInfoByIds(issueIds.subList(i, lastIndex)));
}
//提取话题ID
List<String> topicIds = issueList.stream().map(IssueDTO::getSourceId).collect(Collectors.toList());
//获取话题信息
for (int i = 0; i < topicIds.size(); i += batchCount) {
int lastIndex = Math.min(i + batchCount, topicIds.size());
topicList.addAll(topicService.getTopicByIds(topicIds.subList(i, lastIndex)));
}
}
//获取网格认证党员
List<PartyMemberDTO> partyMemberList = partyMemberService.getPartyMemberByCustomer(customerId);
//生成DTO

Loading…
Cancel
Save