|
|
@ -281,6 +281,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
// 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据
|
|
|
|
Map<String, List<FactIndexGridScoreDTO>> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); |
|
|
|
// 查询网格的 上级组织id 和 组织名称
|
|
|
|
List<ScreenCustomerGridDTO> parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); |
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
int j = 0; |
|
|
|
for(Map.Entry<String,List<FactIndexGridScoreDTO>> gridScore : collect.entrySet()){ |
|
|
@ -304,14 +306,21 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
monthlyFormDTO); |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询网格的 上级组织id 和 组织名称
|
|
|
|
ScreenCustomerGridDTO parentGridInfo = screenCustomerGridDao.selectParentGridInfo(customerId, gridScore.getKey()); |
|
|
|
if (null == parentGridInfo){ |
|
|
|
// 匹配网格的 上级组织id 和 组织名称
|
|
|
|
String parentAgencyId = ""; |
|
|
|
String gridName = ""; |
|
|
|
for (ScreenCustomerGridDTO gridDTO : parentGridList){ |
|
|
|
if (gridScore.getKey().equals(gridDTO.getGridId())){ |
|
|
|
parentAgencyId = gridDTO.getParentAgencyId(); |
|
|
|
gridName = gridDTO.getGridName(); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("".equals(parentAgencyId)){ |
|
|
|
throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); |
|
|
|
} |
|
|
|
// 补充表中其他字段
|
|
|
|
monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), |
|
|
|
parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO); |
|
|
|
parentAgencyId, gridName, monthlyFormDTO); |
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
} |
|
|
|
if (monthlyFormDTOList.size() > NumConstant.ZERO){ |
|
|
@ -371,6 +380,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
// 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据
|
|
|
|
Map<String, List<FactIndexCommunityScoreDTO>> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); |
|
|
|
// 根据客户id,查询区/街道 组织名称、id
|
|
|
|
List<ScreenCustomerAgencyEntity> parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); |
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
int j = 0; |
|
|
|
for(Map.Entry<String,List<FactIndexCommunityScoreDTO>> communityScore : collect.entrySet()){ |
|
|
@ -397,9 +408,14 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
|
|
|
|
// 当前组织 的上级组织id
|
|
|
|
String parentAgencyId = communityScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); |
|
|
|
// 查询 组织名称
|
|
|
|
String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, communityScore.getKey()); |
|
|
|
if (null == agencyName){ |
|
|
|
// 获取 组织名称
|
|
|
|
String agencyName = ""; |
|
|
|
for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { |
|
|
|
if (communityScore.getKey().equals(agencyScoreDTO.getAgencyId())) { |
|
|
|
agencyName = agencyScoreDTO.getAgencyName(); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("".equals(agencyName)){ |
|
|
|
throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); |
|
|
|
} |
|
|
|
// 补充表中其他字段
|
|
|
@ -461,6 +477,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
// 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据
|
|
|
|
Map<String, List<DeptScoreDTO>> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); |
|
|
|
List<ScreenCustomerDeptEntity> parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); |
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
int j = 0; |
|
|
|
for(Map.Entry<String,List<DeptScoreDTO>> deptScore : collect.entrySet()){ |
|
|
@ -479,13 +496,20 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
monthlyFormDTO); |
|
|
|
} |
|
|
|
// 查询网格的 上级组织id 和 组织名称
|
|
|
|
ScreenCustomerDeptEntity parentDeptInfo = screenCustomerDeptDao.selectParentDeptInfo(customerId, deptScore.getKey()); |
|
|
|
if (null == parentDeptInfo){ |
|
|
|
String parentAgencyId = ""; |
|
|
|
String deptName = ""; |
|
|
|
for (ScreenCustomerDeptEntity deptEntity : parentDeptList) { |
|
|
|
if (deptScore.getKey().equals(deptEntity.getDeptId())) { |
|
|
|
parentAgencyId = deptEntity.getParentAgencyId(); |
|
|
|
deptName = deptEntity.getDeptName(); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("".equals(parentAgencyId)){ |
|
|
|
throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); |
|
|
|
} |
|
|
|
// 补充表中其他字段
|
|
|
|
monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, deptScore.getKey(), |
|
|
|
parentDeptInfo.getParentAgencyId(), parentDeptInfo.getDeptName(), monthlyFormDTO); |
|
|
|
parentAgencyId, deptName, monthlyFormDTO); |
|
|
|
monthlyFormDTOList.add(monthlyFormDTO); |
|
|
|
} |
|
|
|
if (monthlyFormDTOList.size() > NumConstant.ZERO){ |
|
|
@ -539,6 +563,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>(); |
|
|
|
// 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据
|
|
|
|
Map<String, List<AgencyScoreDTO>> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); |
|
|
|
List<ScreenCustomerAgencyEntity> parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); |
|
|
|
String[] orgIds = new String[collect.size()]; |
|
|
|
int j = 0; |
|
|
|
for(Map.Entry<String,List<AgencyScoreDTO>> agencyScore : collect.entrySet()){ |
|
|
@ -562,8 +587,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { |
|
|
|
// 当前组织 的上级组织id
|
|
|
|
String parentAgencyId = agencyScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); |
|
|
|
// 查询 组织名称
|
|
|
|
String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, agencyScore.getKey()); |
|
|
|
if (null == agencyName){ |
|
|
|
String agencyName = ""; |
|
|
|
for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { |
|
|
|
if (agencyScore.getKey().equals(agencyScoreDTO.getAgencyId())) { |
|
|
|
agencyName = agencyScoreDTO.getAgencyName(); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("".equals(agencyName)){ |
|
|
|
throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); |
|
|
|
} |
|
|
|
// 补充表中其他字段
|
|
|
|