diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/enums/WeatherDataTypeEnum.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/enums/WeatherDataTypeEnum.java deleted file mode 100644 index 618c26b..0000000 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/enums/WeatherDataTypeEnum.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.jeecg.common.constant.enums; - -/** - * 文件类型说明枚举 - */ -public enum WeatherDataTypeEnum { - - - PANGU(0, "PANGU"), - CRA40(1, "CRA40"), - NCEP(2, "NCEP"); - - private Integer key; - - private String value; - - WeatherDataTypeEnum(Integer key, String value) { - this.key = key; - this.value = value; - } - - public Integer getKey(){ - return this.key; - } - - public String getValue(){ - return this.value; - } - - public static WeatherDataTypeEnum getInfoByKey(int key) { - for (WeatherDataTypeEnum info : WeatherDataTypeEnum.values()) { - if (info.getKey() == key) { - return info; - } - } - return null; - } - -} diff --git a/jeecg-module-weather/src/main/java/org/jeecg/service/impl/WeatherDataServiceImpl.java b/jeecg-module-weather/src/main/java/org/jeecg/service/impl/WeatherDataServiceImpl.java index df2494f..8967656 100644 --- a/jeecg-module-weather/src/main/java/org/jeecg/service/impl/WeatherDataServiceImpl.java +++ b/jeecg-module-weather/src/main/java/org/jeecg/service/impl/WeatherDataServiceImpl.java @@ -75,12 +75,12 @@ public class WeatherDataServiceImpl extends ServiceImpl variables = getVariableNames(dataType); - if(WeatherDataTypeEnum.PANGU.getKey() == dataType || WeatherDataTypeEnum.NCEP.getKey() == dataType){ + if(WeatherDataSourceEnum.PANGU.getKey() == dataType || WeatherDataSourceEnum.NCEP.getKey() == dataType){ try (NetcdfFile ncFile = NetcdfFile.open(filePath)) { // 读取数据(使用通用NcUtil方法) List> tData = getVariableData(ncFile, variables.get("temperature")); @@ -499,11 +499,11 @@ public class WeatherDataServiceImpl extends ServiceImpl> tData = null; List> pData = null; @@ -546,19 +546,19 @@ public class WeatherDataServiceImpl extends ServiceImpl getVariableNames(Integer dataType) { Map variables = new HashMap<>(); - if (WeatherDataTypeEnum.PANGU.getKey() == dataType) { + if (WeatherDataSourceEnum.PANGU.getKey() == dataType) { variables.put("temperature", WeatherVariableNameEnum.PANGU_T.getValue()); variables.put("pressure", WeatherVariableNameEnum.PANGU_P.getValue()); variables.put("humidity", WeatherVariableNameEnum.PANGU_H.getValue()); variables.put("windU", WeatherVariableNameEnum.PANGU_U.getValue()); variables.put("windV", WeatherVariableNameEnum.PANGU_V.getValue()); - } else if (WeatherDataTypeEnum.CRA40.getKey() == dataType){ + } else if (WeatherDataSourceEnum.CRA40.getKey() == dataType){ variables.put("temperature", WeatherVariableNameEnum.CRA40_T.getValue()); variables.put("pressure", WeatherVariableNameEnum.CRA40_P.getValue()); variables.put("humidity", WeatherVariableNameEnum.CRA40_H.getValue()); variables.put("windU", WeatherVariableNameEnum.CRA40_U.getValue()); variables.put("windV", WeatherVariableNameEnum.CRA40_V.getValue()); - } else if (WeatherDataTypeEnum.NCEP.getKey() == dataType){ + } else if (WeatherDataSourceEnum.NCEP.getKey() == dataType){ variables.put("temperature", WeatherVariableNameEnum.NCEP_T.getValue()); variables.put("pressure", WeatherVariableNameEnum.NCEP_P.getValue()); variables.put("humidity", WeatherVariableNameEnum.NCEP_H.getValue()); @@ -662,7 +662,7 @@ public class WeatherDataServiceImpl extends ServiceImpl