Browse Source

根据指标code获取feild

master
jianjun 5 years ago
parent
commit
756be3e5f0
  1. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java
  3. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java

7
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<String,String> getIndexCodeFieldReMap();
/**
* desc:根据指标code获取 对应的字段
* @param indexCode
* @return
*/
String getFieldNameByIndexCode(String indexCode);
}

9
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<String, BigDecimal> 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<IndexGroupDetailEntity> 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<String, String> indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap();
if (CollectionUtils.isEmpty(indexCodeFieldReList))
if (CollectionUtils.isEmpty(indexCodeFieldReList)){
log.warn("cpcIndexCalculate have any indexcodefieldre");
return false;
}
indexDetails.forEach(indexDetail->{
});

12
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<String, String> getIndexCodeFieldReMap() {
Map<String, String> 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<String, String> indexCodeFieldReMap = this.getIndexCodeFieldReMap();
if (CollectionUtils.isEmpty(indexCodeFieldReMap)) {
return null;
}
return indexCodeFieldReMap.get(indexCode);
}
}

Loading…
Cancel
Save