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