Browse Source

暂存

dev_shibei_match
yinzuomei 4 years ago
parent
commit
bd3549af23
  1. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  3. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java
  4. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  5. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  6. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  7. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  8. 137
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  9. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  10. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  11. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml

12
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<FactOriginIssueMain
/** /**
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @return int * @return int
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格/社区下的议题总数 * @description 具体某个网格/社区下的议题总数
* @Date 2020/9/23 15:23 * @Date 2020/9/23 15:23
**/ **/
int getGridOrCommunityIssueTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId); int getGridOrCommunityIssueTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("issueStatus")String issueStatus);
/** /**
* @return int * @return int
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param communityId * @param communityId
* @param topicUserIsParty 创建话题用户身份标识1:党员0:非党员
* @author yinzuomei * @author yinzuomei
* @description 网格社区内议题转项目数 * @description 网格社区内议题转项目数
* @Date 2020/9/23 15:45 * @Date 2020/9/23 15:45
**/ **/
int getGridOrCommunityShiftProjectTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId); int getGridOrCommunityShiftProjectTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("topicUserIsParty") String topicUserIsParty);
/** /**
* @return java.lang.Integer * @return java.lang.Integer

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -122,6 +122,7 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @param communityId * @param communityId
* @param closedStatus :resolved unresolved * @param closedStatus :resolved unresolved
* @param projectStatus :pending closed * @param projectStatus :pending closed
* @param isParty 是否是党员 1:
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格或者社区内的项目 * @description 具体某个网格或者社区内的项目
* @Date 2020/9/23 18:18 * @Date 2020/9/23 18:18
@ -130,7 +131,8 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
@Param("gridId") String gridId, @Param("gridId") String gridId,
@Param("communityId") String communityId, @Param("communityId") String communityId,
@Param("closedStatus") String closedStatus, @Param("closedStatus") String closedStatus,
@Param("projectStatus") String projectStatus); @Param("projectStatus") String projectStatus,
@Param("isParty")String isParty);
/** /**
* @return int * @return int

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java

@ -63,71 +63,75 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
private String orgName; private String orgName;
/** /**
* 党员参与议事 * 1.1党员参与议事何为参与议题的表决行为次数总计
*/ */
private Integer issueTotal; private Integer issueTotal;
/** /**
* 01.12新增PLAT_ISSUE_TOTAL 平台参与议事总数 * 1.2平台参与议事总数
*/ */
private Integer platIssueTotal; private Integer platIssueTotal;
/** /**
* 党员参与议事占比 * 1.3党员参与议事占比=issue_total/plat_issue_total
*/ */
private BigDecimal issueRatio; private BigDecimal issueRatio;
/** /**
* 党员发布话题 * 2.1党员发布话题
*/ */
private Integer topicTotal; private Integer topicTotal;
/** /**
* 01.12新增PLAT_TOPIC_TOTAL 当前组织维度话题总数,TOPIC_RATIO的分母 * 2.2当前组织维度话题总数,TOPIC_RATIO的分母
*/ */
private Integer platTopicTotal; private Integer platTopicTotal;
/** /**
* 党员发布话题占比 * 2.3党员发布话题占比
*/ */
private BigDecimal topicRatio; private BigDecimal topicRatio;
/** /**
* 党员发布议题 * 3.1党员发布议题总数话题发布人是党员
*/ */
private Integer publishIssueTotal; private Integer publishIssueTotal;
/** /**
* 01.12新增PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度发布议题总数PUBLISH_ISSUE_RATIO的分母SHIFT_PROJECT_RATIO的分母 * 3.2当前组织维度发布议题总数PUBLISH_ISSUE_RATIO的分母SHIFT_PROJECT_RATIO的分母
*/ */
private Integer platPublishIssueTotal; private Integer platPublishIssueTotal;
/** /**
* 党员发布议题占比 * 3.3党员发布议题占比
*/ */
private BigDecimal publishIssueRatio; private BigDecimal publishIssueRatio;
/** /**
* 议题转项目数 * 4.1党员议题转项目数话题发布人党员+已经转为项目的议题总数
*/ */
private Integer shiftProjectTotal; private Integer shiftProjectTotal;
/**
* 4.2当前组织维度已经转为项目的议题总数SHIFT_PROJECT_RATIO的分母.0708新增此列
*/
private Integer platShiftProjectTotal;
/** /**
* 议题转项目占比 * 4.3议题转项目占比
*/ */
private BigDecimal shiftProjectRatio; private BigDecimal shiftProjectRatio;
/** /**
* 解决项目总数 * 5.1党员解决项目总数话题发布人是党员的议题转为项目并且已经解决
*/ */
private Integer resolvedProjectTotal; private Integer resolvedProjectTotal;
/** /**
* 01.12新增PLAT_CLOSED_PROJECT_TOTAL 当前组织维度所有结案项目数RESOLVED_PROJECT_RATIO的分母 * 5.2当前组织维度所有结案项目数RESOLVED_PROJECT_RATIO的分母
*/ */
private Integer platClosedProjectTotal; private Integer platClosedProjectTotal;
/** /**
* 解决项目总数占比 * 5.3解决项目总数占比
*/ */
private BigDecimal resolvedProjectRatio; private BigDecimal resolvedProjectRatio;

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java

@ -46,21 +46,24 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
* @return java.lang.Integer * @return java.lang.Integer
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param communityId
* @param topicUserIsParty 创建话题用户身份标识1:党员0:非党员
* @author yinzuomei * @author yinzuomei
* @description 网格内议题转项目数 * @description 网格内议题转项目数
* @Date 2020/9/23 15:39 * @Date 2020/9/23 15:39
**/ **/
Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId); Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId,String topicUserIsParty);
/** /**
* @return int * @return int
* @param customerId * @param customerId
* @param communityId * @param communityId
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @author yinzuomei * @author yinzuomei
* @description 某个网格内或者社区内议题总数 * @description 某个网格内或者社区内议题总数
* @Date 2020/9/24 10:45 * @Date 2020/9/24 10:45
**/ **/
int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId); int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId,String issueStatus);
/** /**
* @return java.lang.Integer * @return java.lang.Integer

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -120,11 +120,12 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @param gridId * @param gridId
* @param closedStatus :resolved unresolved * @param closedStatus :resolved unresolved
* @param projectStatus :pending closed * @param projectStatus :pending closed
* @param isParty 是否是党员 1:
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格内的项目 * @description 具体某个网格内的项目
* @Date 2020/9/23 18:17 * @Date 2020/9/23 18:17
**/ **/
Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId,String closedStatus,String projectStatus); Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId,String closedStatus,String projectStatus,String isParty);
/** /**
* @return int * @return int

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java

@ -66,27 +66,30 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
/** /**
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param communityId
* @param topicUserIsParty 创建话题用户身份标识1:党员0:非党员
* @return java.lang.Integer * @return java.lang.Integer
* @author yinzuomei * @author yinzuomei
* @description 网格内议题转项目数 * @description 网格内议题转项目数
* @Date 2020/9/23 15:39 * @Date 2020/9/23 15:39
**/ **/
@Override @Override
public Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId) { public Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId,String topicUserIsParty) {
return baseDao.getGridOrCommunityShiftProjectTotal(customerId,gridId,communityId); return baseDao.getGridOrCommunityShiftProjectTotal(customerId,gridId,communityId,topicUserIsParty);
} }
/** /**
* @param customerId * @param customerId
* @param communityId * @param communityId
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @return int * @return int
* @author yinzuomei * @author yinzuomei
* @description 网格内或者社区内议题总数 * @description 网格内或者社区内议题总数
* @Date 2020/9/24 10:45 * @Date 2020/9/24 10:45
**/ **/
@Override @Override
public int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) { public int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId,String issueStatus) {
return baseDao.getGridOrCommunityIssueTotal(customerId,gridId,communityId); return baseDao.getGridOrCommunityIssueTotal(customerId,gridId,communityId,issueStatus);
} }
/** /**

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -151,14 +151,15 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
* @param gridId * @param gridId
* @param closedStatus :resolved unresolved * @param closedStatus :resolved unresolved
* @param projectStatus :pending closed * @param projectStatus :pending closed
* @param isParty 是否是党员 1:
* @return java.lang.Integer * @return java.lang.Integer
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格内的项目 * @description 具体某个网格内的项目
* @Date 2020/9/23 18:17 * @Date 2020/9/23 18:17
**/ **/
@Override @Override
public Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId, String closedStatus,String projectStatus) { public Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId, String closedStatus,String projectStatus,String isParty) {
return baseDao.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus,projectStatus); return baseDao.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus,projectStatus,isParty);
} }
/** /**

137
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java

@ -2,10 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DimObjectStatusConstant; import com.epmet.constant.*;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
@ -63,17 +60,18 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
gridList.forEach(entity -> { gridList.forEach(entity -> {
entity.setDataEndTime(dateId); entity.setDataEndTime(dateId);
String gridId = entity.getOrgId(); String gridId = entity.getOrgId();
//何为参与: 议题的表决行为次数总计 //何为参与: 议题的表决行为次数总计
//1、党员参与议事 // 1.1党员参与议事:何为参与?议题的表决行为次数总计
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR)); entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员参与议事issueTotal="+entity.getIssueTotal()); log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员参与议事issueTotal="+entity.getIssueTotal());
//01.12新增:平台参与议事总数 // 1.2平台参与议事总数
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null);
entity.setPlatIssueTotal(issueTotal); entity.setPlatIssueTotal(issueTotal);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";参与议事总数issueTotal=" + issueTotal); log.info("extractGridPioneerData 当前网格id=" + gridId + ";参与议事总数issueTotal=" + issueTotal);
//2、党员参与议事占比 // 1.3党员参与议事占比=issue_total/plat_issue_total
if(entity.getIssueTotal()==0){ if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO); entity.setIssueRatio(BigDecimal.ZERO);
}else{ }else{
@ -82,17 +80,17 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP)); entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP));
} }
//3、党员发布话题: // 2.1党员发布话题
entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); entity.setTopicTotal(getTopicTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题topicTotal"+entity.getTopicTotal()); log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题topicTotal"+entity.getTopicTotal());
//当前网格内所有话题总数 //当前网格内所有话题总数
int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有话题总数gridTopicTotal="+gridTopicTotal); log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有话题总数gridTopicTotal="+gridTopicTotal);
//01.12新增:PLAT_TOPIC_TOTAL 当前组织维度,话题总数 // 2.2当前组织维度,话题总数,TOPIC_RATIO的分母
entity.setPlatTopicTotal(gridTopicTotal); entity.setPlatTopicTotal(gridTopicTotal);
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 // 2.3党员发布话题占比
if (entity.getTopicTotal() == NumConstant.ZERO) { if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO); entity.setTopicRatio(BigDecimal.ZERO);
} else { } 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); log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有议题总数=" + gridIssueTotal);
//01.12新增:PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度,发布议题总数 // 3.2当前组织维度,发布议题总数,PUBLISH_ISSUE_RATIO的分母,SHIFT_PROJECT_RATIO的分母
entity.setPlatPublishIssueTotal(gridIssueTotal); entity.setPlatPublishIssueTotal(gridIssueTotal);
//当前网格内,议题已经转为项目的总数
int gridIssueToProjectTotal=getGridOrCommunityIssueTotal(customerId, gridId, null, IssueConstant.SHIFT_PROJECT);
// 4.2当前组织维度,已经转为项目的议题总数,SHIFT_PROJECT_RATIO的分母
entity.setPlatShiftProjectTotal(gridIssueToProjectTotal);
if (gridIssueTotal != NumConstant.ZERO) { if (gridIssueTotal != NumConstant.ZERO) {
//5、党员发布议题 // 3.1党员发布议题总数:话题发布人是党员
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布议题publishIssueTotal"+entity.getPublishIssueTotal()); log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布议题publishIssueTotal"+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占网格内所有议题的比率
// 3.3党员发布议题占比
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO); entity.setPublishIssueRatio(BigDecimal.ZERO);
}else{ }else{
BigDecimal publishIssueRatio=new BigDecimal((double)entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); BigDecimal publishIssueRatio=new BigDecimal((double)entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setPublishIssueRatio(publishIssueRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); 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); entity.setShiftProjectRatio(BigDecimal.ZERO);
}else{ }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)); entity.setShiftProjectRatio(shiftProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
} }
@ -143,25 +156,22 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
} }
// 9、已解决项目 // 5.1党员解决项目总数:话题发布人是党员的议题,转为项目并且已经解决
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED)); entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED,ProjectConstant.CLOSED,NumConstant.ONE_STR));
log.info("extractGridPioneerData 当前网格id="+gridId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); 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); log.info("extractGridPioneerData 当前网格id="+gridId+";总结项目closedProjectTotal="+closedProjectTotal);
// 01.12新增:PLAT_CLOSED_PROJECT_TOTAL 当前组织维度,所有结案项目数
// 5.2当前组织维度,所有结案项目数,RESOLVED_PROJECT_RATIO的分母
entity.setPlatClosedProjectTotal(closedProjectTotal); entity.setPlatClosedProjectTotal(closedProjectTotal);
// 10、占总结项目 // 5.3解决项目总数占比
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { if (entity.getResolvedProjectTotal() == NumConstant.ZERO ||closedProjectTotal == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO); entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else { } else {
if(closedProjectTotal == NumConstant.ZERO){ BigDecimal resolvedProjectRatio = new BigDecimal((double) entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setResolvedProjectRatio(BigDecimal.ZERO); entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else {
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: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比 //01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比
entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,null)); entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,null));
@ -206,60 +216,62 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
communityList.forEach(entity -> { communityList.forEach(entity -> {
entity.setDataEndTime(dateId); entity.setDataEndTime(dateId);
String communityId = entity.getOrgId(); String communityId = entity.getOrgId();
//1、党员参与议事 // 1.1党员参与议事:何为参与?议题的表决行为次数总计
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR)); entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员参与议事issueTotal="+entity.getIssueTotal()); log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员参与议事issueTotal="+entity.getIssueTotal());
//01.12新增 // 1.2平台参与议事总数
int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null); int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";参与议事总数issueTotal="+issueTotal); log.info("extractCommunityPioneerData 当前communityId="+communityId+";参与议事总数issueTotal="+issueTotal);
entity.setPlatIssueTotal(issueTotal); entity.setPlatIssueTotal(issueTotal);
//1.3党员参与议事占比=issue_total/plat_issue_total
if(entity.getIssueTotal()==0){ if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO); entity.setIssueRatio(BigDecimal.ZERO);
}else{ }else{
//2、党员参与议事占比
entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); 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)); entity.setTopicTotal(getTopicTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布话题topicTotal="+entity.getTopicTotal()); log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布话题topicTotal="+entity.getTopicTotal());
//01.12新增 //2.2当前组织维度,话题总数,TOPIC_RATIO的分母
//当前社区内所有话题总数
int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有话题总数communityTopicTotal="+communityTopicTotal); log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有话题总数communityTopicTotal="+communityTopicTotal);
entity.setPlatTopicTotal(communityTopicTotal); entity.setPlatTopicTotal(communityTopicTotal);
//4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 //2.3党员发布话题占比
if (entity.getTopicTotal() == NumConstant.ZERO) { if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO); entity.setTopicRatio(BigDecimal.ZERO);
} else { } 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)); 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新增 //3.2当前组织维度,发布议题总数,PUBLISH_ISSUE_RATIO的分母,SHIFT_PROJECT_RATIO的分母
//当前社区内所有议题总数 int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId,StrConstant.EPMETY_STR);
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有议题总数communityIssueTotal="+communityIssueTotal); log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有议题总数communityIssueTotal="+communityIssueTotal);
entity.setPlatPublishIssueTotal(communityIssueTotal); entity.setPlatPublishIssueTotal(communityIssueTotal);
int communityIssueToProjectTotal = getGridOrCommunityIssueTotal(customerId, null, communityId,IssueConstant.SHIFT_PROJECT);
if (communityIssueTotal != NumConstant.ZERO) { if (communityIssueTotal != NumConstant.ZERO) {
//5、党员发布议题 //3.1党员发布议题总数:话题发布人是党员
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布议题publishIssueTotal="+entity.getPublishIssueTotal()); log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布议题publishIssueTotal="+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占社区内所有议题的比率
//3.3党员发布议题占比
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.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)); 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、议题转项目数 //4.1党员议题转项目数:话题发布人党员+已经转为项目的议题总数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId,NumConstant.ONE_STR));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); 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)); //8、议题转项目占比 : 占社区内议题转项目总数的比率
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{ }else{
log.info("extractCommunityPioneerData 当前communityId="+communityId+"communityIssueTotal =0"); log.info("extractCommunityPioneerData 当前communityId="+communityId+"communityIssueTotal =0");
entity.setPublishIssueTotal(NumConstant.ZERO); entity.setPublishIssueTotal(NumConstant.ZERO);
@ -269,12 +281,13 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
} }
// 9、已解决项目 // 9、党员已解决项目总数
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED)); entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED, ProjectConstant.CLOSED, NumConstant.ONE_STR));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); log.info("extractCommunityPioneerData 当前communityId="+communityId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
//01.12新增 //01.12新增
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); //已解决项目总数
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null,ProjectConstant.CLOSED,StrConstant.EPMETY_STR);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";总结项目closedProjectTotal="+closedProjectTotal); log.info("extractCommunityPioneerData 当前communityId="+communityId+";总结项目closedProjectTotal="+closedProjectTotal);
entity.setPlatClosedProjectTotal(closedProjectTotal); entity.setPlatClosedProjectTotal(closedProjectTotal);
@ -440,10 +453,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
* @param gridId 网格id * @param gridId 网格id
* @param communityId 社区的agencyId * @param communityId 社区的agencyId
* @param closedStatus 结案状态已解决 resolved未解决 unresolved * @param closedStatus 结案状态已解决 resolved未解决 unresolved
* @param projectStatus :pending closed
* @param isParty 是否是党员 1:
* @description 网格或者社区下: 已解决项目 * @description 网格或者社区下: 已解决项目
**/ **/
private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus,String projectStatus,String isParty) {
return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus,ProjectConstant.CLOSED); return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus,projectStatus,isParty);
} }
/** /**
@ -484,10 +499,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
* @param customerId 客户id * @param customerId 客户id
* @param gridId 网格id * @param gridId 网格id
* @param communityId 社区的agencyId * @param communityId 社区的agencyId
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @description 网格或者社区下 议题总数 * @description 网格或者社区下 议题总数
**/ **/
private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId,String issueStatus) {
return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId,issueStatus);
} }
/** /**
@ -495,10 +511,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
* @param customerId 客户id * @param customerId 客户id
* @param gridId 网格id * @param gridId 网格id
* @param communityId 社区的agencyId * @param communityId 社区的agencyId
* @param topicUserIsParty 创建话题用户身份标识1:党员0:非党员
* @description 网格或者社区下: 议题转项目数 * @description 网格或者社区下: 议题转项目数
**/ **/
private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId,String topicUserIsParty) {
return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId,topicUserIsParty);
} }
} }

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -210,6 +210,9 @@
<if test='null != communityId and ""!=communityId'> <if test='null != communityId and ""!=communityId'>
and t1.AGENCY_ID=#{communityId} and t1.AGENCY_ID=#{communityId}
</if> </if>
<if test='null != issueStatus and ""!=issueStatus'>
and t1.ISSUE_STATUS=#{issueStatus}
</if>
</select> </select>
<!-- 网格或者社区内议题转项目数 --> <!-- 网格或者社区内议题转项目数 -->
@ -228,6 +231,9 @@
<if test='null != communityId and ""!=communityId'> <if test='null != communityId and ""!=communityId'>
and t1.AGENCY_ID=#{communityId} and t1.AGENCY_ID=#{communityId}
</if> </if>
<if test='null != topicUserIsParty and ""!=topicUserIsParty'>
and t1.TOPIC_USER_IS_PARTY = #{topicUserIsParty}
</if>
</select> </select>
<!-- 组织内: 党员发布议题 --> <!-- 组织内: 党员发布议题 -->

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -171,6 +171,9 @@
<if test='null != projectStatus and "" != projectStatus'> <if test='null != projectStatus and "" != projectStatus'>
and t1.PROJECT_STATUS=#{projectStatus} and t1.PROJECT_STATUS=#{projectStatus}
</if> </if>
<if test='null != isParty and "" != isParty'>
and t1.IS_PARTY=#{isParty}
</if>
</select> </select>
<!-- 组织下:已解决项目 or 已结案项目总数 --> <!-- 组织下:已解决项目 or 已结案项目总数 -->

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml

@ -195,7 +195,8 @@
PLAT_JOIN_PARTY_RATIO, PLAT_JOIN_PARTY_RATIO,
PLAT_TOPIC_TOTAL, PLAT_TOPIC_TOTAL,
PLAT_PUBLISH_ISSUE_TOTAL, PLAT_PUBLISH_ISSUE_TOTAL,
PLAT_CLOSED_PROJECT_TOTAL PLAT_CLOSED_PROJECT_TOTAL,
PLAT_SHIFT_PROJECT_TOTAL
) values ) values
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
( (
@ -228,7 +229,8 @@
#{item.platJoinPartyRatio}, #{item.platJoinPartyRatio},
#{item.platTopicTotal}, #{item.platTopicTotal},
#{item.platPublishIssueTotal}, #{item.platPublishIssueTotal},
#{item.platClosedProjectTotal} #{item.platClosedProjectTotal},
#{item.platShiftProjectTotal}
) )
</foreach> </foreach>
</insert> </insert>

Loading…
Cancel
Save