|
@ -9,7 +9,6 @@ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDai |
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; |
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; |
|
|
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; |
|
|
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; |
|
|
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; |
|
|
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; |
|
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
import org.springframework.util.CollectionUtils; |
|
@ -33,8 +32,6 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DimCustomerPartymemberService dimCustomerPartymemberService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactOriginIssueMainDailyService factOriginIssueMainDailyService; |
|
|
private FactOriginIssueMainDailyService factOriginIssueMainDailyService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
@ -63,12 +60,8 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
entity.setIssueRatio(BigDecimal.ZERO); |
|
|
entity.setIssueRatio(BigDecimal.ZERO); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//网格内的党员集合
|
|
|
|
|
|
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "grid", gridId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3、党员发布话题:
|
|
|
//3、党员发布话题:
|
|
|
entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds, gridId, null)); |
|
|
entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); |
|
|
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
|
|
|
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
|
|
|
if (entity.getTopicTotal() == NumConstant.ZERO) { |
|
|
if (entity.getTopicTotal() == NumConstant.ZERO) { |
|
|
entity.setTopicRatio(BigDecimal.ZERO); |
|
|
entity.setTopicRatio(BigDecimal.ZERO); |
|
@ -82,7 +75,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); |
|
|
int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); |
|
|
if (gridIssueTotal != NumConstant.ZERO) { |
|
|
if (gridIssueTotal != NumConstant.ZERO) { |
|
|
//5、党员发布议题
|
|
|
//5、党员发布议题
|
|
|
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds, gridId, null)); |
|
|
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); |
|
|
//6、党员发布议题占比 : 占网格内所有议题的比率
|
|
|
//6、党员发布议题占比 : 占网格内所有议题的比率
|
|
|
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { |
|
|
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { |
|
|
entity.setPublishIssueRatio(BigDecimal.ZERO); |
|
|
entity.setPublishIssueRatio(BigDecimal.ZERO); |
|
@ -124,12 +117,9 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
//2、党员参与议事占比 todo
|
|
|
//2、党员参与议事占比 todo
|
|
|
entity.setIssueRatio(BigDecimal.ZERO); |
|
|
entity.setIssueRatio(BigDecimal.ZERO); |
|
|
|
|
|
|
|
|
//社区内的党员集合
|
|
|
|
|
|
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "community", communityId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3、党员发布话题:
|
|
|
//3、党员发布话题:
|
|
|
entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds, null, communityId)); |
|
|
entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); |
|
|
//4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率
|
|
|
//4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率
|
|
|
if (entity.getTopicTotal() == NumConstant.ZERO) { |
|
|
if (entity.getTopicTotal() == NumConstant.ZERO) { |
|
|
entity.setTopicRatio(BigDecimal.ZERO); |
|
|
entity.setTopicRatio(BigDecimal.ZERO); |
|
@ -143,7 +133,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); |
|
|
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); |
|
|
if (communityIssueTotal != NumConstant.ZERO) { |
|
|
if (communityIssueTotal != NumConstant.ZERO) { |
|
|
//5、党员发布议题
|
|
|
//5、党员发布议题
|
|
|
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds, null, communityId)); |
|
|
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); |
|
|
//6、党员发布议题占比 : 占社区内所有议题的比率
|
|
|
//6、党员发布议题占比 : 占社区内所有议题的比率
|
|
|
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { |
|
|
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { |
|
|
entity.setPublishIssueRatio(BigDecimal.ZERO); |
|
|
entity.setPublishIssueRatio(BigDecimal.ZERO); |
|
@ -173,7 +163,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void extractExceptCommunityPioneerData(String customerId, String dateId) { |
|
|
public void extractExceptCommunityPioneerData(String customerId, String dateId) { |
|
|
//查询客户下所有的社区,初始数据值为0
|
|
|
//查询客户下所有的组织(社区除外),初始数据值为0
|
|
|
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency"); |
|
|
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency"); |
|
|
if (CollectionUtils.isEmpty(agencyList)) { |
|
|
if (CollectionUtils.isEmpty(agencyList)) { |
|
|
return; |
|
|
return; |
|
@ -190,18 +180,16 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
} else { |
|
|
} else { |
|
|
entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); |
|
|
entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); |
|
|
} |
|
|
} |
|
|
//组织内党员集合
|
|
|
|
|
|
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "agency", entity.getAgencyPath()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3、党员发布话题:
|
|
|
//3、党员发布话题:
|
|
|
entity.setTopicTotal(getAgencyPartyTopicTotal(customerId, partyMemberUserIds, entity.getAgencyPath())); |
|
|
entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); |
|
|
//4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率
|
|
|
//4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率
|
|
|
if (entity.getTopicTotal() == NumConstant.ZERO) { |
|
|
if (entity.getTopicTotal() == NumConstant.ZERO) { |
|
|
entity.setTopicRatio(BigDecimal.ZERO); |
|
|
entity.setTopicRatio(BigDecimal.ZERO); |
|
|
} else { |
|
|
} else { |
|
|
//当前组织内所有话题总数
|
|
|
//当前组织内所有话题总数
|
|
|
int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath()); |
|
|
int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); |
|
|
entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -209,7 +197,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); |
|
|
int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); |
|
|
if (agencyIssueTotal != NumConstant.ZERO) { |
|
|
if (agencyIssueTotal != NumConstant.ZERO) { |
|
|
//5、党员发布议题
|
|
|
//5、党员发布议题
|
|
|
entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, partyMemberUserIds, entity.getAgencyPath())); |
|
|
entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath())); |
|
|
//6、党员发布议题占比 : 占社区内所有议题的比率
|
|
|
//6、党员发布议题占比 : 占社区内所有议题的比率
|
|
|
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { |
|
|
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { |
|
|
entity.setPublishIssueRatio(BigDecimal.ZERO); |
|
|
entity.setPublishIssueRatio(BigDecimal.ZERO); |
|
@ -237,117 +225,97 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String resolved) { |
|
|
//组织下:已解决项目 or 已结案项目总数
|
|
|
//todo
|
|
|
private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) { |
|
|
return 0; |
|
|
return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//组织下:议题转项目数
|
|
|
private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { |
|
|
private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { |
|
|
//todo
|
|
|
return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath); |
|
|
return 0; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private Integer getAgencyParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds, String agencyPath) { |
|
|
//组织内: 党员发布议题
|
|
|
//todo
|
|
|
private Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) { |
|
|
return 0; |
|
|
return factOriginIssueMainDailyService.getAgencyParyPublishIssueTotal(customerId,agencyPath); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//组织内:所有议题总数
|
|
|
private int getAgencyIssueTotal(String customerId, String agencyPath) { |
|
|
private int getAgencyIssueTotal(String customerId, String agencyPath) { |
|
|
//todo
|
|
|
return factOriginIssueMainDailyService.getAgencyIssueTotal(customerId,agencyPath); |
|
|
return 0; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private int getAgencyTopicTotal(String customerId, String agencyPath) { |
|
|
|
|
|
//todo
|
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Integer getAgencyPartyTopicTotal(String customerId, List<String> partyMemberUserIds, String agencyPath) { |
|
|
//在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数)
|
|
|
//todo
|
|
|
private Integer getAgencyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) { |
|
|
return 0; |
|
|
return factOriginTopicMainDailyService.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
* @param customerId 客户id |
|
|
* @param gridId |
|
|
* @param gridId 网格id |
|
|
* @param communityId |
|
|
* @param communityId 社区的agencyId |
|
|
* @param closedStatus 结案状态:已解决 resolved,未解决 unresolved |
|
|
* @param closedStatus 结案状态:已解决 resolved,未解决 unresolved |
|
|
* @return java.lang.Integer |
|
|
* @description 网格或者社区下: 已解决项目 |
|
|
* @author yinzuomei |
|
|
|
|
|
* @description 网格内已解决项目 |
|
|
|
|
|
* @Date 2020/9/23 16:24 |
|
|
|
|
|
**/ |
|
|
**/ |
|
|
private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { |
|
|
private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { |
|
|
return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus); |
|
|
return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
|
|
|
* @param partyMemberUserIds |
|
|
|
|
|
* @return int |
|
|
* @return int |
|
|
* @author yinzuomei |
|
|
* @param customerId 客户id |
|
|
* @description 党员发布的话题总数 |
|
|
* @param gridId 网格id |
|
|
* @Date 2020/9/23 13:44 |
|
|
* @param agencyId 社区的agencyId |
|
|
|
|
|
* @description 网格或者社区下: 党员发布的话题总数 |
|
|
**/ |
|
|
**/ |
|
|
private int getTopicTotal(String customerId, List<String> partyMemberUserIds, String gridId, String agencyId) { |
|
|
private int getTopicTotal(String customerId, String gridId, String agencyId) { |
|
|
if (CollectionUtils.isEmpty(partyMemberUserIds)) { |
|
|
return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, gridId, agencyId); |
|
|
//如果网格内没有党员,直接返回0
|
|
|
|
|
|
return NumConstant.ZERO; |
|
|
|
|
|
} |
|
|
|
|
|
return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds, gridId, agencyId); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
* @return int |
|
|
* @param partyMemberUserIds |
|
|
* @param customerId 客户id |
|
|
* @return java.lang.Integer |
|
|
* @param gridId 网格id |
|
|
* @author yinzuomei |
|
|
* @param communityId 社区的agencyId |
|
|
* @description 党员发布的议题总数 |
|
|
* @description 网格或者社区下 :话题总数 |
|
|
* @Date 2020/9/23 14:39 |
|
|
|
|
|
**/ |
|
|
**/ |
|
|
private int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds, String gridId, String agencyId) { |
|
|
private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { |
|
|
if (CollectionUtils.isEmpty(partyMemberUserIds)) { |
|
|
return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); |
|
|
return NumConstant.ZERO; |
|
|
|
|
|
} |
|
|
|
|
|
return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds, gridId, agencyId); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
* @return int |
|
|
* @param gridId |
|
|
* @param customerId 客户id |
|
|
* @return java.lang.Integer |
|
|
* @param gridId 网格id |
|
|
* @author yinzuomei |
|
|
* @param agencyId 社区的agencyId |
|
|
* @description 网格内议题转项目数 |
|
|
* @description 网格或者社区下: 党员发布的议题总数 |
|
|
* @Date 2020/9/23 15:38 |
|
|
|
|
|
**/ |
|
|
**/ |
|
|
private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { |
|
|
private int getParyPublishIssueTotal(String customerId, String gridId, String agencyId) { |
|
|
return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); |
|
|
return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, gridId, agencyId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
|
|
|
* @param communityId |
|
|
|
|
|
* @return int |
|
|
* @return int |
|
|
* @author yinzuomei |
|
|
* @param customerId 客户id |
|
|
* @description |
|
|
* @param gridId 网格id |
|
|
* @Date 2020/9/24 10:44 |
|
|
* @param communityId 社区的agencyId |
|
|
|
|
|
* @description 网格或者社区下 :议题总数 |
|
|
**/ |
|
|
**/ |
|
|
private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { |
|
|
private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { |
|
|
return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); |
|
|
return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
* @return java.lang.Integer |
|
|
* @param communityId |
|
|
* @param customerId 客户id |
|
|
* @return int |
|
|
* @param gridId 网格id |
|
|
* @author yinzuomei |
|
|
* @param communityId 社区的agencyId |
|
|
* @description 当前社区内所有话题总数 |
|
|
* @description 网格或者社区下: 议题转项目数 |
|
|
* @Date 2020/9/24 10:32 |
|
|
|
|
|
**/ |
|
|
**/ |
|
|
private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { |
|
|
private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { |
|
|
return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); |
|
|
return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|