diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java index ef21e6d023..e54f182903 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java @@ -14,4 +14,11 @@ public interface IndexCodeFieldReService { * @return */ Map getIndexCodeFieldReMap(); + + /** + * desc:根据指标code获取 对应的字段 + * @param indexCode + * @return + */ + String getFieldNameByIndexCode(String indexCode); } 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 8a6de15483..b03b0f948d 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 @@ -34,17 +34,20 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //计算最大最小值 Map minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxList)){ - log.warn("customerId:{} have not any fact record",formDTO.getCustomerId()); + log.warn("cpcIndexCalculate customerId:{} have not any fact record",formDTO.getCustomerId()); return false; } //获取指标权重信息 List indexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(),IndexCodeEnum.CAN_YU_YI_SHI.getCode()); if (CollectionUtils.isEmpty(indexDetails)){ - log.warn("customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); return false; } Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); - if (CollectionUtils.isEmpty(indexCodeFieldReList)) + if (CollectionUtils.isEmpty(indexCodeFieldReList)){ + log.warn("cpcIndexCalculate have any indexcodefieldre"); + return false; + } indexDetails.forEach(indexDetail->{ }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java index bc89fd6121..46ecffbcae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -16,13 +16,23 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { @Autowired private IndexCodeFieldReRedis indexCodeFieldReRedis; + @Override public Map getIndexCodeFieldReMap() { Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); - if (CollectionUtils.isEmpty(indexCodeFiledReMap)){ + if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { indexCodeFiledReMap = indexCodeFieldReDao.getAllData(); indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); } return indexCodeFiledReMap; } + + @Override + public String getFieldNameByIndexCode(String indexCode) { + Map indexCodeFieldReMap = this.getIndexCodeFieldReMap(); + if (CollectionUtils.isEmpty(indexCodeFieldReMap)) { + return null; + } + return indexCodeFieldReMap.get(indexCode); + } }