|
|
@ -302,7 +302,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
summaryList.stream().collect(Collectors.groupingBy(IssueAttitudeCountResultDTO::getIssueId)); |
|
|
|
for (Map.Entry<String, List<IssueAttitudeCountResultDTO>> entry : summaryMap.entrySet()) { |
|
|
|
IssueVoteStatisticalDTO obj = new IssueVoteStatisticalDTO(); |
|
|
|
obj.setCreatedBy("system"); |
|
|
|
obj.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM); |
|
|
|
obj.setIssueId(entry.getKey()); |
|
|
|
List<IssueAttitudeCountResultDTO> v = entry.getValue(); |
|
|
|
if (v.size() > NumConstant.ONE) { |
|
|
@ -338,7 +338,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); |
|
|
|
dto.setOppositionCount(NumConstant.ZERO); |
|
|
|
dto.setSupportCount(NumConstant.ZERO); |
|
|
|
dto.setCreatedBy("system"); |
|
|
|
dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM); |
|
|
|
return dto; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
@ -468,10 +468,6 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
String k = entry.getKey(); |
|
|
|
List<IssueDTO> v = entry.getValue(); |
|
|
|
for(IssueDTO issue : v){ |
|
|
|
//TODO 待删除
|
|
|
|
Integer a = issueVoteDetailService.getVotingCount(issue.getId(),IssueConstant.SUPPORT); |
|
|
|
//TODO 待删除
|
|
|
|
Integer b = issueVoteDetailService.getVotingCount(issue.getId(),IssueConstant.OPPOSE); |
|
|
|
|
|
|
|
IssueVoteStatisticalDTO vote = new IssueVoteStatisticalDTO(); |
|
|
|
vote.setIssueId(issue.getId()); |
|
|
@ -479,31 +475,22 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
if(null == cache) |
|
|
|
continue; |
|
|
|
if(StringUtils.isBlank(cache.getIssueId())) cache.setIssueId(issue.getId()); |
|
|
|
vote.setCreatedBy("system"); |
|
|
|
vote.setUpdatedBy("system"); |
|
|
|
vote.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM); |
|
|
|
vote.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); |
|
|
|
vote.setSupportCount(cache.getSupportAmount()); |
|
|
|
vote.setOppositionCount(cache.getOppositionAmount()); |
|
|
|
vote.setVotableCount( null == votableCountMap ? |
|
|
|
NumConstant.ZERO : |
|
|
|
null == votableCountMap.get(k) ? NumConstant.ZERO : votableCountMap.get(k) |
|
|
|
); |
|
|
|
//TODO 待删除
|
|
|
|
vote.setSupportCount(a); |
|
|
|
//TODO 待删除
|
|
|
|
vote.setOppositionCount(b); |
|
|
|
|
|
|
|
list.add(vote); |
|
|
|
|
|
|
|
//TODO 待删除
|
|
|
|
cache.setOppositionAmount(vote.getOppositionCount()); |
|
|
|
//TODO 待删除
|
|
|
|
cache.setSupportAmount(vote.getSupportCount()); |
|
|
|
//TODO 待恢复
|
|
|
|
//if(cache.getShouldVoteCount() != vote.getVotableCount()){
|
|
|
|
if(cache.getShouldVoteCount() != vote.getVotableCount()){ |
|
|
|
cache.setShouldVoteCount(vote.getVotableCount()); |
|
|
|
cache.setIssueId(issue.getId()); |
|
|
|
issueVoteDetailRedis.set(cache); |
|
|
|
//TODO 待恢复
|
|
|
|
//}
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|