From ecc1ee9738e1a93c4479593002aab4ab25ff6380 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 11:59:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=BB=E5=88=86=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/CalculateCommonFormDTO.java | 4 ++++ .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) 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); }