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