diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java index 4d26f40f48..d5be2db6e9 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java +++ b/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: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + /** * 月维度Id: yyyyMM */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index b30d2751d1..72c11ee8ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/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 { * @Date 10:43 2020-09-03 **/ List 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 list, @Param("customerId")String customerId); + + /** + * 根据入参查询 区/街道相关分数表id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyId(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index b77849a5d5..bd4a483062 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/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 { **/ List 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 list, @Param("customerId")String customerId); + + /** + * 根据入参查询 区直部门分值表id + * @param customerId + * @param monthId + * @return java.lang.String + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptId(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** * @Description 所有直属部门治理能力平均值 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java index a6060a2bf7..40fd49e6ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java +++ b/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 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 list, @Param("customerId")String customerId); + + /** + * 根据入参查询 查询社区id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityId(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java index 5f43635941..77c3f85366 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java +++ b/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 * @Date 10:43 2020-09-03 **/ List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 根据入参查询 网格id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List 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 list,@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 20147e0f82..ea9e977207 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/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 + * @Author zhangyong + * @Date 14:38 2020-09-04 + **/ + List selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 7cfb17110c..a6f251251a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/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 * @Date 2020/9/3 16:32 **/ ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); + + /** + * 返回当前客户下,未匹配到的区直部门信息 + * + * @param customerId + * @param deptIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchDeptInfo(@Param("customerId") String customerId, + @Param("deptIds") String[] deptIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 0d9a6420f9..d07d9aff46 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/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 * @Date 16:57 2020-09-03 **/ ScreenCustomerGridDTO selectParentGridInfo(@Param("customerId")String customerId, @Param("gridId")String gridId); + + /** + * 返回当前客户下,未匹配到的网格信息 + * + * @param customerId + * @param gridIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchGridInfo(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index a38ff1cbe6..55b4e3ac41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/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 list, @Param("customerId")String customerId); + + /** + * 获取今年的各月份的平均值 + * @param customerId + * @param yearId + * @param month + * @return java.util.List + * @Author zhangyong + * @Date 15:51 2020-09-04 + **/ + List selectListIndexDataMonthlyByYear(@Param("customerId") String customerId, + @Param("yearId") String yearId, @Param("month") String month); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 715bc56b0f..6f260e44c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/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 gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); - if (null != gridScoreDTOS && gridScoreDTOS.size() > NumConstant.ZERO){ - this.insertIndexDataMonthlyByGridScore(month, year, customerId, gridScoreDTOS); - } - - // fact_index_community_score 社区相关分数表 agency - List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); - if (null != communityScoreDTOS && communityScoreDTOS.size() > NumConstant.ZERO){ - this.insertIndexDataMonthlyByCommunityScore(month, year, customerId, communityScoreDTOS); - } - - // fact_index_dept_score 区直部门分值表 department - List 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 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 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 mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); + // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchGridList.size() > NumConstant.ZERO){ + this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList); + } + } else { + // 将所有的网格按照 4种类型,各赋一遍默认值 + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList); } - - // 插入年表 screen_index_data_yearly + // 开始处理实际分数 + // fact_index_grid_score 网格相关分值记录表 grid + String[] dateArr = yearOrMonth(monthId); + List 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 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 mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); + // 将 社区相关分数表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchAgencyList.size() > NumConstant.ZERO){ + this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + } else { + // 将所有的社区按照 4种类型,各赋一遍默认值 + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_community_score 社区相关分数表 agency + String[] dateArr = yearOrMonth(monthId); + // 查询社区相关分值记录 + List 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 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 mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); + if (mismatchDeptList.size() > NumConstant.ZERO){ + this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + } + } else { + List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + } + // 开始处理实际分数 + // fact_index_dept_score 区直部门分值表 department + String[] dateArr = yearOrMonth(monthId); + // 查询社 区直部门分值表 + List 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 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 mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencys); + if (mismatchAgencyList.size() > NumConstant.ZERO){ + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + } else { + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_agency_score 区/街道相关分数表 agency + String[] dateArr = yearOrMonth(monthId); + List 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 mismatchGridList){ + String[] dateArr = yearOrMonth(monthId); + List 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 mismatchAgencyList){ + String[] dateArr = yearOrMonth(monthId); + List 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 mismatchDeptList){ + String[] dateArr = yearOrMonth(monthId); + List 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 mismatchAgencyList){ + String[] dateArr = yearOrMonth(monthId); + List 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 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 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); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 179fd5c9eb..1c6efa8f52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -63,7 +63,7 @@ - SELECT CUSTOMER_ID, AGENCY_ID, @@ -102,4 +102,63 @@ AND fics.index_code = #{indexCode} GROUP BY fics.agency_id + + + 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 + + ( + (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() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index 8e01fb1e52..b225821aec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -43,4 +43,59 @@ GROUP BY fidc.agency_id + + 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 + + ( + (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() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml index 07e3b05b94..7978db5eee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/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 + + + 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 + + ( + (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() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml index b6eed400a2..010ac06798 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml +++ b/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 + + + 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 + + ( + (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() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index dda779d7b9..c1479694d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/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} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 8937212e71..47ab3d400d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/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} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 7a8c216fea..a86ec3bec2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/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} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 616d567b8a..4c8369dd0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -59,4 +59,23 @@ + +