Browse Source

Merge branch 'dev_screen_data' of C:\Users\Administrator\Desktop\党群e事通后端 with conflicts.

dev
zhangyongzhangyong 5 years ago
parent
commit
e5be626a93
  1. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java
  2. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  3. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java
  4. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java
  5. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java
  6. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  7. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java
  8. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  9. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  10. 477
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java
  11. 61
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  12. 55
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml
  13. 55
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml
  14. 57
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml
  15. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
  16. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml
  17. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  18. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java

@ -54,6 +54,16 @@ public class FactIndexGridScoreDTO implements Serializable {
*/
private String gridId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -81,4 +82,25 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @Date 10:43 2020-09-03
**/
List<AgencyScoreDTO> selectListAgencyScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 批量插入区/街道相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertAgencyScoreData(@Param("list") List<AgencyScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 /街道相关分数表id
* @param customerId
* @param monthId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListAgencyId(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java

@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -45,6 +44,27 @@ public interface DeptScoreDao extends BaseDao<DeptScoreEntity> {
**/
List<DeptScoreDTO> selectListDeptScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 批量插入 区直部门分值表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertDeptScoreData(@Param("list") List<DeptScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 区直部门分值表id
* @param customerId
* @param monthId
* @return java.lang.String
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListDeptId(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* @Description 所有直属部门治理能力平均值

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java

@ -18,8 +18,6 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.SubCommunityGovernAvgResultDTO;
import com.epmet.dto.indexcal.SubCommunityPartyAvgResultDTO;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity;
@ -82,4 +80,24 @@ public interface FactIndexCommunityScoreDao extends BaseDao<FactIndexCommunitySc
*/
List<SubCommunityAvgResultDTO> selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
/**
* 批量插入 社区相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertCommunityScoreData(@Param("list") List<FactIndexCommunityScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 查询社区id
* @param customerId
* @param monthId
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListCommunityId(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java

@ -19,9 +19,7 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO;
import com.epmet.dto.screen.result.SubGridAvgResultDTO;
import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO;
import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -55,4 +53,25 @@ public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity>
* @Date 10:43 2020-09-03
**/
List<FactIndexGridScoreDTO> selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 根据入参查询 网格id
* @param customerId
* @param monthId
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 批量插入 网格相关分值表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertGridScoreData(@Param("list") List<FactIndexGridScoreDTO> list,@Param("customerId")String customerId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -66,4 +66,14 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
* @Date 16:57 2020-09-03
**/
String selectParentAgencyInfo(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
/**
* 返回当前客户下未匹配到的组织信息
* @param customerId 客户id
* @param agencyIds 组织id集合
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity>
* @Author zhangyong
* @Date 14:38 2020-09-04
**/
List<ScreenCustomerAgencyEntity> selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java

@ -22,7 +22,6 @@ import com.epmet.dto.screencoll.form.CustomerDeptFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -77,4 +76,16 @@ public interface ScreenCustomerDeptDao extends BaseDao<ScreenCustomerDeptEntity>
* @Date 2020/9/3 16:32
**/
ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId);
/**
* 返回当前客户下未匹配到的区直部门信息
*
* @param customerId
* @param deptIds
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity>
* @Author zhangyong
* @Date 10:45 2020-09-04
**/
List<ScreenCustomerDeptEntity> selectListMismatchDeptInfo(@Param("customerId") String customerId,
@Param("deptIds") String[] deptIds);
}

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

@ -104,4 +104,16 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
* @Date 16:57 2020-09-03
**/
ScreenCustomerGridDTO selectParentGridInfo(@Param("customerId")String customerId, @Param("gridId")String gridId);
/**
* 返回当前客户下未匹配到的网格信息
*
* @param customerId
* @param gridIds
* @return java.util.List<com.epmet.dto.ScreenCustomerGridDTO>
* @Author zhangyong
* @Date 10:45 2020-09-04
**/
List<ScreenCustomerGridDTO> selectListMismatchGridInfo(@Param("customerId") String customerId,
@Param("gridIds") String[] gridIds);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -60,4 +60,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
* @Date 10:52 2020-08-18
**/
void batchInsertIndexDataMonthly(@Param("list") List<IndexDataMonthlyFormDTO> list, @Param("customerId")String customerId);
/**
* 获取今年的各月份的平均值
* @param customerId
* @param yearId
* @param month
* @return java.util.List<com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO>
* @Author zhangyong
* @Date 15:51 2020-09-04
**/
List<IndexDataMonthlyFormDTO> selectListIndexDataMonthlyByYear(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("month") String month);
}

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

@ -1,7 +1,10 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
@ -15,6 +18,11 @@ import com.epmet.dto.indexcollect.form.*;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity;
import com.epmet.eum.IndexCodeEnum;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
@ -207,34 +215,53 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
if (NumConstant.SIX != monthId.length()){
throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId);
}
String year = monthId.substring(NumConstant.ZERO, NumConstant.FOUR);
String month = monthId.substring(NumConstant.FOUR, NumConstant.SIX);
// 开始处理 网格相关分值表
this.startHandleIndexGridScore(monthId, customerId);
// 开始处理 社区相关分值表
this.startHandleIndexCommunityScore(monthId, customerId);
// 开始处理 区直部门分值表
this.startHandleIndexDeptScore(monthId, customerId);
// 开始处理 区/街道相关分数表
this.startHandleIndexAgencyScore(monthId, customerId);
// fact_index_grid_score 网格相关分值记录表 grid
List<FactIndexGridScoreDTO> gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId);
if (null != gridScoreDTOS && gridScoreDTOS.size() > NumConstant.ZERO){
this.insertIndexDataMonthlyByGridScore(month, year, customerId, gridScoreDTOS);
}
// fact_index_community_score 社区相关分数表 agency
List<FactIndexCommunityScoreDTO> communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId);
if (null != communityScoreDTOS && communityScoreDTOS.size() > NumConstant.ZERO){
this.insertIndexDataMonthlyByCommunityScore(month, year, customerId, communityScoreDTOS);
}
// fact_index_dept_score 区直部门分值表 department
List<DeptScoreDTO> deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId);
if (null != deptScoreDTOS && deptScoreDTOS.size() > NumConstant.ZERO){
this.insertIndexDataMonthlyByDeptScore(month, year, customerId, deptScoreDTOS);
}
// 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly
this.insertIndexDataYear(this.getYearStr(monthId), this.getMonthStr(monthId), customerId);
}
// fact_index_agency_score 区/街道相关分数表 agency
List<AgencyScoreDTO> agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId);
if (null != agencyScoreDTOS && agencyScoreDTOS.size() > NumConstant.ZERO) {
this.insertIndexDataMonthlyByAgencyScore(month, year, customerId, agencyScoreDTOS);
/**
* 目标将网格的 党建能力治理能力服务能力总指数 得分 整理后(4条合1条) 插入 指数-指数数据(月表)
* 如果网格相关分值表 中的网格数量不全需要从 网格(党支部)信息表() 先查询到缺少的网格信息赋上默认值后插入网格相关分值表()
*
* @param monthId
* @param customerId
* @return void
* @Author zhangyong
* @Date 13:44 2020-09-04
**/
private void startHandleIndexGridScore(String monthId, String customerId){
// 查询网格相关分值记录 表已经存在的网格id
List<String> indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId);
if (indexGridIds.size() > NumConstant.ZERO){
// 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。
String[] gridIds = new String[indexGridIds.size()];
for (int i = NumConstant.ZERO; i < indexGridIds.size(); i++){
gridIds[i] = indexGridIds.get(i);
}
List<ScreenCustomerGridDTO> mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds);
// 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0
if (mismatchGridList.size() > NumConstant.ZERO){
this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList);
}
} else {
// 将所有的网格按照 4种类型,各赋一遍默认值
List<ScreenCustomerGridDTO> mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null);
this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList);
}
// 插入年表 screen_index_data_yearly
// 开始处理实际分数
// fact_index_grid_score 网格相关分值记录表 grid
String[] dateArr = yearOrMonth(monthId);
List<FactIndexGridScoreDTO> gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId);
this.insertIndexDataMonthlyByGridScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, gridScoreDTOS);
}
/**
@ -283,8 +310,37 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO);
monthlyFormDTOList.add(monthlyFormDTO);
}
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
if (monthlyFormDTOList.size() > NumConstant.ZERO){
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
}
private void startHandleIndexCommunityScore(String monthId, String customerId){
// 查询社区相关分值记录
List<String> indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId);
if (indexCommunityIds.size() > NumConstant.ZERO){
// 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。
String[] communityIds = new String[indexCommunityIds.size()];
for (int i = NumConstant.ZERO; i < indexCommunityIds.size(); i++){
communityIds[i] = indexCommunityIds.get(i);
}
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds);
// 将 社区相关分数表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0
if (mismatchAgencyList.size() > NumConstant.ZERO){
this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList);
}
} else {
// 将所有的社区按照 4种类型,各赋一遍默认值
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null);
this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList);
}
// 开始处理实际分数
// fact_index_community_score 社区相关分数表 agency
String[] dateArr = yearOrMonth(monthId);
// 查询社区相关分值记录
List<FactIndexCommunityScoreDTO> communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId);
this.insertIndexDataMonthlyByCommunityScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, communityScoreDTOS);
}
/**
@ -337,8 +393,34 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 补充表中其他字段
monthlyFormDTOList.add(monthlyFormDTO);
}
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
if (monthlyFormDTOList.size() > NumConstant.ZERO){
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
}
private void startHandleIndexDeptScore(String monthId, String customerId){
// 查询社 区直部门分值表
List<String> indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId);
if (indexDeptIds.size() > NumConstant.ZERO){
String[] depeIds = new String[indexDeptIds.size()];
for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){
depeIds[i] = indexDeptIds.get(i);
}
List<ScreenCustomerDeptEntity> mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds);
if (mismatchDeptList.size() > NumConstant.ZERO){
this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList);
}
} else {
List<ScreenCustomerDeptEntity> mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null);
this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList);
}
// 开始处理实际分数
// fact_index_dept_score 区直部门分值表 department
String[] dateArr = yearOrMonth(monthId);
// 查询社 区直部门分值表
List<DeptScoreDTO> deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId);
this.insertIndexDataMonthlyByDeptScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, deptScoreDTOS);
}
/**
@ -388,6 +470,28 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
private void startHandleIndexAgencyScore(String monthId, String customerId){
List<String> indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId);
if (indexAgencyIds.size() > NumConstant.ZERO){
String[] agencys = new String[indexAgencyIds.size()];
for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){
agencys[i] = indexAgencyIds.get(i);
}
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencys);
if (mismatchAgencyList.size() > NumConstant.ZERO){
this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList);
}
} else {
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null);
this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList);
}
// 开始处理实际分数
// fact_index_agency_score 区/街道相关分数表 agency
String[] dateArr = yearOrMonth(monthId);
List<AgencyScoreDTO> agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId);
this.insertIndexDataMonthlyByAgencyScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, agencyScoreDTOS);
}
/**
* 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao
*
@ -496,4 +600,319 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
}
return monthlyFormDTO;
}
/**
* 设置 指数-指数数据()
* 总指数党建能力指数治理能力服务能力 默认值 0
* @param monthlyFormDTO
* @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO
* @Author zhangyong
* @Date 11:01 2020-09-04
**/
private IndexDataMonthlyFormDTO setIndexDefaultValueFor(IndexDataMonthlyFormDTO monthlyFormDTO){
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
monthlyFormDTO.setIndexTotal(zero);
monthlyFormDTO.setPartyDevAblity(zero);
monthlyFormDTO.setGovernAblity(zero);
return monthlyFormDTO;
}
/**
* 新增 网格相关分值记录表 默认值一条网格按照组织类别的不同 需要插入4次
*
* @param monthId
* @param customerId
* @param mismatchGridList
* @return void
* @Author zhangyong
* @Date 14:02 2020-09-04
**/
private void insertIndexGridScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerGridDTO> mismatchGridList){
String[] dateArr = yearOrMonth(monthId);
List<FactIndexGridScoreDTO> insertIndexGridScoreDTOS = new ArrayList<>();
for (ScreenCustomerGridDTO gridDTO : mismatchGridList){
FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO();
// 赋默认值 - 党建能力指数
indexGridScoreDTO.setGridId(gridDTO.getGridId());
indexGridScoreDTO.setAgencyId(gridDTO.getParentAgencyId());
indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId));
indexGridScoreDTO.setYearId(dateArr[NumConstant.ZERO]);
indexGridScoreDTO.setMonthId(monthId);
indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); // 0 or 1
indexGridScoreDTO.setScore(new BigDecimal(NumConstant.ZERO));
indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型
indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR);
insertIndexGridScoreDTOS.add(indexGridScoreDTO);
FactIndexGridScoreDTO indexGridScoreDTO1 = new FactIndexGridScoreDTO();
// 赋默认值 - 治理能力
indexGridScoreDTO1.setGridId(gridDTO.getGridId());
indexGridScoreDTO1.setAgencyId(gridDTO.getParentAgencyId());
indexGridScoreDTO1.setAllParentIds(gridDTO.getAllParentIds());
indexGridScoreDTO1.setQuarterId(DateUtils.getQuarterId(monthId));
indexGridScoreDTO1.setYearId(dateArr[NumConstant.ZERO]);
indexGridScoreDTO1.setMonthId(monthId);
indexGridScoreDTO1.setIsTotal(NumConstant.ZERO_STR);
indexGridScoreDTO1.setScore(new BigDecimal(NumConstant.ZERO));
indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
indexGridScoreDTO1.setDelFlag(NumConstant.ZERO_STR);
insertIndexGridScoreDTOS.add(indexGridScoreDTO1);
FactIndexGridScoreDTO indexGridScoreDTO2 = new FactIndexGridScoreDTO();
// 赋默认值 - 服务能力
indexGridScoreDTO2.setGridId(gridDTO.getGridId());
indexGridScoreDTO2.setAgencyId(gridDTO.getParentAgencyId());
indexGridScoreDTO2.setAllParentIds(gridDTO.getAllParentIds());
indexGridScoreDTO2.setQuarterId(DateUtils.getQuarterId(monthId));
indexGridScoreDTO2.setYearId(dateArr[NumConstant.ZERO]);
indexGridScoreDTO2.setMonthId(monthId);
indexGridScoreDTO2.setIsTotal(NumConstant.ZERO_STR);
indexGridScoreDTO2.setScore(new BigDecimal(NumConstant.ZERO));
indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode());
indexGridScoreDTO2.setDelFlag(NumConstant.ZERO_STR);
insertIndexGridScoreDTOS.add(indexGridScoreDTO2);
FactIndexGridScoreDTO indexGridScoreDTO3 = new FactIndexGridScoreDTO();
// 赋默认值 - 网格相关
indexGridScoreDTO3.setGridId(gridDTO.getGridId());
indexGridScoreDTO3.setAgencyId(gridDTO.getParentAgencyId());
indexGridScoreDTO3.setAllParentIds(gridDTO.getAllParentIds());
indexGridScoreDTO3.setQuarterId(DateUtils.getQuarterId(monthId));
indexGridScoreDTO3.setYearId(dateArr[NumConstant.ZERO]);
indexGridScoreDTO3.setMonthId(monthId);
indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR);
indexGridScoreDTO3.setScore(new BigDecimal(NumConstant.ZERO));
indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
indexGridScoreDTO3.setDelFlag(NumConstant.ZERO_STR);
insertIndexGridScoreDTOS.add(indexGridScoreDTO3);
}
factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId);
}
/**
* 新增 社区相关分数表 默认值一条组织id按照组织类别的不同 需要插入4次
*
* @param monthId
* @param customerId
* @param mismatchAgencyList
* @return void
* @Author zhangyong
* @Date 14:02 2020-09-04
**/
private void insertIndexCommunityScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerAgencyEntity> mismatchAgencyList){
String[] dateArr = yearOrMonth(monthId);
List<FactIndexCommunityScoreEntity> insertIndexCommunityScore = new ArrayList<>();
for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){
FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity();
// 赋默认值 - 党建能力指数
communityScore1.setAgencyId(agencyDTO.getAgencyId());
communityScore1.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
communityScore1.setQuarterId(DateUtils.getQuarterId(monthId));
communityScore1.setYearId(dateArr[NumConstant.ZERO]);
communityScore1.setMonthId(monthId);
communityScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1
communityScore1.setScore(new BigDecimal(NumConstant.ZERO));
communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型
insertIndexCommunityScore.add(communityScore1);
FactIndexCommunityScoreEntity communityScore2 = new FactIndexCommunityScoreEntity();
// 赋默认值 - 治理能力
communityScore2.setAgencyId(agencyDTO.getAgencyId());
communityScore2.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
communityScore2.setQuarterId(DateUtils.getQuarterId(monthId));
communityScore2.setYearId(dateArr[NumConstant.ZERO]);
communityScore2.setMonthId(monthId);
communityScore2.setIsTotal(NumConstant.ZERO_STR);
communityScore2.setScore(new BigDecimal(NumConstant.ZERO));
communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
insertIndexCommunityScore.add(communityScore2);
FactIndexCommunityScoreEntity communityScore3 = new FactIndexCommunityScoreEntity();
// 赋默认值 - 服务能力
communityScore3.setAgencyId(agencyDTO.getAgencyId());
communityScore3.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
communityScore3.setQuarterId(DateUtils.getQuarterId(monthId));
communityScore3.setYearId(dateArr[NumConstant.ZERO]);
communityScore3.setMonthId(monthId);
communityScore3.setIsTotal(NumConstant.ZERO_STR);
communityScore3.setScore(new BigDecimal(NumConstant.ZERO));
communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode());
insertIndexCommunityScore.add(communityScore3);
FactIndexCommunityScoreEntity communityScore4 = new FactIndexCommunityScoreEntity();
// 赋默认值 - 社区相关
communityScore4.setAgencyId(agencyDTO.getAgencyId());
communityScore4.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
communityScore4.setQuarterId(DateUtils.getQuarterId(monthId));
communityScore4.setYearId(dateArr[NumConstant.ZERO]);
communityScore4.setMonthId(monthId);
communityScore4.setIsTotal(NumConstant.ONE_STR);
communityScore4.setScore(new BigDecimal(NumConstant.ZERO));
communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode());
insertIndexCommunityScore.add(communityScore4);
}
factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId);
}
private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerDeptEntity> mismatchDeptList){
String[] dateArr = yearOrMonth(monthId);
List<DeptScoreEntity> insertIndexDeptScore = new ArrayList<>();
for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){
DeptScoreEntity deptScore2 = new DeptScoreEntity();
// 赋默认值 - 治理能力
deptScore2.setDeptId(deptDTO.getDeptId());
deptScore2.setAgencyId(deptDTO.getParentAgencyId());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
deptScore2.setQuarterId(DateUtils.getQuarterId(monthId));
deptScore2.setYearId(dateArr[NumConstant.ZERO]);
deptScore2.setMonthId(monthId);
deptScore2.setIsTotal(NumConstant.ZERO_STR);
deptScore2.setScore(new BigDecimal(NumConstant.ZERO));
deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
insertIndexDeptScore.add(deptScore2);
}
deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId);
}
private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerAgencyEntity> mismatchAgencyList){
String[] dateArr = yearOrMonth(monthId);
List<AgencyScoreEntity> insertIndexAgencyScore = new ArrayList<>();
for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){
AgencyScoreEntity agencyScore1 = new AgencyScoreEntity();
// 赋默认值 - 党建能力指数
agencyScore1.setAgencyId(agencyDTO.getAgencyId());
agencyScore1.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId));
agencyScore1.setYearId(dateArr[NumConstant.ZERO]);
agencyScore1.setMonthId(monthId);
agencyScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1
agencyScore1.setScore(new BigDecimal(NumConstant.ZERO));
agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型
AgencyScoreEntity agencyScore2 = new AgencyScoreEntity();
// 赋默认值 - 治理能力
agencyScore2.setAgencyId(agencyDTO.getAgencyId());
agencyScore2.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId));
agencyScore2.setYearId(dateArr[NumConstant.ZERO]);
agencyScore2.setMonthId(monthId);
agencyScore2.setIsTotal(NumConstant.ZERO_STR);
agencyScore2.setScore(new BigDecimal(NumConstant.ZERO));
agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
AgencyScoreEntity agencyScore3 = new AgencyScoreEntity();
// 赋默认值 - 服务能力
agencyScore3.setAgencyId(agencyDTO.getAgencyId());
agencyScore3.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId));
agencyScore3.setYearId(dateArr[NumConstant.ZERO]);
agencyScore3.setMonthId(monthId);
agencyScore3.setIsTotal(NumConstant.ZERO_STR);
agencyScore3.setScore(new BigDecimal(NumConstant.ZERO));
agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode());
if ("community".equals(agencyDTO.getLevel())){
AgencyScoreEntity agencyScore4 = new AgencyScoreEntity();
// 赋默认值 - 全区相关
agencyScore4.setAgencyId(agencyDTO.getAgencyId());
agencyScore4.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId));
agencyScore4.setYearId(dateArr[NumConstant.ZERO]);
agencyScore4.setMonthId(monthId);
agencyScore4.setIsTotal(NumConstant.ONE_STR);
agencyScore4.setScore(new BigDecimal(NumConstant.ZERO));
agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode());
agencyScore4.setDataType("district");
agencyScore1.setDataType("district");
agencyScore2.setDataType("district");
agencyScore3.setDataType("district");
insertIndexAgencyScore.add(agencyScore4);
} else if ("street".equals(agencyDTO.getLevel())){
AgencyScoreEntity agencyScore4 = new AgencyScoreEntity();
// 赋默认值 - 街道相关
agencyScore4.setAgencyId(agencyDTO.getAgencyId());
agencyScore4.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId));
agencyScore4.setYearId(dateArr[NumConstant.ZERO]);
agencyScore4.setMonthId(monthId);
agencyScore4.setIsTotal(NumConstant.ONE_STR);
agencyScore4.setScore(new BigDecimal(NumConstant.ZERO));
agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode());
agencyScore4.setDataType("street");
agencyScore1.setDataType("street");
agencyScore2.setDataType("street");
agencyScore3.setDataType("street");
insertIndexAgencyScore.add(agencyScore4);
}
insertIndexAgencyScore.add(agencyScore1);
insertIndexAgencyScore.add(agencyScore2);
insertIndexAgencyScore.add(agencyScore3);
}
agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId);
}
private void insertIndexDataYear(String year, String month, String customerId){
List<IndexDataMonthlyFormDTO> monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, year, month);
String[] orgIds = new String[monthlyFormList.size()];
for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){
orgIds[i] = monthlyFormList.get(i).getOrgId();
}
screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, year, orgIds);
List<IndexDataYearlyFormDTO> entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class);
screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId);
}
/**
* 将月份id拆分 dateArr[0] = 年份 dateArr[1] = 月份
*
* @param monthId 202008
* @return java.lang.String[]
* @Author zhangyong
* @Date 13:39 2020-09-04
**/
private String[] yearOrMonth(String monthId){
String[] dateArr = new String[NumConstant.TWO];
dateArr[NumConstant.ZERO] = monthId.substring(NumConstant.ZERO, NumConstant.FOUR);
dateArr[NumConstant.ONE] = monthId.substring(NumConstant.FOUR, NumConstant.SIX);
return dateArr;
}
/**
* 将月份id拆分成 年份
*
* @param monthId 202008
* @return java.lang.String
* @Author zhangyong
* @Date 13:39 2020-09-04
**/
private String getYearStr(String monthId){
return monthId.substring(NumConstant.ZERO, NumConstant.FOUR);
}
/**
* 将月份id拆分成 月份
*
* @param monthId 202008
* @return java.lang.String
* @Author zhangyong
* @Date 13:39 2020-09-04
**/
private String getMonthStr(String monthId){
return monthId.substring(NumConstant.FOUR, NumConstant.SIX);
}
}

61
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml

@ -63,7 +63,7 @@
</select>
<!-- 查询街道相关信息 -->
<select id="selectAgencyScoreInfo" resultType="com.epmet.dto.indexcal.AgencyScoreDTO">
<select id="selectStreetInfo" resultType="com.epmet.dto.indexcal.AgencyScoreDTO">
SELECT
CUSTOMER_ID,
AGENCY_ID,
@ -102,4 +102,63 @@
AND fics.index_code = #{indexCode}
GROUP BY fics.agency_id
</select>
<insert id="batchInsertAgencyScoreData" parameterType="map">
insert into fact_index_agency_score
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_AGENCY_ID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
DATA_TYPE,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.agencyId},
#{item.parentAgencyId},
#{item.yearId},
#{item.quarterId},
#{item.monthId},
#{item.dataType},
#{item.isTotal},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListAgencyId" resultType="String">
SELECT
AGENCY_ID agencyId
FROM
fact_index_agency_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
</mapper>

55
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml

@ -43,4 +43,59 @@
GROUP BY fidc.agency_id
</select>
<insert id="batchInsertDeptScoreData" parameterType="map">
insert into fact_index_dept_score
(
ID,
CUSTOMER_ID,
DEPT_ID,
AGENCY_ID,
QUARTER_ID,
YEAR_ID,
MONTH_ID,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.deptId},
#{item.agencyId},
#{item.quarterId},
#{item.yearId},
#{item.monthId},
#{item.isTotal},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListDeptId" resultType="String">
SELECT
DEPT_ID deptId
FROM
fact_index_dept_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY DEPT_ID
</select>
</mapper>

55
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml

@ -102,4 +102,59 @@
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
<insert id="batchInsertCommunityScoreData" parameterType="map">
insert into fact_index_community_score
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_AGENCY_ID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.agencyId},
#{item.parentAgencyId},
#{item.yearId},
#{item.quarterId},
#{item.monthId},
#{item.isTotal},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListCommunityId" resultType="String">
SELECT
AGENCY_ID agencyId
FROM
fact_index_community_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
</mapper>

57
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml

@ -43,4 +43,61 @@
AND MONTH_ID = #{monthId}
ORDER BY GRID_ID
</select>
<insert id="batchInsertGridScoreData" parameterType="map">
insert into fact_index_grid_score
(
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
ALL_PARENT_IDS,
QUARTER_ID,
YEAR_ID,
MONTH_ID,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.gridId},
#{item.agencyId},
#{item.allParentIds},
#{item.quarterId},
#{item.yearId},
#{item.monthId},
#{item.isTotal},
#{item.score},
#{item.indexCode},
#{item.delFlag},
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListGridId" resultType="String">
SELECT
GRID_ID gridId
FROM
fact_index_grid_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY GRID_ID
</select>
</mapper>

20
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml

@ -70,4 +70,24 @@
AND CUSTOMER_ID =#{customerId}
AND AGENCY_ID = #{agencyId}
</select>
<select id="selectListMismatcAgencyInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity">
SELECT
AGENCY_ID agencyId,
AGENCY_NAME agencyName,
PID pid,
PIDS pids,
`LEVEL` `level`
FROM
screen_customer_agency
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
<if test="agencyIds != null and agencyIds!= ''">
AND AGENCY_ID NOT IN
<foreach item="item" collection="agencyIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

18
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml

@ -75,4 +75,22 @@
AND CUSTOMER_ID =#{customerId}
AND DEPT_ID = #{deptId}
</select>
<select id="selectListMismatchDeptInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity">
SELECT
DEPT_ID deptId,
DEPT_NAME deptName,
PARENT_AGENCY_ID parentAgencyId
FROM
screen_customer_dept
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
<if test="deptIds != null and deptIds!= ''">
AND DEPT_ID NOT IN
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

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

@ -117,4 +117,23 @@
AND CUSTOMER_ID =#{customerId}
AND GRID_ID = #{gridId}
</select>
<select id="selectListMismatchGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
PARENT_AGENCY_ID parentAgencyId,
ALL_PARENT_IDS allParentIds
FROM
screen_customer_grid
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
<if test="gridIds != null and gridIds!= ''">
AND GRID_ID NOT IN
<foreach item="item" collection="gridIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml

@ -59,4 +59,23 @@
</foreach>
</insert>
<select id="selectListIndexDataMonthlyByYear" parameterType="map" resultType="com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO">
SELECT
YEAR_ID yearId,
MONTH_ID monthId,
ORG_TYPE orgType,
ORG_ID orgId,
PARENT_ID parentId,
ORG_NAME orgName,
SUM(INDEX_TOTAL) / #{month} as indexTotal,
SUM(PARTY_DEV_ABLITY) / #{month} as partyDevAblity,
SUM(SERVICE_ABLITY) / #{month} as serviceAblity,
SUM(GOVERN_ABLITY) / #{month} as governAblity
FROM screen_index_data_monthly
WHERE DEL_FLAG = '0'
AND YEAR_ID = #{yearId}
AND CUSTOMER_ID = #{customerId}
GROUP BY ORG_ID
</select>
</mapper>

Loading…
Cancel
Save