|
@ -3,14 +3,31 @@ package com.epmet.service.evaluationindex.indexcoll.impl; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
|
|
import com.epmet.constant.OrgTypeConstant; |
|
|
|
|
|
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; |
|
|
|
|
|
import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; |
|
|
import com.epmet.dao.evaluationindex.indexcoll.*; |
|
|
import com.epmet.dao.evaluationindex.indexcoll.*; |
|
|
|
|
|
import com.epmet.dao.evaluationindex.screen.*; |
|
|
|
|
|
import com.epmet.dto.ScreenCustomerGridDTO; |
|
|
|
|
|
import com.epmet.dto.indexcal.AgencyScoreDTO; |
|
|
|
|
|
import com.epmet.dto.indexcal.DeptScoreDTO; |
|
|
import com.epmet.dto.indexcollect.form.*; |
|
|
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.entity.evaluationindex.screen.ScreenCustomerDeptEntity; |
|
|
|
|
|
import com.epmet.entity.evaluationindex.screen.ScreenIndexDataMonthlyEntity; |
|
|
|
|
|
import com.epmet.eum.IndexCodeEnum; |
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; |
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Auther: zhangyong |
|
|
* @Auther: zhangyong |
|
@ -36,6 +53,24 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; |
|
|
private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; |
|
|
private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactIndexGridScoreDao factIndexGridScoreDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactIndexCommunityScoreDao factIndexCommunityScoreDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private DeptScoreDao deptScoreDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private AgencyScoreDao agencyScoreDaol; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScreenCustomerGridDao screenCustomerGridDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScreenCustomerDeptDao screenCustomerDeptDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScreenCustomerAgencyDao screenCustomerAgencyDao; |
|
|
|
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|
|
@Override |
|
|
@Override |
|
@ -160,4 +195,301 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); |
|
|
factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { |
|
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|
// 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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 插入年表 screen_index_data_yearly
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
|
|
* |
|
|
|
|
|
* @param month 08 |
|
|
|
|
|
* @param year 2020 |
|
|
|
|
|
* @param customerId 客户id |
|
|
|
|
|
* @param gridScoreDTOS 网格相关分值记录表 当前客户所属月份数据集 |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
|
|
**/ |
|
|
|
|
|
private void insertIndexDataMonthlyByGridScore(String month, String year, String customerId, List<FactIndexGridScoreDTO> gridScoreDTOS){ |
|
|
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
|
|
// 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据
|
|
|
|
|
|
Map<String, List<FactIndexGridScoreDTO>> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); |
|
|
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
|
|
int j = 0; |
|
|
|
|
|
for(Map.Entry<String,List<FactIndexGridScoreDTO>> gridScore : collect.entrySet()){ |
|
|
|
|
|
IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
|
|
// 网格id
|
|
|
|
|
|
orgIds[j] = gridScore.getKey(); |
|
|
|
|
|
j++; |
|
|
|
|
|
for ( int i = 0; i < gridScore.getValue().size(); i++){ |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){ |
|
|
|
|
|
// 是总分
|
|
|
|
|
|
if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())){ |
|
|
|
|
|
// 总指数 = 网格相关
|
|
|
|
|
|
monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 赋值 党建能力、治理能力、服务能力
|
|
|
|
|
|
monthlyFormDTO = this.setValueAblityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), |
|
|
|
|
|
gridScore.getValue().get(i).getScore(), |
|
|
|
|
|
monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 查询网格的 上级组织id 和 组织名称
|
|
|
|
|
|
ScreenCustomerGridDTO parentGridInfo = screenCustomerGridDao.selectParentGridInfo(customerId, gridScore.getKey()); |
|
|
|
|
|
if (null == parentGridInfo){ |
|
|
|
|
|
throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); |
|
|
|
|
|
} |
|
|
|
|
|
// 补充表中其他字段
|
|
|
|
|
|
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, gridScore.getKey(), |
|
|
|
|
|
parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO); |
|
|
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); |
|
|
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
|
|
* |
|
|
|
|
|
* @param month 08 |
|
|
|
|
|
* @param year 2020 |
|
|
|
|
|
* @param customerId 客户id |
|
|
|
|
|
* @param communityScoreDTOS 社区相关分数表 当前客户所属月份数据集 |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
|
|
**/ |
|
|
|
|
|
private void insertIndexDataMonthlyByCommunityScore(String month, String year, String customerId, List<FactIndexCommunityScoreDTO> communityScoreDTOS){ |
|
|
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
|
|
// 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据
|
|
|
|
|
|
Map<String, List<FactIndexCommunityScoreDTO>> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); |
|
|
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
|
|
int j = 0; |
|
|
|
|
|
for(Map.Entry<String,List<FactIndexCommunityScoreDTO>> communityScore : collect.entrySet()){ |
|
|
|
|
|
IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
|
|
// 组织id
|
|
|
|
|
|
orgIds[j] = communityScore.getKey(); |
|
|
|
|
|
j++; |
|
|
|
|
|
for ( int i = 0; i < communityScore.getValue().size(); i++){ |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){ |
|
|
|
|
|
// 是总分
|
|
|
|
|
|
if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())){ |
|
|
|
|
|
// 总指数 = 社区相关
|
|
|
|
|
|
monthlyFormDTO.setIndexTotal(communityScore.getValue().get(i).getScore()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 赋值 党建能力、治理能力、服务能力
|
|
|
|
|
|
monthlyFormDTO = this.setValueAblityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), |
|
|
|
|
|
communityScore.getValue().get(i).getScore(), |
|
|
|
|
|
monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 当前组织 的上级组织id
|
|
|
|
|
|
String parentAgencyId = communityScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); |
|
|
|
|
|
// 查询 组织名称
|
|
|
|
|
|
String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, communityScore.getKey()); |
|
|
|
|
|
if (null == agencyName){ |
|
|
|
|
|
throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); |
|
|
|
|
|
} |
|
|
|
|
|
// 补充表中其他字段
|
|
|
|
|
|
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, communityScore.getKey(), |
|
|
|
|
|
parentAgencyId, agencyName, monthlyFormDTO); |
|
|
|
|
|
// 补充表中其他字段
|
|
|
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); |
|
|
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
|
|
* |
|
|
|
|
|
* @param month 08 |
|
|
|
|
|
* @param year 2020 |
|
|
|
|
|
* @param customerId 客户id |
|
|
|
|
|
* @param deptScoreDTOS 区直部门分值表 当前客户所属月份数据集 |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
|
|
**/ |
|
|
|
|
|
private void insertIndexDataMonthlyByDeptScore(String month, String year, String customerId, List<DeptScoreDTO> deptScoreDTOS){ |
|
|
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
|
|
// 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据
|
|
|
|
|
|
Map<String, List<DeptScoreDTO>> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); |
|
|
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
|
|
int j = 0; |
|
|
|
|
|
for(Map.Entry<String,List<DeptScoreDTO>> deptScore : collect.entrySet()){ |
|
|
|
|
|
IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
|
|
// 部门id
|
|
|
|
|
|
orgIds[j] = deptScore.getKey(); |
|
|
|
|
|
j++; |
|
|
|
|
|
for ( int i = 0; i < deptScore.getValue().size(); i++){ |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(deptScore.getValue().get(i).getIsTotal())){ |
|
|
|
|
|
// 是总分 总指数 = IS_TOTAL = 1
|
|
|
|
|
|
monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 赋值 党建能力、治理能力、服务能力
|
|
|
|
|
|
monthlyFormDTO = this.setValueAblityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), |
|
|
|
|
|
deptScore.getValue().get(i).getScore(), |
|
|
|
|
|
monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 查询网格的 上级组织id 和 组织名称
|
|
|
|
|
|
ScreenCustomerDeptEntity parentDeptInfo = screenCustomerDeptDao.selectParentDeptInfo(customerId, deptScore.getKey()); |
|
|
|
|
|
if (null == parentDeptInfo){ |
|
|
|
|
|
throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); |
|
|
|
|
|
} |
|
|
|
|
|
// 补充表中其他字段
|
|
|
|
|
|
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, deptScore.getKey(), |
|
|
|
|
|
parentDeptInfo.getParentAgencyId(), parentDeptInfo.getDeptName(), monthlyFormDTO); |
|
|
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); |
|
|
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao |
|
|
|
|
|
* |
|
|
|
|
|
* @param month 08 |
|
|
|
|
|
* @param year 2020 |
|
|
|
|
|
* @param customerId 客户id |
|
|
|
|
|
* @param agencyScoreDTOS 区/街道相关分数表 当前客户所属月份数据集 |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 14:17 2020-09-03 |
|
|
|
|
|
**/ |
|
|
|
|
|
private void insertIndexDataMonthlyByAgencyScore(String month, String year, String customerId, List<AgencyScoreDTO> agencyScoreDTOS){ |
|
|
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
|
|
// 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据
|
|
|
|
|
|
Map<String, List<AgencyScoreDTO>> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); |
|
|
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
|
|
int j = 0; |
|
|
|
|
|
for(Map.Entry<String,List<AgencyScoreDTO>> agencyScore : collect.entrySet()){ |
|
|
|
|
|
IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); |
|
|
|
|
|
// 组织id(eg:社区或者街道id)
|
|
|
|
|
|
orgIds[j] = agencyScore.getKey(); |
|
|
|
|
|
j++; |
|
|
|
|
|
for ( int i = 0; i < agencyScore.getValue().size(); i++){ |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ |
|
|
|
|
|
// 是总分 总指数 = IS_TOTAL = 1
|
|
|
|
|
|
monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 赋值 党建能力、治理能力、服务能力
|
|
|
|
|
|
monthlyFormDTO = this.setValueAblityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), |
|
|
|
|
|
agencyScore.getValue().get(i).getScore(), |
|
|
|
|
|
monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 当前组织 的上级组织id
|
|
|
|
|
|
String parentAgencyId = agencyScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); |
|
|
|
|
|
// 查询 组织名称
|
|
|
|
|
|
String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, agencyScore.getKey()); |
|
|
|
|
|
if (null == agencyName){ |
|
|
|
|
|
throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); |
|
|
|
|
|
} |
|
|
|
|
|
// 补充表中其他字段
|
|
|
|
|
|
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, agencyScore.getKey(), |
|
|
|
|
|
parentAgencyId, agencyName, monthlyFormDTO); |
|
|
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); |
|
|
|
|
|
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 指数-指数数据(每月数值) 表 字段补全,待新增 |
|
|
|
|
|
* @param year 2020 |
|
|
|
|
|
* @param month 08 |
|
|
|
|
|
* @param orgType 组织类别 agency:组织;部门:department;网格:grid |
|
|
|
|
|
* @param orgId 组织Id 可以为网格,机关id |
|
|
|
|
|
* @param parentId 上级组织id |
|
|
|
|
|
* @param orgName 组织名称 |
|
|
|
|
|
* @param monthlyFormDTO 待新增的DTO |
|
|
|
|
|
* @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 15:29 2020-09-03 |
|
|
|
|
|
**/ |
|
|
|
|
|
private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String year, String month, String orgType, String orgId, String parentId, |
|
|
|
|
|
String orgName, IndexDataMonthlyFormDTO monthlyFormDTO){ |
|
|
|
|
|
monthlyFormDTO.setYearId(year); |
|
|
|
|
|
monthlyFormDTO.setMonthId(year + month); |
|
|
|
|
|
monthlyFormDTO.setOrgType(orgType); |
|
|
|
|
|
monthlyFormDTO.setOrgId(orgId); |
|
|
|
|
|
// 根据网格id,查询其上级组织id、组织名称
|
|
|
|
|
|
monthlyFormDTO.setParentId(parentId); |
|
|
|
|
|
monthlyFormDTO.setOrgName(orgName); |
|
|
|
|
|
return monthlyFormDTO; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 赋值 党建能力、治理能力、服务能力 |
|
|
|
|
|
* (总指数 赋默认值) |
|
|
|
|
|
* @param IndexCode 组织类别 |
|
|
|
|
|
* @param Score 分数 |
|
|
|
|
|
* @param monthlyFormDTO 待保存的数据 |
|
|
|
|
|
* @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO |
|
|
|
|
|
* @Author zhangyong |
|
|
|
|
|
* @Date 09:26 2020-09-04 |
|
|
|
|
|
**/ |
|
|
|
|
|
private IndexDataMonthlyFormDTO setValueAblityMonthlyFor(String IndexCode, BigDecimal Score, |
|
|
|
|
|
IndexDataMonthlyFormDTO monthlyFormDTO){ |
|
|
|
|
|
// 赋默认值
|
|
|
|
|
|
if (null == monthlyFormDTO.getIndexTotal() && null == monthlyFormDTO.getPartyDevAblity() |
|
|
|
|
|
&& null == monthlyFormDTO.getGovernAblity() && null == monthlyFormDTO.getServiceAblity()){ |
|
|
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
|
|
|
monthlyFormDTO.setIndexTotal(zero); |
|
|
|
|
|
monthlyFormDTO.setPartyDevAblity(zero); |
|
|
|
|
|
monthlyFormDTO.setGovernAblity(zero); |
|
|
|
|
|
monthlyFormDTO.setServiceAblity(zero); |
|
|
|
|
|
} |
|
|
|
|
|
// 赋实际值
|
|
|
|
|
|
if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){ |
|
|
|
|
|
// 党建能力
|
|
|
|
|
|
monthlyFormDTO.setPartyDevAblity(Score); |
|
|
|
|
|
} else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(IndexCode)){ |
|
|
|
|
|
// 治理能力
|
|
|
|
|
|
monthlyFormDTO.setGovernAblity(Score); |
|
|
|
|
|
} else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(IndexCode)){ |
|
|
|
|
|
// 服务能力
|
|
|
|
|
|
monthlyFormDTO.setServiceAblity(Score); |
|
|
|
|
|
} |
|
|
|
|
|
return monthlyFormDTO; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|