Browse Source

全区治理能力统计

master
zhaoqifeng 5 years ago
parent
commit
3699093e1e
  1. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java
  2. 154
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  4. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
  6. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java
  7. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java
  8. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  9. 167
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  10. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexCollDistrictService.java

@ -7,4 +7,14 @@ package com.epmet.service.evaluationindex.extract.dataToIndex;
* @date 2020/9/18 10:44
*/
public interface IndexCollDistrictService {
/**
* 区治理能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveDistrictAbility(String customerId, String dateId);
}

154
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java

@ -1,10 +1,35 @@
package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectOrgPeriodDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author zhaoqifeng
@ -15,4 +40,133 @@ import org.springframework.stereotype.Service;
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollDistrictServiceImpl implements IndexCollDistrictService {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService;
@Autowired
private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService;
@Autowired
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService;
@Override
public void saveDistrictAbility(String customerId, String dateId) {
//当前日期前一天
Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.DISTRICT);
//社区数据初始化
List<FactIndexGovrnAblityOrgMonthlyEntity> list = agencyList.stream().map(agency ->{
FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.DISTRICT);
entity.setTransferedCount(NumConstant.ZERO);
//办结项目数
entity.setClosedProjectCount(NumConstant.ZERO);
//项目响应度
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO));
//办结项目率
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
//街道办结项目的处理效率
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
return entity;
}).collect(Collectors.toList());
//被吹哨次数统计
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT);
if (null != transferCount && !transferCount.isEmpty()) {
list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count ->
entity.setTransferedCount(count.getCount())
));
}
//社区项目响应度
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT, OrgTypeConstant.AGENCY);
if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> {
if (response.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(response.getCount());
BigDecimal sum = new BigDecimal(response.getSum());
entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//社区办结项目满意度
List<OrgStatisticsResultDTO> satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT);
if (CollectionUtils.isEmpty(satisfaction)) {
list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> {
if (sa.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(sa.getCount());
BigDecimal sum = new BigDecimal(sa.getSum());
entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = new BigDecimal(entity.getClosedProjectCount());
//分母,即机关参与过的项目数(去重)
Integer denominator = agencyParticipatedCount.get(entity.getAgencyId());
if (null != denominator && denominator != NumConstant.ZERO) {
//办结率
entity.setClosedProjectRatio(
element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP)
);
}else{
entity.setClosedProjectRatio(BigDecimal.ZERO);
}
//办结效率
entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT);
factIndexGovrnAblityOrgMonthlyService.saveList(list);
//2.党建能力
//获取社区发文数量
List<FactArticlePublishedAgencyDailyDTO> articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT);
List<FactIndexPartyAblityOrgMonthlyEntity> partyList = agencyList.stream().map(agency ->{
FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.DISTRICT);
entity.setPublishArticleCount(NumConstant.ZERO);
return entity;
}).collect(Collectors.toList());
if (null != articles && !articles.isEmpty()) {
partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto ->
entity.setPublishArticleCount(dto.getArticleTotalCount())
));
}
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.DISTRICT);
factIndexPartyAblityOrgMonthlyService.saveList(partyList);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java

@ -154,7 +154,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.COMMUNITY);
entity.setDataType(OrgTypeConstant.STREET);
entity.setPublishArticleCount(NumConstant.ZERO);
return entity;
}).collect(Collectors.toList());

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

@ -42,6 +42,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
private IndexCollStreetService indexCollStreetService;
@Autowired
private IndexCollCommunityService indexCollCommunityService;
@Autowired
private IndexCollDistrictService indexCollDistrictService;
/**
* desc从统计库对象抽取指标数据
@ -114,6 +116,11 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
}catch (Exception e){
log.error("抽取【社区治理能力-社区党建能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
indexCollDistrictService.saveDistrictAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【全区治理能力-全区党建能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
}
}

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

@ -22,9 +22,9 @@ public interface ProjectExtractService {
void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO);
/**
* 抽取项目节点历时逻辑
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/

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

@ -38,4 +38,15 @@ public interface GovernRankDataExtractService {
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
/**
* 全区治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractDistrictData(String customerId, String monthId);
}

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

@ -38,4 +38,15 @@ public interface OrgRankExtractService {
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
/**
* 全区先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractDistrictData(String customerId, String monthId);
}

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

@ -225,4 +225,64 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@Override
public void extractDistrictData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
}

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

@ -67,37 +67,37 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
//党员数
List<FactRegUserGridMonthlyDTO> partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal())
));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount())
));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount())
));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount())
));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount())
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
@ -139,44 +139,44 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal())
));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount())
));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount())
));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount())
));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount())
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
@ -206,45 +206,112 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal())
));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount())
));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount())
));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount())
));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount())
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractDistrictData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.DISTRICT);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setPartyTotal(dto.getPartymemberTotal())
));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setGroupTotal(dto.getCount())
));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setTopicTotal(dto.getCount())
));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setIssueTotal(dto.getCount())
));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto ->
entity.setProjectTotal(dto.getCount())
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {

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

@ -138,11 +138,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
governRankDataExtractService.extractGridData(customerId, monthId);
governRankDataExtractService.extractCommunityData(customerId, monthId);
governRankDataExtractService.extractStreetData(customerId, monthId);
governRankDataExtractService.extractDistrictData(customerId, monthId);
//先进排行 screen_org_rank_data
orgRankExtractService.extractGridData(customerId, monthId);
orgRankExtractService.extractCommunityData(customerId, monthId);
orgRankExtractService.extractStreetData(customerId, monthId);
orgRankExtractService.extractDistrictData(customerId, monthId);
// 党建引领 screen_party_branch_data,screen_party_link_masses_data
partyGuideService.partyGuideExtract(formDTO);
}

Loading…
Cancel
Save