Browse Source

网格相关,分值计算修改end1

dev_shibei_match
yinzuomei 5 years ago
parent
commit
5a7c25a69a
  1. 16
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  3. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java
  5. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  6. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  7. 50
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
  8. 52
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
  9. 34
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml
  10. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

16
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java

@ -4,6 +4,8 @@ import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 分页查询网格列表
@ -36,13 +38,25 @@ public class PageQueryGridFormDTO implements Serializable {
private Integer pageIndex;
/**
* 当前客户所属的地区编码 add 01.14
*/
private String customerAreaCode = "";
/**
* 当前客户下的需要汇聚的子客户列表 add 01.14
* 暂不使用
*/
private List<String> subCustomerIds = new ArrayList<>();
public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize){
public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize,String customerAreaCode,List<String> subCustomerIds){
this.customerId=customerId;
this.monthId=monthId;
this.pageIndex=pageIndex;
this.pageNo=pageNo;
this.pageSize=pageSize;
this.customerAreaCode=customerAreaCode;
this.subCustomerIds=subCustomerIds;
}
}

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

@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO;
@ -44,11 +43,7 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* 根据CUSTOMER_IDAGENCY_IDGRID_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
*
* @param customerId
* @param agencyId
* @param gridId
* @param yearId
* @param monthId
* @param quarterId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
@ -78,13 +73,11 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
/**
* @return java.util.Map<java.lang.String,java.lang.Object>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询治理能力网格相关各五级指标最大值最小值
* @Date 2020/8/27 13:10
**/
Map<String, Object> selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId);
Map<String, Object> selectGovrnAblityGridMinAndMax(CalculateCommonFormDTO formDTO);
/**
* @return int

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java

@ -73,13 +73,12 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao<FactIndexPar
/**
* @return java.util.Map<java.lang.String,java.lang.Object>
* @param customerId
* @param monthId
* @param formDTO
* @author yinzuomei
* @description 查询党建能力网格相关各五级指标最大值最小值
* @Date 2020/8/27 12:51
**/
Map<String, Object> selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId);
Map<String, Object> selectPartyAblityGridMinAndMax(CalculateCommonFormDTO formDTO);
/**
* @return java.lang.Integer

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java

@ -71,13 +71,11 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao<FactIndexS
/**
* @return java.util.Map<java.lang.String,java.lang.Object>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询 服务能力网格相关各五级指标最大值最小值
* @Date 2020/8/27 13:15
**/
Map<String, Object> selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId);
Map<String, Object> selectServiceAblityGridMinAndMax(CalculateCommonFormDTO formDTO);
/**
* @return int

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -88,14 +88,13 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
List<ScreenCustomerGridDTO> pageListByCustomerId(PageQueryGridFormDTO formDTO);
/**
* @param customerId 客户id
* @param gridId 网格id
* @return java.lang.String
* @author yinzuomei
* @description 查询网格所属的组织id
* @Date 2020/8/31 12:35
**/
ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId);
ScreenCustomerGridDTO selectParentAgencyId(@Param("gridId") String gridId);
/**
* 返回当前客户下未匹配到的网格信息

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -202,7 +202,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE);
log.info(String.format("共%s条数据,分%s次计算", total, totalPage));
//每一组指标的最大值,key:code_MIN/MAX
Map<String, Object> minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId());
Map<String, Object> minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO);
if (CollectionUtils.isEmpty(minAndMaxMap)) {
log.warn("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId());
return;
@ -218,7 +218,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
formDTO.getMonthId(),
pageIndex,
pageNo,
IndexCalConstant.PAGE_SIZE));
IndexCalConstant.PAGE_SIZE,
formDTO.getCustomerAreaCode(),
formDTO.getSubCustomerIds()));
//遍历每一个网格的记录
recordList.forEach(recordMap -> {
//遍历所有的指标
@ -430,11 +432,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
for (HashMap<String, CalculateResult> resultMap : resultMapList) {
resultMap.forEach((gridId, calculateResult) -> {
GridScoreEntity gridScoreEntity = new GridScoreEntity();
//一定要赋值当前正在计算的客户id
gridScoreEntity.setCustomerId(formDTO.getCustomerId());
gridScoreEntity.setGridId(gridId);
gridScoreEntity.setIsTotal(isTotal);
gridScoreEntity.setIndexCode(indexCode);
ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId);
ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(gridId);
if (null != screenCustomerGridDTO) {
if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){
gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId());
@ -610,7 +613,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE);
log.info(String.format("共%s条数据,分%s次计算", total, totalPage));
//每一组指标的最大值,key:code_MIN/MAX
Map<String, Object> minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId());
Map<String, Object> minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO);
if (CollectionUtils.isEmpty(minAndMaxMap)) {
log.warn("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId());
return;
@ -626,7 +629,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
formDTO.getMonthId(),
pageIndex,
pageNo,
IndexCalConstant.PAGE_SIZE));
IndexCalConstant.PAGE_SIZE,
formDTO.getCustomerAreaCode(),
formDTO.getSubCustomerIds()));
//遍历每一个网格的记录
recordList.forEach(recordMap -> {
//遍历所有的指标
@ -683,7 +688,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE);
log.info(String.format("共%s条数据,分%s次计算", total, totalPage));
//每一组指标的最大值,key:code_MIN/MAX
Map<String, Object> minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId());
Map<String, Object> minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO);
if (CollectionUtils.isEmpty(minAndMaxMap)) {
log.warn("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId());
return;
@ -699,7 +704,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
formDTO.getMonthId(),
pageIndex,
pageNo,
IndexCalConstant.PAGE_SIZE));
IndexCalConstant.PAGE_SIZE,
formDTO.getCustomerAreaCode(),
formDTO.getSubCustomerIds()));
//遍历每一个网格的记录
recordList.forEach(recordMap -> {
//遍历所有的指标
@ -838,15 +845,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
党员参加三会一课人次*/
/**
* @param customerId
* @param monthId
* @param formDTO
* @return java.util.Map<java.lang.String, java.lang.Object>
* @author yinzuomei
* @description 查询党建能力网格相关各五级指标最大值最小值
* @Date 2020/8/27 12:47
**/
public Map<String, Object> queryPartyAblityGridMinAndMax(String customerId, String monthId) {
return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId, monthId);
public Map<String, Object> queryPartyAblityGridMinAndMax(CalculateCommonFormDTO formDTO) {
return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(formDTO);
}
@ -863,15 +869,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
/**
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Object>
* @author yinzuomei
* @description 查询治理能力网格相关各五级指标最大值最小值
* @Date 2020/8/27 12:48
**/
public Map<String, Object> queryGovrnAblityGridMinAndMax(String customerId, String monthId) {
return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId);
public Map<String, Object> queryGovrnAblityGridMinAndMax(CalculateCommonFormDTO formDTO) {
return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(formDTO);
}
/**
@ -886,15 +890,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
}
/**
* @param customerId
* @param monthId
* @param formDTO
* @return java.util.Map<java.lang.String, java.lang.Object>
* @author yinzuomei
* @description 查询 服务能力网格相关各五级指标最大值最小值
* @Date 2020/8/27 12:50
**/
public Map<String, Object> queryServiceAblityGridMinAndMax(String customerId, String monthId) {
return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId);
public Map<String, Object> queryServiceAblityGridMinAndMax(CalculateCommonFormDTO formDTO) {
return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(formDTO);
}

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

@ -113,16 +113,30 @@
m.SATISFACTION_RATIO
FROM
fact_index_govrn_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
and m.CUSTOMER_ID=#{customerId}
and m.MONTH_ID=#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and m.CUSTOMER_ID=#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
order by m.GRID_ID asc
LIMIT #{pageIndex}, #{pageSize}
</select>
<!-- 查询治理能力,网格相关,各五级指标最大值,最小值 -->
<select id="selectGovrnAblityGridMinAndMax" parameterType="map" resultType="java.util.Map">
<select id="selectGovrnAblityGridMinAndMax" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.util.Map">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
@ -145,10 +159,24 @@
MAX(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MAX
FROM
fact_index_govrn_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
and m.CUSTOMER_ID=#{customerId}
and m.MONTH_ID=#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and m.CUSTOMER_ID=#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<select id="selectCount" resultType="java.lang.Integer" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO">
@ -156,10 +184,24 @@
count( 1 ) AS total
FROM
fact_index_govrn_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID=#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<!-- 场景:客户这个月只上传了一个网格的事实记录 -->

52
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml

@ -126,16 +126,30 @@
m.JOIN_THREE_MEETS_COUNT
FROM
fact_index_party_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID =#{monthId}
order by m.GRID_ID asc
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
order by m.GRID_ID asc
LIMIT #{pageIndex}, #{pageSize}
</select>
<!-- 查询党建能力,网格相关,各五级指标最大值,最小值 -->
<select id="selectPartyAblityGridMinAndMax" resultType="java.util.Map" parameterType="map">
<select id="selectPartyAblityGridMinAndMax" resultType="java.util.Map" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
@ -168,10 +182,24 @@
MAX(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MAX
FROM
fact_index_party_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID =#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<!-- 查询 党建能力-网格相关事实表 这个月共上传记录数 -->
@ -180,10 +208,24 @@
count(1) as total
FROM
fact_index_party_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID =#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<!-- 场景:客户这个月只上传了一个网格的事实记录 -->

34
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml

@ -98,7 +98,7 @@
</select>
<!-- 查询 服务能力,网格相关,各五级指标最大值,最小值 -->
<select id="selectServiceAblityGridMinAndMax" parameterType="map" resultType="java.util.Map">
<select id="selectServiceAblityGridMinAndMax" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.util.Map">
SELECT
m.CUSTOMER_ID,
m.GRID_ID,
@ -111,10 +111,24 @@
MAX(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MAX
FROM
fact_index_service_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
and m.CUSTOMER_ID=#{customerId}
and m.MONTH_ID=#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
and m.CUSTOMER_ID=#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<!-- 查询(服务能力-网格相关事实表)共上传记录数 -->
@ -123,10 +137,24 @@
count(1) as total
FROM
fact_index_service_ablity_grid_monthly m
inner join screen_customer_grid scg
on(
m.GRID_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
and scg.UP_TO_CAL='yes'
)
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID =#{monthId}
<choose>
<when test="null!=subCustomerIds and subCustomerIds.size()>0">
and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%')
</when>
<otherwise>
AND m.CUSTOMER_ID =#{customerId}
and scg.CUSTOMER_ID=#{customerId}
</otherwise>
</choose>
</select>
<!-- 场景:客户这个月只上传了一个网格的事实记录 -->

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

@ -101,7 +101,6 @@
screen_customer_grid m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
AND m.GRID_ID = #{gridId}
</select>

Loading…
Cancel
Save