|
|
@ -168,21 +168,24 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public VotingTrendResultDTO votingTrend(IssueIdFormDTO issueId) { |
|
|
|
//缓存获取议题表决详情
|
|
|
|
VoteRedisFormDTO voteRedisFormDTO = issueVoteDetailRedis.get(issueId.getIssueId()); |
|
|
|
VotingTrendResultDTO votingTrendResultDTO = new VotingTrendResultDTO(); |
|
|
|
BeanUtils.copyProperties(voteRedisFormDTO, votingTrendResultDTO); |
|
|
|
votingTrendResultDTO.setRealityVoteCount(voteRedisFormDTO.getSupportAmount() + voteRedisFormDTO.getOppositionAmount()); |
|
|
|
//DB获取表决 日统计详情
|
|
|
|
List<PolyLineDTO> polyLineDTOS = issueVoteStatisticalDao.polyLineData(issueId); |
|
|
|
PolyLineDTO polyLineDTO = new PolyLineDTO(); |
|
|
|
polyLineDTO.setVoteDate(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"))); |
|
|
|
//议题 已转项目 或 已结案 的时间
|
|
|
|
String date = issueDao.operateTime(issueId.getIssueId()); |
|
|
|
//今天刚转项目或刚刚关闭,当天数据DB没有,直接从缓存拿
|
|
|
|
if (polyLineDTOS.size() == NumConstant.ZERO) { |
|
|
|
if (polyLineDTOS.size() == NumConstant.ZERO && date.equals(LocalDate.now().toString())) { |
|
|
|
polyLineDTO.setSupportIncrement(voteRedisFormDTO.getSupportAmount()); |
|
|
|
polyLineDTO.setOppositionIncrement(voteRedisFormDTO.getOppositionAmount()); |
|
|
|
polyLineDTOS.add(polyLineDTO); |
|
|
|
} else { |
|
|
|
//折线数据=DB
|
|
|
|
String date = issueDao.operateTime(issueId.getIssueId()); |
|
|
|
//折线数据=DB,今天之前转成的议题,今天 “已转项目”或“已结案”
|
|
|
|
if (date.equals(LocalDate.now().toString())) { |
|
|
|
Integer yesterdaySupport = 0; |
|
|
|
Integer yesterdayOppose = 0; |
|
|
@ -195,6 +198,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
polyLineDTOS.add(polyLineDTO); |
|
|
|
} |
|
|
|
} |
|
|
|
//今天之前 “已转项目”或“已关闭”
|
|
|
|
votingTrendResultDTO.setPolyLine(polyLineDTOS); |
|
|
|
return votingTrendResultDTO; |
|
|
|
} |
|
|
|