Browse Source

治理能力统计

master
zhaoqifeng 5 years ago
parent
commit
95358d3653
  1. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  2. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  3. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java
  4. 64
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  5. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java
  7. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java
  8. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java
  9. 41
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
  10. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java

@ -120,4 +120,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @date 2020/9/19 4:31 下午 * @date 2020/9/19 4:31 下午
*/ */
Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId); Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
/**
* 查询客户下网格治理能力
* @author zhaoqifeng
* @date 2020/9/24 15:26
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity>
*/
List<FactIndexGovrnAblityGridMonthlyEntity> selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId);
} }

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java

@ -56,4 +56,23 @@ public interface ScreenGovernRankDataDao extends BaseDao<ScreenGovernRankDataEnt
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void batchInsertGovernRankData(@Param("list") List<GovernRankDataFormDTO> list, @Param("customerId")String customerId); void batchInsertGovernRankData(@Param("list") List<GovernRankDataFormDTO> list, @Param("customerId")String customerId);
/**
* 组织级别初始化数据
* @author zhaoqifeng
* @date 2020/9/24 14:52
* @param customerId
* @param level
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level);
/**
* 网格级别初始化数据
* @author zhaoqifeng
* @date 2020/9/24 14:52
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initGridDataList(@Param("customerId") String customerId);
} }

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

@ -0,0 +1,41 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:28
*/
public interface GovernRankDataExtractService {
/**
* 网格治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:16
*/
void extractGridData(String customerId, String monthId);
/**
* 社区治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractCommunityData(String customerId, String monthId);
/**
* 街道治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
}

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

@ -0,0 +1,64 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:31
*/
public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService {
@Autowired
private ScreenGovernRankDataService screenGovernRankDataService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> {
BigDecimal total = new BigDecimal(grid.getProjectTotal());
entity.setYearId(grid.getYearId());
entity.setMonthId(grid.getMonthId());
//TODO 响应率
//解决率
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
//自治率
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
}
@Override
public void extractCommunityData(String customerId, String monthId) {
}
@Override
public void extractStreetData(String customerId, String monthId) {
}
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java

@ -0,0 +1,24 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:34
*/
public interface FactIndexGovrnAblityGridMonthlyService extends BaseService<FactIndexGovrnAblityGridMonthlyEntity> {
/**
* 查询客户下网格治理能力
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity>
* @author zhaoqifeng
* @date 2020/9/24 15:41
*/
List<FactIndexGovrnAblityGridMonthlyEntity> getGridByCustomer(String customerId, String monthId);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java

@ -0,0 +1,20 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:36
*/
public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityGridMonthlyDao, FactIndexGovrnAblityGridMonthlyEntity> implements FactIndexGovrnAblityGridMonthlyService {
@Override
public List<FactIndexGovrnAblityGridMonthlyEntity> getGridByCustomer(String customerId, String monthId) {
return baseDao.selectGridByCustomer(customerId, monthId);
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java

@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import java.util.List;
/** /**
* 基层治理-治理能力排行数据(按月统计) * 基层治理-治理能力排行数据(按月统计)
* *
@ -28,5 +30,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
* @since v1.0.0 2020-09-22 * @since v1.0.0 2020-09-22
*/ */
public interface ScreenGovernRankDataService extends BaseService<ScreenGovernRankDataEntity> { public interface ScreenGovernRankDataService extends BaseService<ScreenGovernRankDataEntity> {
/**
* 构造screen_govern_rank_data 初始数据先赋值为0
* @author zhaoqifeng
* @date 2020/9/24 14:41
* @param customerId
* @param orgType
* @param agencyLevel
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initList(String customerId, String orgType, String agencyLevel);
} }

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

@ -19,11 +19,16 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao; import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/** /**
* 基层治理-治理能力排行数据(按月统计) * 基层治理-治理能力排行数据(按月统计)
* *
@ -31,7 +36,26 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22 * @since v1.0.0 2020-09-22
*/ */
@Service @Service
@Slf4j
public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl<ScreenGovernRankDataDao, ScreenGovernRankDataEntity> implements ScreenGovernRankDataService { public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl<ScreenGovernRankDataDao, ScreenGovernRankDataEntity> implements ScreenGovernRankDataService {
@Override
public List<ScreenGovernRankDataEntity> initList(String customerId, String orgType, String agencyLevel) {
List<ScreenGovernRankDataEntity> list = new ArrayList<>();
switch (orgType) {
case OrgTypeConstant.AGENCY:
log.info("组织级别统计");
list = baseDao.initAgencyDataList(customerId, agencyLevel);
break;
case OrgTypeConstant.GRID:
log.info("网格级别统计");
list = baseDao.initGridDataList(customerId);
break;
default:
log.info("部门级别统计");
break;
}
return list;
}
} }

41
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml

@ -162,6 +162,47 @@
AND m.MONTH_ID =#{monthId} AND m.MONTH_ID =#{monthId}
</select> </select>
<!-- 查询全部网格信息 -->
<select id="selectAllGridInfo" resultType="com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO">
SELECT
scg.CUSTOMER_ID,
scg.GRID_ID,
scg.PARENT_AGENCY_ID AS agencyId
FROM
screen_customer_grid scg
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
</select>
<!-- 查询全部网格信息 -->
<select id="selectAllGridInfoToParty" resultType="com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO">
SELECT
scg.CUSTOMER_ID,
scg.GRID_ID,
scg.PARENT_AGENCY_ID AS agencyId
FROM
screen_customer_grid scg
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
</select>
<select id="selectGridByCustomer" resultType="com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity">
SELECT
GRID_ID,
MONTH_ID,
YEAR_ID,
PROJECT_TOTAL,
SELF_SOLVE_PROJECT_COUNT,
RESOLVE_PROJECT_COUNT,
SATISFACTION_RATIO
FROM
fact_index_govrn_ablity_grid_monthly
WHERE
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<!-- 批量插入治理能力 --> <!-- 批量插入治理能力 -->
<insert id="insertGovernAbilityRecord"> <insert id="insertGovernAbilityRecord">
INSERT INTO fact_index_govrn_ablity_grid_monthly ( INSERT INTO fact_index_govrn_ablity_grid_monthly (

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml

@ -8,6 +8,39 @@
where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId}
limit 1000; limit 1000;
</delete> </delete>
<select id="initAgencyDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity">
SELECT DISTINCT
CUSTOMER_ID,
'agency' AS ORG_TYPE,
AGENCY_ID AS ORG_ID,
PID AS PARENT_ID,
AGENCY_NAME AS ORG_NAME,
0 AS RESPONSE_RATIO,
0 AS RESOLVED_RATIO,
0 AS GOVERN_RATIO,
0 AS SATISFACTION_RATIO
FROM
screen_customer_agency
WHERE
CUSTOMER_ID = #{customerId}
AND `LEVEL` = #{level}
</select>
<select id="initGridDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity">
SELECT DISTINCT
CUSTOMER_ID,
'grid' AS ORG_TYPE,
GRID_ID AS ORG_ID,
PARENT_AGENCY_ID AS PARENT_ID,
GRID_NAME AS ORG_NAME,
0 AS RESPONSE_RATIO,
0 AS RESOLVED_RATIO,
0 AS GOVERN_RATIO,
0 AS SATISFACTION_RATIO
FROM
screen_customer_grid
WHERE
CUSTOMER_ID = #{customerId}
</select>
<insert id="batchInsertGovernRankData" parameterType="map"> <insert id="batchInsertGovernRankData" parameterType="map">
insert into screen_govern_rank_data insert into screen_govern_rank_data

Loading…
Cancel
Save