| 
						
						
							
								
							
						
						
					 | 
					@ -4,6 +4,7 @@ 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.commons.tools.constant.StrConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.DateUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.constant.DataSourceConstant; | 
					 | 
					 | 
					import com.epmet.constant.DataSourceConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.constant.IndexCalConstant; | 
					 | 
					 | 
					import com.epmet.constant.IndexCalConstant; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -160,13 +161,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                indexMap.forEach((key, value) -> { | 
					 | 
					 | 
					                indexMap.forEach((key, value) -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    logger.info("index_code :{}",key); | 
					 | 
					 | 
					                    logger.info("index_code :{}",key); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    //列名不为空
 | 
					 | 
					 | 
					                    //列名不为空
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { | 
					 | 
					 | 
					                     if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                        //对应的数值
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        //构造样本值对象
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        SampleValue<BigDecimal> currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        value.getIndexValueVOs().add(currentGridIndexValue); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } else if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        //组织内党员的联系群众能力考评分(平均值)
 | 
					 | 
					 | 
					                        //组织内党员的联系群众能力考评分(平均值)
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); | 
					 | 
					 | 
					                        logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        //网格内党员的联系群众能力考评分(平均值)
 | 
					 | 
					 | 
					                        //网格内党员的联系群众能力考评分(平均值)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -174,6 +169,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); | 
					 | 
					 | 
					                        BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); | 
					 | 
					 | 
					                        SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        value.getIndexValueVOs().add(contactMassesAblityValue); | 
					 | 
					 | 
					                        value.getIndexValueVOs().add(contactMassesAblityValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        //对应的数值
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        logger.info("===================="+sampleValueStr); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        //构造样本值对象
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        SampleValue<BigDecimal> currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        value.getIndexValueVOs().add(currentGridIndexValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }); | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -287,9 +289,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                gridScoreEntity.setIndexCode(indexCode); | 
					 | 
					 | 
					                gridScoreEntity.setIndexCode(indexCode); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); | 
					 | 
					 | 
					                ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (null != screenCustomerGridDTO) { | 
					 | 
					 | 
					                if (null != screenCustomerGridDTO) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); | 
					 | 
					 | 
					                        gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); | 
					 | 
					 | 
					                        gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                gridScoreEntity.setQuarterId(quarterId); | 
					 | 
					 | 
					                gridScoreEntity.setQuarterId(quarterId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                gridScoreEntity.setYearId(yearId); | 
					 | 
					 | 
					                gridScoreEntity.setYearId(yearId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                gridScoreEntity.setMonthId(formDTO.getMonthId()); | 
					 | 
					 | 
					                gridScoreEntity.setMonthId(formDTO.getMonthId()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -442,18 +448,18 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                //遍历所有的指标
 | 
					 | 
					 | 
					                //遍历所有的指标
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                indexMap.forEach((key, value) -> { | 
					 | 
					 | 
					                indexMap.forEach((key, value) -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    //列名不为空
 | 
					 | 
					 | 
					                    //列名不为空
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { | 
					 | 
					 | 
					                    if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                        //对应的数值
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        //构造样本值对象
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        SampleValue<BigDecimal> currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        value.getIndexValueVOs().add(currentGridIndexValue); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); | 
					 | 
					 | 
					                        logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); | 
					 | 
					 | 
					                        String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); | 
					 | 
					 | 
					                        BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); | 
					 | 
					 | 
					                        SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        value.getIndexValueVOs().add(contactMassesAblityValue); | 
					 | 
					 | 
					                        value.getIndexValueVOs().add(contactMassesAblityValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        //对应的数值
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        //构造样本值对象
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        SampleValue<BigDecimal> currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        value.getIndexValueVOs().add(currentGridIndexValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }); | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -542,16 +548,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String, IndexGroupDetailEntity> indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); | 
					 | 
					 | 
					        Map<String, IndexGroupDetailEntity> indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<GridScoreEntity> gridScoreEntityList = new ArrayList<>(); | 
					 | 
					 | 
					        List<GridScoreEntity> gridScoreEntityList = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { | 
					 | 
					 | 
					        for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            GridScoreEntity gridScoreEntity = new GridScoreEntity(); | 
					 | 
					 | 
					            GridScoreEntity gridScoreEntity =  ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					            gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            gridScoreEntity.setGridId(gridScoreDTO.getGridId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            gridScoreEntity.setIsTotal(NumConstant.ONE_STR); | 
					 | 
					 | 
					            gridScoreEntity.setIsTotal(NumConstant.ONE_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            gridScoreEntity.setIndexCode(indexCode); | 
					 | 
					 | 
					            gridScoreEntity.setIndexCode(indexCode); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            gridScoreEntity.setAgencyId(gridScoreDTO.getAgencyId()); | 
					 | 
					 | 
					//            gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId());
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            gridScoreEntity.setAllParentIds(gridScoreDTO.getAllParentIds()); | 
					 | 
					 | 
					//            gridScoreEntity.setGridId(gridScoreDTO.getGridId());
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            gridScoreEntity.setQuarterId(gridScoreDTO.getQuarterId()); | 
					 | 
					 | 
					//            gridScoreEntity.setAgencyId(gridScoreDTO.getAgencyId());
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            gridScoreEntity.setYearId(gridScoreDTO.getYearId()); | 
					 | 
					 | 
					//            gridScoreEntity.setAllParentIds(gridScoreDTO.getAllParentIds());
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); | 
					 | 
					 | 
					//            gridScoreEntity.setQuarterId(gridScoreDTO.getQuarterId());
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//            gridScoreEntity.setYearId(gridScoreDTO.getYearId());
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//            gridScoreEntity.setMonthId(gridScoreDTO.getMonthId());
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            gridScoreEntity.setScore(BigDecimal.ZERO); | 
					 | 
					 | 
					            gridScoreEntity.setScore(BigDecimal.ZERO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { | 
					 | 
					 | 
					            if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                logger.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); | 
					 | 
					 | 
					                logger.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |