diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index 4c43a57890..187f69c960 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -23,6 +23,10 @@ public class CalculateCommonFormDTO implements Serializable { */ private String customerId; + public CalculateCommonFormDTO() { + super(); + } + public CalculateCommonFormDTO(String customerId, String monthId) { this.monthId=monthId; this.customerId=customerId; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 588882b83f..fd79fc52e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -84,7 +84,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { if (totalEntity == null) { totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); totalEntity.setIsTotal(NumConstant.ONE_STR); - totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode()); + totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); totalEntity.setScore(new BigDecimal(0)); cpcScoreTotalMap.put(userId, totalEntity); } @@ -102,11 +102,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } private void calculatePartScore(CalculateCommonFormDTO formDTO) { - Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); - if (CollectionUtils.isEmpty(indexCodeFieldReList)) { - log.error("cpcIndexCalculate have any indexcodefieldre"); - throw new RenException("指标code与字段关系记录不存在"); - } //计算最大最小值 Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { @@ -186,6 +181,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { log.info("计算的结果:{}", result); //处理结果 + if (CollectionUtils.isEmpty(result)){ + log.error("calculateScore calculateScore return empty"); + return; + } saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); }