|
|
@ -226,7 +226,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) |
|
|
|
* 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 |
|
|
|
* 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,插入 指数-指数数据(月表) |
|
|
|
* |
|
|
|
* @param monthId |
|
|
|
* @param customerId |
|
|
@ -235,6 +235,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
* @Date 13:44 2020-09-04 |
|
|
|
**/ |
|
|
|
private void startHandleIndexGridScore(String monthId, String customerId){ |
|
|
|
List<ScreenCustomerGridDTO> mismatchGridList = new ArrayList<>(); |
|
|
|
// 查询网格相关分值记录 表已经存在的网格id
|
|
|
|
List<String> indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); |
|
|
|
if (indexGridIds.size() > NumConstant.ZERO){ |
|
|
@ -244,25 +245,57 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
gridIds[i] = indexGridIds.get(i); |
|
|
|
} |
|
|
|
// 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。
|
|
|
|
List<ScreenCustomerGridDTO> mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); |
|
|
|
// 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0
|
|
|
|
if (mismatchGridList.size() > NumConstant.ZERO){ |
|
|
|
this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); |
|
|
|
} |
|
|
|
mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); |
|
|
|
} else { |
|
|
|
// 将所有的网格按照 4种类型,各赋一遍默认值
|
|
|
|
List<ScreenCustomerGridDTO> mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); |
|
|
|
this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); |
|
|
|
mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); |
|
|
|
} |
|
|
|
boolean delFlag = true; |
|
|
|
if (!CollectionUtils.isEmpty(mismatchGridList)){ |
|
|
|
// 如果进行不匹配查询,查到了其他网格信息,一律赋默认值
|
|
|
|
this.insertIndexMonthlyByGridDefaultScore(monthId, customerId, mismatchGridList); |
|
|
|
delFlag = false; |
|
|
|
} |
|
|
|
// 开始处理实际分数
|
|
|
|
// fact_index_grid_score 网格相关分值记录表 grid
|
|
|
|
List<FactIndexGridScoreDTO> gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); |
|
|
|
this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); |
|
|
|
// 开始处理实际分数
|
|
|
|
this.insertIndexDataMonthlyByGridScore(delFlag, monthId, customerId, gridScoreDTOS); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 将网格相关分值记录表中缺少的网格 数据,赋默认值 插入月表 screenIndexDataMonthlyDao |
|
|
|
* |
|
|
|
* @param monthId 202008 |
|
|
|
* @param customerId 客户id |
|
|
|
* @param gridScoreDTOS 网格相关分值记录表 当前客户不存在的网格数据集 |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
**/ |
|
|
|
private void insertIndexMonthlyByGridDefaultScore(String monthId, String customerId, List<ScreenCustomerGridDTO> gridScoreDTOS){ |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
for (int i = NumConstant.ZERO; i < gridScoreDTOS.size(); i++){ |
|
|
|
IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
monthlyDTO.setIndexTotal(zero); |
|
|
|
monthlyDTO.setPartyDevAblity(zero); |
|
|
|
monthlyDTO.setServiceAblity(zero); |
|
|
|
monthlyDTO.setGovernAblity(zero); |
|
|
|
// 补充表中其他字段
|
|
|
|
monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScoreDTOS.get(i).getGridId(), |
|
|
|
gridScoreDTOS.get(i).getParentAgencyId(), gridScoreDTOS.get(i).getGridName(), monthlyDTO); |
|
|
|
monthlyFormDTOList.add(monthlyDTO); |
|
|
|
} |
|
|
|
int deleteNum; |
|
|
|
do { |
|
|
|
deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId,monthId); |
|
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
* |
|
|
|
* @param delFlag true: 执行删除语句;false:已经删过一次了,本次只添加不删除 |
|
|
|
* @param monthId 202008 |
|
|
|
* @param customerId 客户id |
|
|
|
* @param gridScoreDTOS 网格相关分值记录表 当前客户所属月份数据集 |
|
|
@ -270,7 +303,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
**/ |
|
|
|
private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List<FactIndexGridScoreDTO> gridScoreDTOS){ |
|
|
|
private void insertIndexDataMonthlyByGridScore(boolean delFlag, String monthId, String customerId, List<FactIndexGridScoreDTO> gridScoreDTOS){ |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
// 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据
|
|
|
|
Map<String, List<FactIndexGridScoreDTO>> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); |
|
|
@ -313,14 +346,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
} |
|
|
|
if (monthlyFormDTOList.size() > NumConstant.ZERO){ |
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); |
|
|
|
if (delFlag){ |
|
|
|
int deleteNum; |
|
|
|
do { |
|
|
|
deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId,monthId); |
|
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
|
} |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) |
|
|
|
* 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入社区相关分值表。 一对四 |
|
|
|
* 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入 指数-指数数据(月表) |
|
|
|
* |
|
|
|
* @param monthId |
|
|
|
* @param customerId |
|
|
@ -329,6 +367,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
* @Date 13:44 2020-09-04 |
|
|
|
**/ |
|
|
|
private void startHandleIndexCommunityScore(String monthId, String customerId){ |
|
|
|
List<ScreenCustomerAgencyEntity> mismatchAgencyList = new ArrayList<>(); |
|
|
|
// 查询社区相关分值记录id
|
|
|
|
List<String> indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); |
|
|
|
if (indexCommunityIds.size() > NumConstant.ZERO){ |
|
|
@ -338,23 +377,48 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
communityIds[i] = indexCommunityIds.get(i); |
|
|
|
} |
|
|
|
// 进行不匹配查询(即返回社区相关分值表 中不存在的社区信息)。
|
|
|
|
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); |
|
|
|
// 将 社区相关分数表 中,本月份没有的社区信息,按照 4种类型,各新增一遍,赋默认值 0
|
|
|
|
if (mismatchAgencyList.size() > NumConstant.ZERO){ |
|
|
|
this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); |
|
|
|
} |
|
|
|
mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); |
|
|
|
} else { |
|
|
|
// 将所有的社区按照 4种类型,各赋一遍默认值
|
|
|
|
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); |
|
|
|
this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); |
|
|
|
mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(mismatchAgencyList)){ |
|
|
|
// 如果进行不匹配查询,查到了其他社区信息,一律赋默认值
|
|
|
|
this.insertIndexMonthlyByAgencyDefaultScore(monthId, customerId, mismatchAgencyList); |
|
|
|
} |
|
|
|
// 开始处理实际分数
|
|
|
|
// fact_index_community_score 社区相关分数表 agency
|
|
|
|
// 查询社区相关分值记录
|
|
|
|
List<FactIndexCommunityScoreDTO> communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); |
|
|
|
// 开始处理实际分数
|
|
|
|
this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 将 社区相关分数表 中缺少的部门 数据,赋默认值 插入月表 screenIndexDataMonthlyDao |
|
|
|
* |
|
|
|
* @param monthId 202008 |
|
|
|
* @param customerId 客户id |
|
|
|
* @param communityScoreDTOS 社区相关分数表 当前客户不存在的网格数据集 |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
**/ |
|
|
|
private void insertIndexMonthlyByAgencyDefaultScore(String monthId, String customerId, List<ScreenCustomerAgencyEntity> communityScoreDTOS){ |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
for (int i = NumConstant.ZERO; i < communityScoreDTOS.size(); i++){ |
|
|
|
IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
monthlyDTO.setIndexTotal(zero); |
|
|
|
monthlyDTO.setPartyDevAblity(zero); |
|
|
|
monthlyDTO.setServiceAblity(zero); |
|
|
|
monthlyDTO.setGovernAblity(zero); |
|
|
|
// 补充表中其他字段
|
|
|
|
monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, communityScoreDTOS.get(i).getAgencyId(), |
|
|
|
communityScoreDTOS.get(i).getPid(), communityScoreDTOS.get(i).getAgencyName(), monthlyDTO); |
|
|
|
monthlyFormDTOList.add(monthlyDTO); |
|
|
|
} |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
* |
|
|
@ -409,14 +473,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
} |
|
|
|
if (monthlyFormDTOList.size() > NumConstant.ZERO){ |
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) |
|
|
|
* 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 区直部门分值表。 一对四 |
|
|
|
* 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 指数-指数数据(月表) |
|
|
|
* |
|
|
|
* @param monthId |
|
|
|
* @param customerId |
|
|
@ -425,6 +488,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
* @Date 13:44 2020-09-04 |
|
|
|
**/ |
|
|
|
private void startHandleIndexDeptScore(String monthId, String customerId){ |
|
|
|
List<ScreenCustomerDeptEntity> mismatchDeptList = new ArrayList<>(); |
|
|
|
// 查询社 区直部门分值表
|
|
|
|
List<String> indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); |
|
|
|
if (indexDeptIds.size() > NumConstant.ZERO){ |
|
|
@ -432,21 +496,48 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
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); |
|
|
|
} |
|
|
|
mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); |
|
|
|
} else { |
|
|
|
List<ScreenCustomerDeptEntity> mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); |
|
|
|
this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); |
|
|
|
mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(mismatchDeptList)){ |
|
|
|
// 如果进行不匹配查询,查到了其他部门信息,一律赋默认值
|
|
|
|
this.insertIndexMonthlyByDeptDefaultScore(monthId, customerId, mismatchDeptList); |
|
|
|
} |
|
|
|
// 开始处理实际分数
|
|
|
|
// fact_index_dept_score 区直部门分值表 department
|
|
|
|
// 查询社 区直部门分值表
|
|
|
|
List<DeptScoreDTO> deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); |
|
|
|
// 开始处理实际分数
|
|
|
|
this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 将 区直部门分值表 中缺少的部门 数据,赋默认值 插入月表 screenIndexDataMonthlyDao |
|
|
|
* |
|
|
|
* @param monthId 202008 |
|
|
|
* @param customerId 客户id |
|
|
|
* @param deptScoreDTOS 区直部门分值表 当前客户不存在的部门数据集 |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
**/ |
|
|
|
private void insertIndexMonthlyByDeptDefaultScore(String monthId, String customerId, List<ScreenCustomerDeptEntity> deptScoreDTOS){ |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
for (int i = NumConstant.ZERO; i < deptScoreDTOS.size(); i++){ |
|
|
|
IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
monthlyDTO.setIndexTotal(zero); |
|
|
|
monthlyDTO.setPartyDevAblity(zero); |
|
|
|
monthlyDTO.setServiceAblity(zero); |
|
|
|
monthlyDTO.setGovernAblity(zero); |
|
|
|
// 补充表中其他字段
|
|
|
|
monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, deptScoreDTOS.get(i).getDeptId(), |
|
|
|
deptScoreDTOS.get(i).getParentAgencyId(), deptScoreDTOS.get(i).getDeptName(), monthlyDTO); |
|
|
|
monthlyFormDTOList.add(monthlyDTO); |
|
|
|
} |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
* |
|
|
@ -492,7 +583,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
} |
|
|
|
if (monthlyFormDTOList.size() > NumConstant.ZERO){ |
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
} |
|
|
@ -508,23 +598,23 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
* @Date 13:44 2020-09-04 |
|
|
|
**/ |
|
|
|
private void startHandleIndexAgencyScore(String monthId, String customerId){ |
|
|
|
List<ScreenCustomerAgencyEntity> mismatchAgencyList = new ArrayList<>(); |
|
|
|
List<String> indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); |
|
|
|
if (indexAgencyIds.size() > NumConstant.ZERO){ |
|
|
|
String[] agencyIds = new String[indexAgencyIds.size()]; |
|
|
|
for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ |
|
|
|
agencyIds[i] = indexAgencyIds.get(i); |
|
|
|
} |
|
|
|
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); |
|
|
|
if (mismatchAgencyList.size() > NumConstant.ZERO){ |
|
|
|
this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); |
|
|
|
} |
|
|
|
mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); |
|
|
|
} else { |
|
|
|
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); |
|
|
|
this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); |
|
|
|
mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(mismatchAgencyList)){ |
|
|
|
this.insertIndexMonthlyByAgencyDefaultScore(monthId, customerId, mismatchAgencyList); |
|
|
|
} |
|
|
|
// 开始处理实际分数
|
|
|
|
// fact_index_agency_score 区/街道相关分数表 agency
|
|
|
|
List<AgencyScoreDTO> agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); |
|
|
|
// 开始处理实际分数
|
|
|
|
this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); |
|
|
|
} |
|
|
|
|
|
|
@ -577,7 +667,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
} |
|
|
|
if (monthlyFormDTOList.size() > NumConstant.ZERO){ |
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); |
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
} |
|
|
|
} |
|
|
@ -647,195 +736,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
return monthlyFormDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增 网格相关分值记录表 默认值,一条网格,按照组织类别的不同 需要插入4次 |
|
|
|
* |
|
|
|
* @param monthId 例:202008 |
|
|
|
* @param customerId |
|
|
|
* @param mismatchGridList 网格相关分值记录表 中缺少的网格集合 |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:02 2020-09-04 |
|
|
|
**/ |
|
|
|
private void insertIndexGridScoreDefaultValue(String monthId, String customerId, List<ScreenCustomerGridDTO> mismatchGridList){ |
|
|
|
List<FactIndexGridScoreDTO> insertIndexGridScoreDTOS = new ArrayList<>(); |
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
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(getYearStr(monthId)); |
|
|
|
indexGridScoreDTO.setMonthId(monthId); |
|
|
|
// 0 or 1
|
|
|
|
indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); |
|
|
|
indexGridScoreDTO.setScore(zero); |
|
|
|
indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); |
|
|
|
indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); |
|
|
|
insertIndexGridScoreDTOS.add(indexGridScoreDTO); |
|
|
|
|
|
|
|
FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); |
|
|
|
// 赋默认值 - 治理能力
|
|
|
|
indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); |
|
|
|
insertIndexGridScoreDTOS.add(indexGridScoreDTO1); |
|
|
|
|
|
|
|
FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); |
|
|
|
// 赋默认值 - 服务能力
|
|
|
|
indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); |
|
|
|
insertIndexGridScoreDTOS.add(indexGridScoreDTO2); |
|
|
|
|
|
|
|
FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); |
|
|
|
indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); |
|
|
|
// 赋默认值 - 网格相关
|
|
|
|
indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); |
|
|
|
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 insertIndexCommunityScoreDefaultValue(String monthId, String customerId, List<ScreenCustomerAgencyEntity> mismatchAgencyList){ |
|
|
|
List<FactIndexCommunityScoreEntity> insertIndexCommunityScore = new ArrayList<>(); |
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
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(getYearStr(monthId)); |
|
|
|
communityScore1.setMonthId(monthId); |
|
|
|
// 0 or 1
|
|
|
|
communityScore1.setIsTotal(NumConstant.ZERO_STR); |
|
|
|
communityScore1.setScore(zero); |
|
|
|
communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); |
|
|
|
insertIndexCommunityScore.add(communityScore1); |
|
|
|
|
|
|
|
// 赋默认值 - 治理能力
|
|
|
|
FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); |
|
|
|
communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); |
|
|
|
insertIndexCommunityScore.add(communityScore2); |
|
|
|
|
|
|
|
// 赋默认值 - 服务能力
|
|
|
|
FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); |
|
|
|
communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); |
|
|
|
insertIndexCommunityScore.add(communityScore3); |
|
|
|
|
|
|
|
// 赋默认值 - 社区相关
|
|
|
|
FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); |
|
|
|
communityScore4.setIsTotal(NumConstant.ONE_STR); |
|
|
|
communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); |
|
|
|
insertIndexCommunityScore.add(communityScore4); |
|
|
|
} |
|
|
|
factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增 区直部门分值表 默认值,一条部门id,按照组织类别的不同 需要插入1次 |
|
|
|
* |
|
|
|
* @param monthId |
|
|
|
* @param customerId |
|
|
|
* @param mismatchDeptList |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:02 2020-09-04 |
|
|
|
**/ |
|
|
|
private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerDeptEntity> mismatchDeptList){ |
|
|
|
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(getYearStr(monthId)); |
|
|
|
deptScore2.setMonthId(monthId); |
|
|
|
deptScore2.setIsTotal(NumConstant.ZERO_STR); |
|
|
|
deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); |
|
|
|
deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); |
|
|
|
deptScore2.setDelFlag(NumConstant.ZERO_STR); |
|
|
|
insertIndexDeptScore.add(deptScore2); |
|
|
|
} |
|
|
|
deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增 区/街道相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 |
|
|
|
* |
|
|
|
* @param monthId |
|
|
|
* @param customerId |
|
|
|
* @param mismatchAgencyList |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 14:02 2020-09-04 |
|
|
|
**/ |
|
|
|
private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerAgencyEntity> mismatchAgencyList){ |
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
List<AgencyScoreEntity> insertIndexAgencyScore = new ArrayList<>(); |
|
|
|
for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ |
|
|
|
if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) |
|
|
|
|| OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ |
|
|
|
AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); |
|
|
|
// 赋默认值 - 党建能力指数
|
|
|
|
agencyScore1.setAgencyId(agencyDTO.getAgencyId()); |
|
|
|
agencyScore1.setParentAgencyId(agencyDTO.getPid()); |
|
|
|
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
|
|
|
|
agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); |
|
|
|
agencyScore1.setYearId(getYearStr(monthId)); |
|
|
|
agencyScore1.setMonthId(monthId); |
|
|
|
// 0 or 1
|
|
|
|
agencyScore1.setIsTotal(NumConstant.ZERO_STR); |
|
|
|
agencyScore1.setScore(zero); |
|
|
|
agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); |
|
|
|
|
|
|
|
AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); |
|
|
|
// 赋默认值 - 治理能力
|
|
|
|
agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); |
|
|
|
|
|
|
|
AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); |
|
|
|
// 赋默认值 - 服务能力
|
|
|
|
agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); |
|
|
|
|
|
|
|
AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); |
|
|
|
agencyScore4.setIsTotal(NumConstant.ONE_STR); |
|
|
|
if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){ |
|
|
|
// 赋默认值 - 全区相关
|
|
|
|
agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); |
|
|
|
agencyScore4.setDataType(OrgTypeConstant.DISTRICT); |
|
|
|
agencyScore1.setDataType(OrgTypeConstant.DISTRICT); |
|
|
|
agencyScore2.setDataType(OrgTypeConstant.DISTRICT); |
|
|
|
agencyScore3.setDataType(OrgTypeConstant.DISTRICT); |
|
|
|
} else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ |
|
|
|
// 赋默认值 - 街道相关
|
|
|
|
agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); |
|
|
|
agencyScore4.setDataType(OrgTypeConstant.STREET); |
|
|
|
agencyScore1.setDataType(OrgTypeConstant.STREET); |
|
|
|
agencyScore2.setDataType(OrgTypeConstant.STREET); |
|
|
|
agencyScore3.setDataType(OrgTypeConstant.STREET); |
|
|
|
} |
|
|
|
insertIndexAgencyScore.add(agencyScore1); |
|
|
|
insertIndexAgencyScore.add(agencyScore2); |
|
|
|
insertIndexAgencyScore.add(agencyScore3); |
|
|
|
insertIndexAgencyScore.add(agencyScore4); |
|
|
|
} |
|
|
|
} |
|
|
|
agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly |
|
|
|
* |
|
|
@ -848,7 +748,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
private void insertIndexDataYear(String monthId, String customerId){ |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); |
|
|
|
if (monthlyFormList.size() > NumConstant.ZERO){ |
|
|
|
screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); |
|
|
|
int deleteNum; |
|
|
|
do { |
|
|
|
deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); |
|
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
|
List<IndexDataYearlyFormDTO> entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); |
|
|
|
screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); |
|
|
|
} |
|
|
|