|
|
@ -43,6 +43,7 @@ import com.epmet.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.feign.ResiGroupFeignClient; |
|
|
|
import com.epmet.redis.IssueVoteDetailRedis; |
|
|
|
import com.epmet.redis.IssueVoteStatisticalRedis; |
|
|
|
import com.epmet.service.IssueVoteDetailService; |
|
|
|
import com.epmet.service.IssueVoteStatisticalService; |
|
|
|
import com.epmet.utils.ModuleConstants; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -83,6 +84,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
private IssueVoteDetailDao issueVoteDetailDao; |
|
|
|
@Autowired |
|
|
|
private ResiGroupFeignClient resiGroupFeignClient; |
|
|
|
@Autowired |
|
|
|
private IssueVoteDetailService issueVoteDetailService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IssueVoteStatisticalDTO> page(Map<String, Object> params) { |
|
|
@ -477,9 +480,14 @@ 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()); |
|
|
|
VoteRedisFormDTO cache = issueVoteDetailRedis.get(issue.getId()); |
|
|
|
VoteRedisFormDTO cache = issueVoteDetailRedis.getVoteStatistical(issue.getId()); |
|
|
|
if(null == cache) |
|
|
|
continue; |
|
|
|
if(StringUtils.isBlank(cache.getIssueId())) cache.setIssueId(issue.getId()); |
|
|
@ -491,10 +499,23 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt |
|
|
|
NumConstant.ZERO : |
|
|
|
null == votableCountMap.get(k) ? NumConstant.ZERO : votableCountMap.get(k) |
|
|
|
); |
|
|
|
//TODO 待删除
|
|
|
|
vote.setSupportCount(a); |
|
|
|
//TODO 待删除
|
|
|
|
vote.setOppositionCount(b); |
|
|
|
list.add(vote); |
|
|
|
if(cache.getShouldVoteCount() != vote.getVotableCount()){ |
|
|
|
|
|
|
|
//TODO 待删除
|
|
|
|
cache.setOppositionAmount(vote.getOppositionCount()); |
|
|
|
//TODO 待删除
|
|
|
|
cache.setSupportAmount(vote.getSupportCount()); |
|
|
|
//TODO 待恢复
|
|
|
|
//if(cache.getShouldVoteCount() != vote.getVotableCount()){
|
|
|
|
cache.setShouldVoteCount(vote.getVotableCount()); |
|
|
|
cache.setIssueId(issue.getId()); |
|
|
|
issueVoteDetailRedis.set(cache); |
|
|
|
} |
|
|
|
//TODO 待恢复
|
|
|
|
//}
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|