diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java index 7e79fce0b8..2bb7b50684 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java @@ -90,4 +90,29 @@ public class PioneerDataFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * V2升级新增字段, 详见说明文档,对应 platIssueTotal + */ + private Integer issueRatioFm; + + /** + * V2升级新增字段, 详见说明文档,对应 platTopicTotal + */ + private Integer topicRatioFm; + + /** + * V2升级新增字段, 详见说明文档,对应 platShiftProjectTotal + */ + private Integer shiftProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档,对应 platClosedProjectTotal + */ + private Integer resolvedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档,对应 platPublishIssueTotal + */ + private Integer publishIssueRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index ba3ddbce69..42e671c2b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -135,23 +135,31 @@ public interface FactOriginIssueMainDailyDao extends BaseDao { entity.setDataEndTime(dateId); String gridId = entity.getOrgId(); + //何为参与: 议题的表决行为次数总计 - //1、党员参与议事 + // 1.1党员参与议事:何为参与?议题的表决行为次数总计 entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR)); log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员参与议事issueTotal="+entity.getIssueTotal()); - //01.12新增:平台参与议事总数 + // 1.2平台参与议事总数 int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); entity.setPlatIssueTotal(issueTotal); log.info("extractGridPioneerData 当前网格id=" + gridId + ";参与议事总数issueTotal=" + issueTotal); - //2、党员参与议事占比 + // 1.3党员参与议事占比=issue_total/plat_issue_total if(entity.getIssueTotal()==0){ entity.setIssueRatio(BigDecimal.ZERO); }else{ @@ -82,17 +80,17 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } - //3、党员发布话题: + // 2.1党员发布话题 entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题topicTotal"+entity.getTopicTotal()); //当前网格内所有话题总数 int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有话题总数gridTopicTotal="+gridTopicTotal); - //01.12新增:PLAT_TOPIC_TOTAL 当前组织维度,话题总数 + // 2.2当前组织维度,话题总数,TOPIC_RATIO的分母 entity.setPlatTopicTotal(gridTopicTotal); - //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 + // 2.3党员发布话题占比 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { @@ -106,31 +104,46 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } //当前网格内所有议题总数 - int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); + int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null,StrConstant.EPMETY_STR); log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有议题总数=" + gridIssueTotal); - //01.12新增:PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度,发布议题总数 + // 3.2当前组织维度,发布议题总数,PUBLISH_ISSUE_RATIO的分母 entity.setPlatPublishIssueTotal(gridIssueTotal); - if (gridIssueTotal != NumConstant.ZERO) { - //5、党员发布议题 + //当前网格内,议题已经转为项目的总数 + int gridIssueToProjectTotal=getGridOrCommunityIssueTotal(customerId, gridId, null, IssueConstant.SHIFT_PROJECT); + // 4.2当前组织维度,已经转为项目的议题总数,SHIFT_PROJECT_RATIO的分母 + entity.setPlatShiftProjectTotal(gridIssueToProjectTotal); + + if (gridIssueTotal != NumConstant.ZERO && gridIssueToProjectTotal !=NumConstant.ZERO) { + // 3.1党员发布议题总数:话题发布人是党员 entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布议题publishIssueTotal"+entity.getPublishIssueTotal()); - //6、党员发布议题占比 : 占网格内所有议题的比率 + + // 3.3党员发布议题占比 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); }else{ BigDecimal publishIssueRatio=new BigDecimal((double)entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); entity.setPublishIssueRatio(publishIssueRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } - - //7、议题转项目数 - entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); - log.info("extractGridPioneerData 当前网格id=" + gridId +";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); - //8、议题转项目占比 : 占网格内议题总数的比率 - if(entity.getShiftProjectTotal() == NumConstant.ZERO){ + //按照贾总要求改为: + // 先锋模范的统计的是来源于居民端话题->议题-项目的。 + // 议题转项目占比(党员/用户):党员议题转项目/议题转项目数; + // 解决项目占比(党员/用户):党员已解决项目总数/已解决项目总数; + // 这个党员指的都是话题发布人是党员。 + + // 党员议题转项目数:当前网格内的项目,话题发布人是党员的; TOPIC_USER_IS_PARTY:创建话题用户身份标识。1:党员,0:非党员 + // 4.1党员议题转项目数:话题发布人党员+已经转为项目的议题总数 + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null,NumConstant.ONE_STR)); + log.info("extractGridPioneerData 当前网格id=" + gridId +";党员议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); + + //8、党员议题转项目占比 : 占网格内议题转项目总数的比率 + if(entity.getShiftProjectTotal() == NumConstant.ZERO||gridIssueToProjectTotal ==NumConstant.ZERO){ + //4.3议题转项目占比 entity.setShiftProjectRatio(BigDecimal.ZERO); }else{ - BigDecimal shiftProjectRatio = new BigDecimal((double) entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + BigDecimal shiftProjectRatio = new BigDecimal((double) entity.getShiftProjectTotal() / gridIssueToProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + //4.3议题转项目占比 entity.setShiftProjectRatio(shiftProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } @@ -143,25 +156,22 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } - // 9、已解决项目 - entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED)); + // 5.1党员解决项目总数:话题发布人是党员的议题,转为项目并且已经解决 + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED,ProjectConstant.CLOSED,NumConstant.ONE_STR)); log.info("extractGridPioneerData 当前网格id="+gridId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); - - int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); + //已解决项目总数 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED,ProjectConstant.CLOSED,StrConstant.EPMETY_STR); log.info("extractGridPioneerData 当前网格id="+gridId+";总结项目closedProjectTotal="+closedProjectTotal); - // 01.12新增:PLAT_CLOSED_PROJECT_TOTAL 当前组织维度,所有结案项目数 + + // 5.2当前组织维度,所有结案项目数,RESOLVED_PROJECT_RATIO的分母 entity.setPlatClosedProjectTotal(closedProjectTotal); - // 10、占总结项目 - if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + // 5.3解决项目总数占比 + if (entity.getResolvedProjectTotal() == NumConstant.ZERO ||closedProjectTotal == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { - if(closedProjectTotal == NumConstant.ZERO){ - entity.setResolvedProjectRatio(BigDecimal.ZERO); - }else { - BigDecimal resolvedProjectRatio = new BigDecimal((double) entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); - entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); - } + BigDecimal resolvedProjectRatio = new BigDecimal((double) entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } //01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比 entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,null)); @@ -206,60 +216,64 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService communityList.forEach(entity -> { entity.setDataEndTime(dateId); String communityId = entity.getOrgId(); - //1、党员参与议事 + // 1.1党员参与议事:何为参与?议题的表决行为次数总计 entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR)); log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员参与议事issueTotal="+entity.getIssueTotal()); - //01.12新增 + // 1.2平台参与议事总数 int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null); log.info("extractCommunityPioneerData 当前communityId="+communityId+";参与议事总数issueTotal="+issueTotal); entity.setPlatIssueTotal(issueTotal); + //1.3党员参与议事占比=issue_total/plat_issue_total if(entity.getIssueTotal()==0){ entity.setIssueRatio(BigDecimal.ZERO); }else{ - //2、党员参与议事占比 entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } - //3、党员发布话题: + //2.1党员发布话题 entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布话题topicTotal="+entity.getTopicTotal()); - //01.12新增 - //当前社区内所有话题总数 + //2.2当前组织维度,话题总数,TOPIC_RATIO的分母 int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有话题总数communityTopicTotal="+communityTopicTotal); entity.setPlatTopicTotal(communityTopicTotal); - //4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 + //2.3党员发布话题占比 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getTopicTotal() / communityTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } - //01.12新增 - //当前社区内所有议题总数 - int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); + //3.2当前组织维度,发布议题总数,PUBLISH_ISSUE_RATIO的分母 + int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId,StrConstant.EPMETY_STR); log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有议题总数communityIssueTotal="+communityIssueTotal); entity.setPlatPublishIssueTotal(communityIssueTotal); - if (communityIssueTotal != NumConstant.ZERO) { - //5、党员发布议题 + int communityIssueToProjectTotal = getGridOrCommunityIssueTotal(customerId, null, communityId,IssueConstant.SHIFT_PROJECT); + //4.2当前组织维度,已经转为项目的议题总数,SHIFT_PROJECT_RATIO的分母.0708新增此列 + entity.setPlatShiftProjectTotal(communityIssueToProjectTotal); + + if (communityIssueTotal != NumConstant.ZERO && communityIssueToProjectTotal != NumConstant.ZERO) { + //3.1党员发布议题总数:话题发布人是党员 entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布议题publishIssueTotal="+entity.getPublishIssueTotal()); - //6、党员发布议题占比 : 占社区内所有议题的比率 + + //3.3党员发布议题占比 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); } entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getPublishIssueTotal() / communityIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); - //7、议题转项目数 - entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); - log.info("extractCommunityPioneerData 当前communityId="+communityId+";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); - //8、议题转项目占比 : 占社区内议题总数的比率 - entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / communityIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + //4.1党员议题转项目数:话题发布人党员+已经转为项目的议题总数 + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId,NumConstant.ONE_STR)); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); + + //4.3议题转项目占比 + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / communityIssueToProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); }else{ log.info("extractCommunityPioneerData 当前communityId="+communityId+"communityIssueTotal =0"); entity.setPublishIssueTotal(NumConstant.ZERO); @@ -269,19 +283,20 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } - // 9、已解决项目 - entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED)); + // 5.1党员解决项目总数:话题发布人是党员的议题,转为项目并且已经解决 + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED, ProjectConstant.CLOSED, NumConstant.ONE_STR)); log.info("extractCommunityPioneerData 当前communityId="+communityId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); - //01.12新增 - int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); + // 5.2当前组织维度,所有结案项目数,RESOLVED_PROJECT_RATIO的分母 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null,ProjectConstant.CLOSED,StrConstant.EPMETY_STR); log.info("extractCommunityPioneerData 当前communityId="+communityId+";总结项目closedProjectTotal="+closedProjectTotal); entity.setPlatClosedProjectTotal(closedProjectTotal); + //5.3解决项目总数占比 if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { - // 10、占总结项目 + // 5.3解决项目总数占比 entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } @@ -314,60 +329,66 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); } log.info("extractExceptCommunityPioneerData 当前orgId="+entity.getOrgId()+";agencyPath="+entity.getAgencyPath()); - //1、党员参与议事 + //1.1党员参与议事:何为参与?议题的表决行为次数总计 entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR)); log.info("extractExceptCommunityPioneerData 党员参与议事issueTotal="+entity.getIssueTotal()); - //01.12新增 + //1.2平台参与议事总数 int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null); log.info("extractExceptCommunityPioneerData 平台参与议事issueTotal="+issueTotal); entity.setPlatIssueTotal(issueTotal); + //1.3党员参与议事占比=issue_total/plat_issue_total if(entity.getIssueTotal()==0){ entity.setIssueRatio(BigDecimal.ZERO); }else{ - //2、党员参与议事占比 entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } - //3、党员发布话题: + //2.1党员发布话题 entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); log.info("extractExceptCommunityPioneerData 党员发布话题topicTotal="+entity.getTopicTotal()); - //01.12新增 - //当前组织内所有话题总数 + //2.2当前组织维度,话题总数,TOPIC_RATIO的分母 int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); log.info("extractExceptCommunityPioneerData 当前组织内所有话题总数agencyTopicTotal="+agencyTopicTotal); entity.setPlatTopicTotal(agencyTopicTotal); - //4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率 + //2.3党员发布话题占比 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getTopicTotal() / agencyTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } - //01.12新增 - //当前组织内所有议题总数 + //3.2当前组织维度,发布议题总数,PUBLISH_ISSUE_RATIO的分母 int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal="+agencyIssueTotal); entity.setPlatPublishIssueTotal(agencyIssueTotal); - if (agencyIssueTotal != NumConstant.ZERO) { - //5、党员发布议题 + //4.2当前组织维度,已经转为项目的议题总数,SHIFT_PROJECT_RATIO的分母.0708新增此列 + int platShiftProjectTotal=getAgencyShiftProjectTotal(customerId, entity.getAgencyPath(),StrConstant.EPMETY_STR); + entity.setPlatShiftProjectTotal(platShiftProjectTotal); + + if (agencyIssueTotal != NumConstant.ZERO && platShiftProjectTotal != NumConstant.ZERO) { + //3.1党员发布议题总数:话题发布人是党员 entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath())); log.info("extractExceptCommunityPioneerData 党员发布议题publishIssueTotal="+entity.getPublishIssueTotal()); - //6、党员发布议题占比 : 占社区内所有议题的比率 + + //3.3党员发布议题占比 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); } entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getPublishIssueTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); - //7、议题转项目数 - entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath())); + //4.1党员议题转项目数:话题发布人党员+已经转为项目的议题总数 + entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); log.info("extractExceptCommunityPioneerData 议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); - //8、议题转项目占比 : 占网格内议题总数的比率 - entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //4.3议题转项目占比 + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? + BigDecimal.ZERO : + new BigDecimal((double)entity.getShiftProjectTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); }else{ log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal=0"); entity.setPublishIssueTotal(NumConstant.ZERO); @@ -377,19 +398,21 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } - // 9、已解决项目 - entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED)); + // 5.1党员解决项目总数:话题发布人是党员的议题,转为项目并且已经解决 + entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR)); log.info("extractExceptCommunityPioneerData 已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); - //01.12新增 - int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null); + //5.2当前组织维度,所有结案项目数,RESOLVED_PROJECT_RATIO的分母 + int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null,StrConstant.EPMETY_STR); log.info("extractExceptCommunityPioneerData 总结项目closedProjectTotal="+closedProjectTotal); entity.setPlatClosedProjectTotal(closedProjectTotal); + //5.3解决项目总数占比 if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + //5.3解决项目总数占比 entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { - // 10、占总结项目 + // 5.3解决项目总数占比 entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } @@ -409,13 +432,13 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } //组织下:已解决项目 or 已结案项目总数 - private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) { - return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus, ProjectConstant.CLOSED); + private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus,String isParty) { + return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus, ProjectConstant.CLOSED,isParty); } //组织下:议题转项目数 - private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { - return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath); + private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath,String topicUserIsParty) { + return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath,topicUserIsParty); } //组织内: 党员发布议题 @@ -440,10 +463,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService * @param gridId 网格id * @param communityId 社区的agencyId * @param closedStatus 结案状态:已解决 resolved,未解决 unresolved + * @param projectStatus :pending closed + * @param isParty 是否是党员 1:是 * @description 网格或者社区下: 已解决项目 **/ - private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { - return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus,ProjectConstant.CLOSED); + private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus,String projectStatus,String isParty) { + return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus,projectStatus,isParty); } /** @@ -484,10 +509,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService * @param customerId 客户id * @param gridId 网格id * @param communityId 社区的agencyId + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved * @description 网格或者社区下 :议题总数 **/ - private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { - return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); + private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId,String issueStatus) { + return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId,issueStatus); } /** @@ -495,10 +521,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService * @param customerId 客户id * @param gridId 网格id * @param communityId 社区的agencyId + * @param topicUserIsParty 创建话题用户身份标识。1:党员,0:非党员 * @description 网格或者社区下: 议题转项目数 **/ - private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { - return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); + private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId,String topicUserIsParty) { + return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId,topicUserIsParty); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 28532046fb..5bb05989fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -547,7 +547,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Override @Transactional(rollbackFor = Exception.class) public void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId) { - if (formDTO.getIsFirst()) { + if (formDTO.getIsFirst() && !CollectionUtils.isEmpty(formDTO.getDataList())) { int deleteNum; do { deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId, IndexCalConstant.DELETE_SIZE); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index d5bbf0cc29..9c42712164 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -210,6 +210,9 @@ and t1.AGENCY_ID=#{communityId} + + and t1.ISSUE_STATUS=#{issueStatus} + @@ -228,6 +231,9 @@ and t1.AGENCY_ID=#{communityId} + + and t1.TOPIC_USER_IS_PARTY = #{topicUserIsParty} + @@ -266,6 +272,9 @@ AND t1.ISSUE_STATUS = 'shift_project' AND t1.CUSTOMER_ID = #{customerId} and t1.PIDS LIKE CONCAT(#{agencyPath},'%') + + and t1.TOPIC_USER_IS_PARTY = #{topicUserIsParty} + @@ -189,6 +192,9 @@ and t1.PROJECT_STATUS=#{projectStatus} + + and t1.IS_PARTY=#{isParty} +