diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java index 165bbc2c38..d9f8c8c7dc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java @@ -28,6 +28,7 @@ import com.epmet.dto.result.EvaluationListResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.VoteResultDTO; import com.epmet.dto.result.VotingTrendResultDTO; +import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueVoteStatisticalEntity; import java.util.List; @@ -153,14 +154,12 @@ public interface IssueVoteStatisticalService extends BaseService imp } try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ logger.error(e.getInternalMsg()); } @@ -1088,7 +1088,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp //6:缓存中网格下表决中的议题总数减1 govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ logger.error(e.getInternalMsg()); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 05963e6baa..8312ee3c6d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -607,36 +607,49 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl votableCount = - resiGroupFeignClient.votableCount(gridParam); - if(votableCount.success() && null != votableCount.getData()){ + if ("resi_topic".equals(issueEntity.getSourceType())) { + CommonGridIdFormDTO gridParam = new CommonGridIdFormDTO(); + gridParam.setGridId(issueEntity.getGridId()); + Result votableCount = + resiGroupFeignClient.votableCount(gridParam); + if (votableCount.success() && null != votableCount.getData()) { toUpd.setVotableCount(votableCount.getData()); - } + }else{ + //先默认赋值0吧 + toUpd.setVotableCount(NumConstant.ZERO); + } + } else { + AllResiByGridFormDTO allResiByGridFormDTO=new AllResiByGridFormDTO(); + allResiByGridFormDTO.setGridId(issueEntity.getGridId()); + Result allResiByGrid=epmetUserOpenFeignClient.getAllResiByGrid(allResiByGridFormDTO); + if(allResiByGrid.success()){ + toUpd.setVotableCount(allResiByGrid.getData()); + }else{ + //先默认赋值0吧 + toUpd.setVotableCount(NumConstant.ZERO); + } + } if(StringUtils.isNotBlank(statisticalId)){ toUpd.setId(statisticalId); update(toUpd); }else{ - IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId); + IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueEntity.getId()); if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){ toUpd.setId(existedStatistical.getId()); update(toUpd);