|
@ -1,15 +1,19 @@ |
|
|
package com.epmet.service.evaluationindex.extract.impl; |
|
|
package com.epmet.service.evaluationindex.extract.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.dto.form.TimeListResultDTO; |
|
|
import com.epmet.commons.tools.dto.form.TimeListResultDTO; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; |
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; |
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; |
|
|
import com.epmet.dao.stats.DimAgencyDao; |
|
|
import com.epmet.dao.stats.DimAgencyDao; |
|
|
import com.epmet.dto.extract.FactOriginIssueMainDailyDTO; |
|
|
import com.epmet.dto.extract.form.IssueLogDailyFormDTO; |
|
|
import com.epmet.dto.extract.form.IssueMainDailyFormDTO; |
|
|
import com.epmet.dto.extract.form.IssueMainDailyFormDTO; |
|
|
import com.epmet.dto.extract.result.AgencyInfoResultDTO; |
|
|
import com.epmet.dto.extract.result.AgencyInfoResultDTO; |
|
|
import com.epmet.dto.extract.result.IssueInfoResultDTO; |
|
|
import com.epmet.dto.extract.result.IssueInfoResultDTO; |
|
|
|
|
|
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; |
|
|
import com.epmet.dto.extract.result.TopicInfoResultDTO; |
|
|
import com.epmet.dto.extract.result.TopicInfoResultDTO; |
|
|
import com.epmet.service.Issue.IssueService; |
|
|
import com.epmet.service.Issue.IssueService; |
|
|
import com.epmet.service.evaluationindex.extract.IssueExtractService; |
|
|
import com.epmet.service.evaluationindex.extract.IssueExtractService; |
|
@ -44,6 +48,8 @@ public class IssueExtractServiceImpl implements IssueExtractService { |
|
|
private TopicService topicService; |
|
|
private TopicService topicService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DimAgencyDao dimAgencyDao; |
|
|
private DimAgencyDao dimAgencyDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactOriginIssueLogDailyDao issueLogDailyDao; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 议题抽取 |
|
|
* @Description 议题抽取 |
|
@ -54,7 +60,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Boolean issueExtract(String customerId, String dateId) { |
|
|
public Boolean issueExtractMain(String customerId, String dateId) { |
|
|
|
|
|
|
|
|
// 议题信息查询
|
|
|
// 议题信息查询
|
|
|
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId); |
|
|
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId); |
|
@ -125,9 +131,62 @@ public class IssueExtractServiceImpl implements IssueExtractService { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
issueMainDailyDao.deleteOldRecord(customerId, dateId); |
|
|
issueMainDailyDao.deleteOldMainRecord(customerId, dateId); |
|
|
issueMainDailyDao.insertIssueMainList(result); |
|
|
issueMainDailyDao.insertIssueMainList(result); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public Boolean issueExtractLog(String customerId, String dateId) { |
|
|
|
|
|
|
|
|
|
|
|
// 查询议题process
|
|
|
|
|
|
List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId); |
|
|
|
|
|
if (CollectionUtils.isEmpty(listResult)){ |
|
|
|
|
|
throw new RenException("查询查询议题process集合为空"); |
|
|
|
|
|
} |
|
|
|
|
|
List<IssueLogDailyFormDTO> result = new ArrayList<>(); |
|
|
|
|
|
listResult.forEach(issueProcess -> { |
|
|
|
|
|
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class); |
|
|
|
|
|
issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId()); |
|
|
|
|
|
result.add(issueLogDailyFormDTO); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 动作操作人的身份标识是否是党员
|
|
|
|
|
|
List<String> userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); |
|
|
|
|
|
Map<String,Integer> map = userService.selectUserIsParty(userIds); |
|
|
|
|
|
if (null != map){ |
|
|
|
|
|
result.forEach(r -> { |
|
|
|
|
|
map.forEach((userId,isParty) -> { |
|
|
|
|
|
if (r.getOperationUserId().equals(userId)){ |
|
|
|
|
|
r.setIsParty(isParty); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 上级ID
|
|
|
|
|
|
List<String> agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); |
|
|
|
|
|
List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); |
|
|
|
|
|
if (CollectionUtils.isEmpty(agencyInfoList)){ |
|
|
|
|
|
throw new RenException("查询组织上级ID集合为空......"); |
|
|
|
|
|
} |
|
|
|
|
|
TimeListResultDTO timeList = DateUtils.getTimeList(dateId); |
|
|
|
|
|
result.forEach(r -> { |
|
|
|
|
|
r.setDateId(dateId); |
|
|
|
|
|
r.setWeekId(timeList.getWeekId()); |
|
|
|
|
|
r.setMonthId(timeList.getMonthId()); |
|
|
|
|
|
r.setQuarterId(timeList.getQuarterId()); |
|
|
|
|
|
r.setYearId(timeList.getYearId()); |
|
|
|
|
|
agencyInfoList.forEach(agency -> { |
|
|
|
|
|
if (r.getAgencyId().equals(agency.getAgencyId())){ |
|
|
|
|
|
r.setPid(agency.getPid()); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
issueLogDailyDao.deleteOldLogRecord(customerId, dateId); |
|
|
|
|
|
issueLogDailyDao.insertIssueLogList(result); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|