Browse Source

先进模范数据抽取到大屏表screen_pioneer_dataV0.4社区

master
yinzuomei 5 years ago
parent
commit
044799cf0e
  1. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  3. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  5. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java
  6. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  7. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  9. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  10. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  11. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  12. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  13. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java
  14. 142
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  15. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  17. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java
  18. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  19. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  20. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  21. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  22. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml
  23. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  24. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java

@ -35,6 +35,7 @@ public class GridInfoDTO implements Serializable {
/** /**
* 所有上级组织ID,英文:隔开 * 所有上级组织ID,英文:隔开
* agencyId的pids
*/ */
private String pids; private String pids;
} }

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -135,18 +135,19 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @param gridId * @param gridId
* @return int * @return int
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格的议题总数 * @description 具体某个网格/社区下的议题总数
* @Date 2020/9/23 15:23 * @Date 2020/9/23 15:23
**/ **/
int getGridIssueTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId); int getGridOrCommunityIssueTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId);
/** /**
* @return int * @return int
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param communityId
* @author yinzuomei * @author yinzuomei
* @description 网格内议题转项目数 * @description 网格社区内议题转项目数
* @Date 2020/9/23 15:45 * @Date 2020/9/23 15:45
**/ **/
int getShiftProjectTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId); int getGridOrCommunityShiftProjectTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId);
} }

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

@ -111,10 +111,14 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.lang.Integer * @return java.lang.Integer
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param communityId
* @param closedStatus * @param closedStatus
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格内的项目 * @description 具体某个网格或者社区内的项目
* @Date 2020/9/23 18:18 * @Date 2020/9/23 18:18
**/ **/
Integer getGridClosedProjectTotal(@Param("customerId")String customerId, @Param("gridId") String gridId, @Param("closedStatus") String closedStatus); Integer getGridOrCommunityClosedProjectTotal(@Param("customerId")String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("closedStatus") String closedStatus);
} }

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

@ -88,14 +88,14 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, @Param("list") List<String> partyMemberUserIds); int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, @Param("list") List<String> partyMemberUserIds);
/** /**
* @return int
* @param customerId * @param customerId
* @param gridId * @param gridId
* @return int
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格的话题数 * @description 具体某个网格的话题数
* @Date 2020/9/23 14:23 * @Date 2020/9/23 14:23
**/ **/
int selectGridTopicTotalByGrid(@Param("customerId")String customerId, @Param("gridId")String gridId); int selectGridOrCommunityTopicTotal(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("agencyId") String agencyId);
/** /**
* @return void * @return void

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java

@ -34,6 +34,9 @@ import java.util.List;
@Mapper @Mapper
public interface ScreenPioneerDataDao extends BaseDao<ScreenPioneerDataEntity> { public interface ScreenPioneerDataDao extends BaseDao<ScreenPioneerDataEntity> {
Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId,
@Param("deleteSize") Integer deleteSize);
/** /**
* 10党建引领-先锋模范数据 * 10党建引领-先锋模范数据
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
@ -46,7 +49,8 @@ public interface ScreenPioneerDataDao extends BaseDao<ScreenPioneerDataEntity> {
Integer deletePioneerData(@Param("customerId") String customerId, Integer deletePioneerData(@Param("customerId") String customerId,
@Param("orgType") String orgType, @Param("orgType") String orgType,
@Param("dataEndTime")String dataEndTime, @Param("dataEndTime")String dataEndTime,
@Param("deleteSize") Integer deleteSize); @Param("deleteSize") Integer deleteSize,
@Param("orgIds")List<String> orgIds);
/** /**
* 10党建引领-先锋模范数据 * 10党建引领-先锋模范数据

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java

@ -76,8 +76,18 @@ public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymembe
* @param customerId * @param customerId
* @param gridId * @param gridId
* @author yinzuomei * @author yinzuomei
* @description * @description 网格内注册的党员
* @Date 2020/9/23 14:20 * @Date 2020/9/23 14:20
**/ **/
List<String> selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId); List<String> selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId);
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param communityId
* @author yinzuomei
* @description 社区内注册的党员
* @Date 2020/9/24 10:22
**/
List<String> selectCommunityPartyMemberUserIds(@Param("customerId") String customerId, @Param("communityId")String communityId);
} }

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

@ -39,23 +39,24 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
* @Date 2020/9/23 15:11 * @Date 2020/9/23 15:11
**/ **/
int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds); int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds);
/** /**
* @return int * @return java.lang.Integer
* @param customerId * @param customerId
* @param gridId * @param gridId
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格的议题总 * @description 网格内议题转项目
* @Date 2020/9/23 15:22 * @Date 2020/9/23 15:39
**/ **/
int getGridIssueTotalByGrid(String customerId, String gridId); Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId);
/** /**
* @return java.lang.Integer * @return int
* @param customerId * @param customerId
* @param gridId * @param communityId
* @author yinzuomei * @author yinzuomei
* @description 网格内议题转项目 * @description 某个网格内或者社区内议题总
* @Date 2020/9/23 15:39 * @Date 2020/9/24 10:45
**/ **/
Integer getShiftProjectTotalByGrid(String customerId, String gridId); int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId);
} }

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

@ -173,5 +173,5 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @description 具体某个网格内的项目 * @description 具体某个网格内的项目
* @Date 2020/9/23 18:17 * @Date 2020/9/23 18:17
**/ **/
Integer getGridClosedProjectTotal(String customerId, String gridId, String closedStatus); Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId,String closedStatus);
} }

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

@ -76,8 +76,9 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @param customerId * @param customerId
* @param gridId * @param gridId
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格的话题数 * @description 具体某个网格或者社区的话题数
* @Date 2020/9/23 14:22 * @Date 2020/9/23 14:22
**/ **/
int calGridTopicTotalByGrid(String customerId, String gridId); int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId);
} }

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

@ -61,26 +61,26 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
/** /**
* @param customerId * @param customerId
* @param gridId * @param gridId
* @return int * @return java.lang.Integer
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格的议题总 * @description 网格内议题转项目
* @Date 2020/9/23 15:22 * @Date 2020/9/23 15:39
**/ **/
@Override @Override
public int getGridIssueTotalByGrid(String customerId, String gridId) { public Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId) {
return baseDao.getGridIssueTotalByGrid(customerId,gridId); return baseDao.getGridOrCommunityShiftProjectTotal(customerId,gridId,communityId);
} }
/** /**
* @param customerId * @param customerId
* @param gridId * @param communityId
* @return java.lang.Integer * @return int
* @author yinzuomei * @author yinzuomei
* @description 网格内议题转项目 * @description 网格内或者社区内议题总
* @Date 2020/9/23 15:39 * @Date 2020/9/24 10:45
**/ **/
@Override @Override
public Integer getShiftProjectTotalByGrid(String customerId, String gridId) { public int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) {
return baseDao.getShiftProjectTotalByGrid(customerId,gridId); return baseDao.getGridOrCommunityIssueTotal(customerId,gridId,communityId);
} }
} }

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

@ -181,7 +181,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
* @Date 2020/9/23 18:17 * @Date 2020/9/23 18:17
**/ **/
@Override @Override
public Integer getGridClosedProjectTotal(String customerId, String gridId, String closedStatus) { public Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId, String closedStatus) {
return baseDao.getGridClosedProjectTotal(customerId,gridId,closedStatus); return baseDao.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus);
} }
} }

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

@ -296,11 +296,12 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @param gridId * @param gridId
* @return int * @return int
* @author yinzuomei * @author yinzuomei
* @description 具体某个网格的话题数 * @description 具体某个网格或者社区的话题数
* @Date 2020/9/23 14:22 * @Date 2020/9/23 14:22
**/ **/
@Override @Override
public int calGridTopicTotalByGrid(String customerId, String gridId) { public int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId) {
return baseDao.selectGridTopicTotalByGrid(customerId,gridId); return baseDao.selectGridOrCommunityTopicTotal(customerId,gridId,communityId);
} }
} }

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java

@ -26,11 +26,9 @@ public interface PioneerDataExtractService {
// 社区、街道、区县、市级别、省级 // 社区、街道、区县、市级别、省级
void extractCommunityPioneerData(String customerId, String dateId); void extractCommunityPioneerData(String customerId, String dateId);
void extractStreetPioneerData(String customerId, String dateId); void extractexceptCommunityPioneerData(String customerId, String dateId);
/*void extractStreetPioneerData(String customerId, String dateId);
void extractDistrictPioneerData(String customerId, String dateId); void extractDistrictPioneerData(String customerId, String dateId);
void extractCityPioneerData(String customerId, String dateId); void extractCityPioneerData(String customerId, String dateId);
void extractProvincePioneerData(String customerId, String dateId);*/
void extractProvincePioneerData(String customerId, String dateId);
} }

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

@ -61,7 +61,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
//网格内的党员集合 //网格内的党员集合
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, gridId); List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "grid",gridId);
//3、党员发布话题: //3、党员发布话题:
@ -71,12 +71,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setTopicRatio(BigDecimal.ZERO); entity.setTopicRatio(BigDecimal.ZERO);
} else { } else {
//当前网格内所有话题总数 //当前网格内所有话题总数
int gridTopicTotal = getGridTopicTotal(customerId, gridId); int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId,null);
entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
} }
//当前网格内所有议题总数 //当前网格内所有议题总数
int gridIssueTotal = getGridIssueTotal(customerId, gridId); int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId,null);
if (gridIssueTotal != NumConstant.ZERO) { if (gridIssueTotal != NumConstant.ZERO) {
//5、党员发布议题 //5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds)); entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds));
@ -87,36 +87,103 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数 //7、议题转项目数
entity.setShiftProjectTotal(getGridShiftProjectTotal(customerId, gridId)); entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId,null));
//8、议题转项目占比 : 占网格内议题总数的比率 //8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
} }
// 9、已解决项目 // 9、已解决项目
entity.setResolvedProjectTotal(getGridClosedProjectTotal(customerId,gridId,"resolved")); entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId,gridId,null,"resolved"));
if(entity.getResolvedProjectTotal()==NumConstant.ZERO){ if(entity.getResolvedProjectTotal()==NumConstant.ZERO){
entity.setResolvedProjectRatio(BigDecimal.ZERO); entity.setResolvedProjectRatio(BigDecimal.ZERO);
}else{ }else{
// 10、占总结项目 // 10、占总结项目
int closedProjectTotal=getGridClosedProjectTotal(customerId,gridId,null); int closedProjectTotal=getGridOrCommunityClosedProjectTotal(customerId,gridId,null,null);
entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
} }
}); });
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList); screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList);
} }
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的社区,初始数据值为0
List<ScreenPioneerDataEntity> communityList = screenPioneerDataService.initPioneerDataList(customerId, "agency", "community");
if (CollectionUtils.isEmpty(communityList)) {
return;
}
communityList.forEach(entity -> {
entity.setDataEndTime(dateId);
String communityId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//社区内的党员集合
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "community",communityId);
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds));
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前社区内所有话题总数
int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null,communityId);
entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前社区内所有议题总数
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null,communityId);
if (communityIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds));
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}
entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId,null, communityId));
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId,null,communityId,"resolved"));
if(entity.getResolvedProjectTotal()==NumConstant.ZERO){
entity.setResolvedProjectRatio(BigDecimal.ZERO);
}else{
// 10、占总结项目
int closedProjectTotal=getGridOrCommunityClosedProjectTotal(customerId,null,communityId,null);
entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", dateId, IndexCalConstant.DELETE_SIZE, communityList);
}
@Override
public void extractexceptCommunityPioneerData(String customerId, String dateId) {
//todo
}
/** /**
* @return java.lang.Integer * @return java.lang.Integer
* @param customerId * @param customerId
* @param gridId * @param gridId
* @param communityId
* @param closedStatus 结案状态已解决 resolved未解决 unresolved * @param closedStatus 结案状态已解决 resolved未解决 unresolved
* @author yinzuomei * @author yinzuomei
* @description 网格内已解决项目 * @description 网格内已解决项目
* @Date 2020/9/23 16:24 * @Date 2020/9/23 16:24
**/ **/
private Integer getGridClosedProjectTotal(String customerId, String gridId,String closedStatus) { private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId,String closedStatus) {
return factOriginProjectMainDailyService.getGridClosedProjectTotal(customerId,gridId,closedStatus); return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus);
} }
/** /**
@ -135,18 +202,6 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds); return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds);
} }
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 当前网格内发布的话题总数
* @Date 2020/9/23 14:18
**/
private int getGridTopicTotal(String customerId, String gridId) {
return factOriginTopicMainDailyService.calGridTopicTotalByGrid(customerId, gridId);
}
/** /**
* @param customerId * @param customerId
* @param partyMemberUserIds * @param partyMemberUserIds
@ -165,50 +220,55 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
/** /**
* @param customerId * @param customerId
* @param gridId * @param gridId
* @return int * @return java.lang.Integer
* @author yinzuomei * @author yinzuomei
* @description 当前网格内所有议题总 * @description 网格内议题转项目
* @Date 2020/9/23 15:21 * @Date 2020/9/23 15:38
**/ **/
private int getGridIssueTotal(String customerId, String gridId) { private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) {
return factOriginIssueMainDailyService.getGridIssueTotalByGrid(customerId, gridId); return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId);
} }
/** /**
* @return int
* @param customerId * @param customerId
* @param gridId * @param communityId
* @return java.lang.Integer
* @author yinzuomei * @author yinzuomei
* @description 网格内议题转项目数 * @description
* @Date 2020/9/23 15:38 * @Date 2020/9/24 10:44
**/ **/
private Integer getGridShiftProjectTotal(String customerId, String gridId) { private int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) {
return factOriginIssueMainDailyService.getShiftProjectTotalByGrid(customerId, gridId); return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId,communityId);
} }
/**
@Override * @param customerId
public void extractCommunityPioneerData(String customerId, String dateId) { * @param communityId
* @return int
* @author yinzuomei
* @description 当前社区内所有话题总数
* @Date 2020/9/24 10:32
**/
private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) {
return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId);
} }
@Override /*@Override
public void extractStreetPioneerData(String customerId, String dateId) { public void extractStreetPioneerData(String customerId, String dateId) {
} }
@Override @Override
public void extractDistrictPioneerData(String customerId, String dateId) { public void extractDistrictPioneerData(String customerId, String dateId) {
} }
@Override @Override
public void extractCityPioneerData(String customerId, String dateId) { public void extractCityPioneerData(String customerId, String dateId) {
} }
@Override @Override
public void extractProvincePioneerData(String customerId, String dateId) { public void extractProvincePioneerData(String customerId, String dateId) {
}*/
}
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -82,9 +83,16 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
@DataSource(DataSourceConstant.EVALUATION_INDEX) @DataSource(DataSourceConstant.EVALUATION_INDEX)
@Override @Override
public void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List<ScreenPioneerDataEntity> entityList) { public void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List<ScreenPioneerDataEntity> entityList) {
if(CollectionUtils.isEmpty(entityList)){
return;
}
List<String> orgIds=new ArrayList<>();
for(ScreenPioneerDataEntity entity:entityList){
orgIds.add(entity.getOrgId());
}
int deleteNum; int deleteNum;
do { do {
deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize); deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize,orgIds);
} while (deleteNum != NumConstant.ZERO); } while (deleteNum != NumConstant.ZERO);
List<List<ScreenPioneerDataEntity>> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); List<List<ScreenPioneerDataEntity>> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java

@ -448,7 +448,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
if (formDTO.getIsFirst()) { if (formDTO.getIsFirst()) {
int deleteNum; int deleteNum;
do { do {
deleteNum = screenPioneerDataDao.deletePioneerData(customerId,null,null, IndexCalConstant.DELETE_SIZE); deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE);
} while (deleteNum != NumConstant.ZERO); } while (deleteNum != NumConstant.ZERO);
} }
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { if (!CollectionUtils.isEmpty(formDTO.getDataList())) {

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java

@ -125,9 +125,10 @@ public interface DimCustomerPartymemberService extends BaseService<DimCustomerPa
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @param customerId * @param customerId
* @param gridId * @param gridId
* @type grid,community, agency
* @author yinzuomei * @author yinzuomei
* @description 查询在本网格注册的党员id * @description 查询在本网格注册的党员id
* @Date 2020/9/23 14:18 * @Date 2020/9/23 14:18
**/ **/
List<String> getPartyMemberUserIds(String customerId, String gridId); List<String> getPartyMemberUserIds(String customerId, String type,String gridId);
} }

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -49,6 +49,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -205,10 +206,10 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
} }
/** /**
* @param customerId * @param customerId
* @param gridId * @param orgId : 可能是gridId, 也可能是communityId, 也有可能是 pids
* @param type : grid,community, agency
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @author yinzuomei * @author yinzuomei
* @description 查询在本网格注册的党员id * @description 查询在本网格注册的党员id
@ -216,7 +217,16 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
**/ **/
@DataSource(value = DataSourceConstant.STATS) @DataSource(value = DataSourceConstant.STATS)
@Override @Override
public List<String> getPartyMemberUserIds(String customerId, String gridId) { public List<String> getPartyMemberUserIds(String customerId, String type, String orgId) {
return baseDao.selectGridPartyMemberUserIds(customerId,gridId); List<String> partyMemberUserIds = new ArrayList<>();
if ("grid".equals(type)) {
partyMemberUserIds = baseDao.selectGridPartyMemberUserIds(customerId, orgId);
} else if ("community".equals(type)) {
partyMemberUserIds = baseDao.selectCommunityPartyMemberUserIds(customerId, orgId);
} else if ("agency".equals(type)) {
//TODO
}
return partyMemberUserIds;
} }
} }

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

@ -190,8 +190,8 @@
t1.CREATE_TOPIC_USER_ID=#{userId} t1.CREATE_TOPIC_USER_ID=#{userId}
</foreach> </foreach>
</select> </select>
<!-- 具体某个网格的议题总数 --> <!-- 具体某个网格、社区下的议题总数 -->
<select id="getGridIssueTotalByGrid" parameterType="map" resultType="java.lang.Integer"> <select id="getGridOrCommunityIssueTotal" parameterType="map" resultType="java.lang.Integer">
SELECT SELECT
count( ID ) AS total count( ID ) AS total
FROM FROM
@ -199,11 +199,16 @@
WHERE WHERE
t1.DEL_FLAG = '0' t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId} AND t1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId} <if test='null != gridId and ""!=gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != communityId and ""!=communityId'>
and t1.AGENCY_ID=#{communityId}
</if>
</select> </select>
<!-- 网格内议题转项目数 --> <!-- 网格或者社区内议题转项目数 -->
<select id="getShiftProjectTotalByGrid" parameterType="map" resultType="java.lang.Integer"> <select id="getGridOrCommunityShiftProjectTotal" parameterType="map" resultType="java.lang.Integer">
SELECT SELECT
count( ID ) AS total count( ID ) AS total
FROM FROM
@ -211,7 +216,12 @@
WHERE WHERE
t1.DEL_FLAG = '0' t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId} AND t1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId} AND T1.ISSUE_STATUS='shift_project'
AND T1.ISSUE_STATUS='shift_project' <if test='null != gridId and ""!=gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != communityId and ""!=communityId'>
and t1.AGENCY_ID=#{communityId}
</if>
</select> </select>
</mapper> </mapper>

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

@ -144,8 +144,8 @@
</foreach> </foreach>
</select> </select>
<!-- 具体某个网格内的项目 --> <!-- 具体某个网格或者社区内的项目 -->
<select id="getGridClosedProjectTotal" parameterType="map" resultType="java.lang.Integer"> <select id="getGridOrCommunityClosedProjectTotal" parameterType="map" resultType="java.lang.Integer">
SELECT SELECT
COUNT( 1 ) AS TOTAL COUNT( 1 ) AS TOTAL
FROM FROM
@ -153,7 +153,12 @@
WHERE WHERE
T1.DEL_FLAG = '0' T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId} AND T1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId} <if test='null != gridId and "" != gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != communityId and "" != communityId'>
and t1.AGENCY_ID=#{communityId}
</if>
<if test='null != closedStatus and "" != closedStatus'> <if test='null != closedStatus and "" != closedStatus'>
and t1.CLOSED_STATUS=#{closedStatus} and t1.CLOSED_STATUS=#{closedStatus}
</if> </if>

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -111,8 +111,8 @@
T1.CREATE_TOPIC_USER_ID=#{userId} T1.CREATE_TOPIC_USER_ID=#{userId}
</foreach> </foreach>
</select> </select>
<!-- 具体某个网格的话题数 --> <!-- 具体某个网格、社区下的话题数 -->
<select id="selectGridTopicTotalByGrid" parameterType="map" resultType="java.lang.Integer"> <select id="selectGridOrCommunityTopicTotal" parameterType="map" resultType="java.lang.Integer">
SELECT SELECT
count(T1.ID) AS TOTAL count(T1.ID) AS TOTAL
FROM FROM
@ -120,7 +120,12 @@
WHERE WHERE
T1.DEL_FLAG = '0' T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId} AND T1.CUSTOMER_ID = #{customerId}
AND T1.GRID_ID=#{gridId} <if test='null != gridId and "" !=gridId'>
AND T1.GRID_ID=#{gridId}
</if>
<if test='null != agencyId and "" !=agencyId'>
AND T1.AGENCY_ID=#{agencyId}
</if>
</select> </select>
<update id="updateFactOriginTopicMain" parameterType="map"> <update id="updateFactOriginTopicMain" parameterType="map">

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

@ -3,6 +3,12 @@
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao"> <mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao">
<delete id="deletePioneerDataByCustomerId">
delete from screen_pioneer_data
where CUSTOMER_ID = #{customerId}
limit #{deleteSize}
</delete>
<delete id="deletePioneerData" parameterType="map"> <delete id="deletePioneerData" parameterType="map">
delete from screen_pioneer_data delete from screen_pioneer_data
where CUSTOMER_ID = #{customerId} where CUSTOMER_ID = #{customerId}
@ -12,6 +18,14 @@
<if test='null != dataEndTime and "" != dataEndTime'> <if test='null != dataEndTime and "" != dataEndTime'>
and DATA_END_TIME=#{dataEndTime} and DATA_END_TIME=#{dataEndTime}
</if> </if>
<if test='null!=orgIds and orgIds.size()>0'>
and
(
<foreach collection="orgIds" item="orgId" separator=" OR ">
ORG_ID = #{orgId}
</foreach>
)
</if>
limit #{deleteSize} limit #{deleteSize}
</delete> </delete>
@ -103,7 +117,7 @@
SELECT SELECT
sca.CUSTOMER_ID, sca.CUSTOMER_ID,
'agency' AS ORG_TYPE, 'agency' AS ORG_TYPE,
sca.AGENCY_NAME AS ORG_ID, sca.AGENCY_ID AS ORG_ID,
sca.PID AS PARENT_ID, sca.PID AS PARENT_ID,
sca.AGENCY_NAME AS ORG_NAME, sca.AGENCY_NAME AS ORG_NAME,
0 as ISSUE_TOTAL, 0 as ISSUE_TOTAL,
@ -120,7 +134,9 @@
screen_customer_agency sca screen_customer_agency sca
WHERE WHERE
sca.DEL_FLAG = '0' sca.DEL_FLAG = '0'
and sca.`LEVEL`=#{agencyLevel} <if test='null !=agencyLevel and ""!=agencyLevel'>
and sca.`LEVEL`=#{agencyLevel}
</if>
AND sca.CUSTOMER_ID = #{customerId} AND sca.CUSTOMER_ID = #{customerId}
</select> </select>

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -75,7 +75,10 @@
cg.PID as AGENCY_ID, cg.PID as AGENCY_ID,
ca.PID AS PID, ca.PID AS PID,
CG.CUSTOMER_ID, CG.CUSTOMER_ID,
cg.PIDS (case ca.PIDS WHEN CA.PIDS IS NULL THEN 0
when length(CA.PIDS) &lt;1 then 0
ELSE CA.PIDS
END ) as PIDS
FROM FROM
customer_grid cg customer_grid cg
LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID ) LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID )

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml

@ -125,4 +125,15 @@
AND dcp.CUSTOMER_ID =#{customerId} AND dcp.CUSTOMER_ID =#{customerId}
and dcp.GRID_ID=#{gridId} and dcp.GRID_ID=#{gridId}
</select> </select>
<!-- 社区内注册的党员 -->
<select id="selectCommunityPartyMemberUserIds" parameterType="map" resultType="java.lang.String">
select dcp.USER_ID
FROM
dim_customer_partymember dcp
WHERE
dcp.DEL_FLAG = '0'
AND dcp.CUSTOMER_ID =#{customerId}
and dcp.AGENCY_ID=#{communityId}
</select>
</mapper> </mapper>
Loading…
Cancel
Save