|
|
@ -18,11 +18,25 @@ |
|
|
|
package com.epmet.service.evaluationindex.extract.todata.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; |
|
|
|
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; |
|
|
|
import com.epmet.dto.stats.DimAgencyDTO; |
|
|
|
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; |
|
|
|
import com.epmet.service.stats.DimAgencyService; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 组织的治理指数,按天统计 |
|
|
|
* |
|
|
@ -32,6 +46,14 @@ import org.springframework.stereotype.Service; |
|
|
|
@Service |
|
|
|
public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgencyGovernDailyDao, FactAgencyGovernDailyEntity> implements FactAgencyGovernDailyService { |
|
|
|
|
|
|
|
@Resource |
|
|
|
private DimAgencyService dimAgencyService; |
|
|
|
@Resource |
|
|
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
|
|
@Resource |
|
|
|
private FactOriginIssueMainDailyService factOriginIssueMainDailyService; |
|
|
|
@Resource |
|
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 治理指数-组织相关 |
|
|
@ -44,8 +66,14 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void extractFactAgencyGovernDaily(String customerId, String dateId) { |
|
|
|
List<DimAgencyDTO> agencyList = dimAgencyService.getAgencyInfoByCustomerId(customerId); |
|
|
|
List<FactAgencyGovernDailyEntity> agencyGovernDailyList = agencyList.stream().map(agency -> { |
|
|
|
FactAgencyGovernDailyEntity entity = initEntity(agency, dateId); |
|
|
|
return entity; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
// 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和
|
|
|
|
|
|
|
|
Map<String, OrgStatisticsResultDTO> topicTotal = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, null, |
|
|
|
null); |
|
|
|
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
|
|
|
|
// 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
|
|
|
|
// 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算
|
|
|
@ -61,4 +89,35 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency |
|
|
|
// A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决)
|
|
|
|
// 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案
|
|
|
|
} |
|
|
|
|
|
|
|
private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) { |
|
|
|
FactAgencyGovernDailyEntity entity = new FactAgencyGovernDailyEntity(); |
|
|
|
entity.setCustomerId(agency.getCustomerId()); |
|
|
|
entity.setAgencyId(agency.getId()); |
|
|
|
entity.setLevel(agency.getLevel()); |
|
|
|
entity.setPid(agency.getPid()); |
|
|
|
entity.setPids(agency.getPids()); |
|
|
|
entity.setDateId(dateId); |
|
|
|
entity.setProblemResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setGroupSelfGovernRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setGridSelfGovernRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setCommunityClosedRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setStreetClosedRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setDistrictDeptClosedRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setTopicResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setTopicUnResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setIssueResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setIssueUnResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setIssueProjectResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setIssueProjectUnResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setApprovalProjectResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setApprovalProjectUnResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setInGroupTopicResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setInGroupTopicUnResolvedCount(NumConstant.ZERO); |
|
|
|
entity.setGridSelfGovernProjectTotal(NumConstant.ZERO); |
|
|
|
entity.setCommunityClosedCount(NumConstant.ZERO); |
|
|
|
entity.setStreetClosedCount(NumConstant.ZERO); |
|
|
|
entity.setDistrictDeptClosedCount(NumConstant.ZERO); |
|
|
|
return entity; |
|
|
|
} |
|
|
|
} |