Browse Source

参与度调整

master
jianjun 5 years ago
parent
commit
271e734224
  1. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

@ -193,12 +193,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
List<FactIssueAgencyMonthlyEntity> issueTotal = factIssueAgencyMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());
List<GridUserCountResultDTO> userCountList = factRegUserAgencyMonthlyService.selectAgencyUserCount(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o));
Set<String> agencyIdSet = new HashSet<>();
if (!CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
issueTotal.forEach(issue -> {
String agencyId = issue.getAgencyId();
agencyIdSet.add(agencyId);
@ -212,7 +210,6 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
entity.setAvgIssue(avgIssueCount);
}
});
List<List<String>> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY);
partition.forEach(list -> {
//获取该月 表决的人数
@ -241,8 +238,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
for (IssueVoteUserCountResultDTO vote : issueList) {
Integer memberCount = orgMemberCount.get(orgId);
if (memberCount == null) {
memberCount = 0;
//memberCount = 0;
continue;
}
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0)));
}
if (votedByIssueCount.intValue() != 0) {
@ -250,9 +249,15 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
}
}
});
}
screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()));
}
public static void main(String[] args) {
BigDecimal bigDecimal = new BigDecimal(0);
bigDecimal = bigDecimal.add(new BigDecimal(0 / (1 * 1.0)));
}
private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map<String, ScreenUserJoinEntity> result) {
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM));
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class);

Loading…
Cancel
Save