|
@@ -1,12 +1,28 @@
|
|
|
package com.example.mdd;
|
|
|
|
|
|
+import cn.hutool.db.DbUtil;
|
|
|
+import cn.hutool.db.ds.simple.SimpleDataSource;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
+import cn.hutool.json.JSONArray;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import com.example.mdd.entity.BaiDu;
|
|
|
+import com.example.mdd.entity.PowerStation;
|
|
|
import com.example.mdd.service.MeteorologicalDataDownload;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.sql.DataSource;
|
|
|
+import java.sql.Connection;
|
|
|
+import java.sql.PreparedStatement;
|
|
|
+import java.sql.SQLException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@SpringBootTest
|
|
|
+@Slf4j
|
|
|
class MddApplicationTests {
|
|
|
@Resource
|
|
|
MeteorologicalDataDownload mdd;
|
|
@@ -16,4 +32,425 @@ class MddApplicationTests {
|
|
|
mdd.download();
|
|
|
}
|
|
|
|
|
|
+ //补数据 插入时间8月5号为分界点之前的数据都是补的 补到哪算哪
|
|
|
+ @Test
|
|
|
+ void load() {
|
|
|
+ String body = HttpUtil.get("http://itil.jiayuepowertech.com:9958/itil/api/power-station", 10000);
|
|
|
+ JSONObject json = JSONUtil.parseObj(body);
|
|
|
+ String code = json.get("code").toString();
|
|
|
+ String data = json.get("data").toString();
|
|
|
+ if (code.equals("0") && !data.isEmpty()) {
|
|
|
+ JSONArray array = JSONUtil.parseArray(data);
|
|
|
+ //itil所有的场站数据 根据场站数据的经纬度通过气象平台的api接口查询数据
|
|
|
+ List<PowerStation> list = array.toList(PowerStation.class);
|
|
|
+ try {
|
|
|
+ DataSource ds = new SimpleDataSource("jdbc:mysql://192.168.12.10:23306/mdd"
|
|
|
+ , "root", "la!yibei82nianxueB");
|
|
|
+ Connection conn = DbUtil.use(ds).getConnection();
|
|
|
+ long time = 1722700800000L;
|
|
|
+ for (long i = time; i <= time; i = i - 86400000) {
|
|
|
+ for (PowerStation powerStation : list) {
|
|
|
+ if (!"".equals(powerStation.getLongitude()) && !"".equals(powerStation.getLatitude())) {
|
|
|
+ //heFengDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
|
|
|
+ //caiYunDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
|
|
|
+ //xinZhiDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
|
|
|
+ download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude(), new Date(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (SQLException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //去预测15天的数据 8月5号取8月6号到8月20号的数据
|
|
|
+ public void download(Connection conn, String stationCode, String longitude, String latitude, Date date) {
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ // 设置时间为明天
|
|
|
+ String day = sdf.format(date.getTime() + 86400000);
|
|
|
+ //第15天
|
|
|
+ String day14 = sdf.format(date.getTime() + 86400000 * 15);
|
|
|
+ //当天
|
|
|
+ String day0 = sdf.format(date.getTime());
|
|
|
+ //String[] fieldNames = getFieldName();
|
|
|
+ String fieldNames = "temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall,snow_depth,weather_code,pressure_msl,surface_pressure,cloud_cover,cloud_cover_low,cloud_cover_mid,cloud_cover_high,visibility,evapotranspiration,et0_fao_evapotranspiration,vapour_pressure_deficit,wind_speed_10m,wind_speed_80m,wind_speed_120m,wind_speed_180m,wind_direction_10m,wind_direction_80m,wind_direction_120m,wind_direction_180m,wind_gusts_10m,temperature_80m,temperature_120m,temperature_180m,soil_temperature_0cm,soil_temperature_6cm,soil_temperature_18cm,soil_temperature_54cm,soil_moisture_0_to_1cm,soil_moisture_1_to_3cm,soil_moisture_3_to_9cm,soil_moisture_9_to_27cm,soil_moisture_27_to_81cm,uv_index,uv_index_clear_sky,is_day,cape,freezing_level_height,sunshine_duration,shortwave_radiation,direct_radiation,diffuse_radiation,direct_normal_irradiance,global_tilted_irradiance,terrestrial_radiation,shortwave_radiation_instant,direct_radiation_instant,diffuse_radiation_instant,direct_normal_irradiance_instant,global_tilted_irradiance_instant,terrestrial_radiation_instant";
|
|
|
+
|
|
|
+ //彩云天气api接口
|
|
|
+ String url = "http://weather-api.xm-opt.com/v1/forecast15Minutes?longitude=" + longitude + "&latitude=" + latitude + "&start_date=" + day + "&end_date=" + day14 + "&timezone=Asia/Shanghai&minutely_15=" + fieldNames + ",&apikey=FG9yxRdv14HTwYOl";
|
|
|
+ String body = HttpUtil.createGet(url).execute().charset("utf-8").body();
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(body);
|
|
|
+ JSONObject result = JSONUtil.parseObj(jsonObject.get("minutely_15"));
|
|
|
+ // 将 JSONObject 转换为 Map
|
|
|
+ Map<String, Object> map = result.toBean(LinkedHashMap.class);
|
|
|
+ //map里的key都是BaiDu实体类的属性 怎么整合转换成一个list
|
|
|
+ // 创建一个 List 来存储 BaiDu 实例
|
|
|
+ List<BaiDu> baiduList = new ArrayList<>();
|
|
|
+ // 遍历 Map 的条目
|
|
|
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
|
|
|
+ // 获取当前属性名
|
|
|
+ String propertyName = entry.getKey();
|
|
|
+
|
|
|
+ // 获取当前属性的值列表
|
|
|
+ List<String> propertyValues = (List<String>) entry.getValue();
|
|
|
+
|
|
|
+ // 确保所有属性都有相同的值数量
|
|
|
+ if (baiduList.isEmpty()) {
|
|
|
+ // 第一次遍历时初始化列表大小
|
|
|
+ for (int i = 0; i < propertyValues.size(); i++) {
|
|
|
+ baiduList.add(new BaiDu());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 验证当前属性值的数量与之前的一致
|
|
|
+ if (propertyValues.size() != baiduList.size()) {
|
|
|
+ throw new IllegalArgumentException("Inconsistent number of values for property: " + propertyName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ extracted(propertyValues, propertyName, baiduList);
|
|
|
+ }
|
|
|
+ if (!baiduList.isEmpty()) {
|
|
|
+ String sql = "INSERT INTO baidu (" +
|
|
|
+ " time," +
|
|
|
+ " temperature_2m," +
|
|
|
+ " relative_humidity_2m," +
|
|
|
+ " dew_point_2m," +
|
|
|
+ " apparent_temperature," +
|
|
|
+ " precipitation_probability," +
|
|
|
+ " precipitation," +
|
|
|
+ " rain," +
|
|
|
+ " showers," +
|
|
|
+ " snowfall," +
|
|
|
+ " snow_depth," +
|
|
|
+ " weather_code," +
|
|
|
+ " pressure_msl," +
|
|
|
+ " surface_pressure," +
|
|
|
+ " cloud_cover," +
|
|
|
+ " cloud_cover_low," +
|
|
|
+ " cloud_cover_mid," +
|
|
|
+ " cloud_cover_high," +
|
|
|
+ " visibility," +
|
|
|
+ " evapotranspiration," +
|
|
|
+ " et0_fao_evapotranspiration," +
|
|
|
+ " vapour_pressure_deficit," +
|
|
|
+ " wind_speed_10m," +
|
|
|
+ " wind_speed_80m," +
|
|
|
+ " wind_speed_120m," +
|
|
|
+ " wind_speed_180m," +
|
|
|
+ " wind_direction_10m," +
|
|
|
+ " wind_direction_80m," +
|
|
|
+ " wind_direction_120m," +
|
|
|
+ " wind_direction_180m," +
|
|
|
+ " wind_gusts_10m," +
|
|
|
+ " temperature_80m," +
|
|
|
+ " temperature_120m," +
|
|
|
+ " temperature_180m," +
|
|
|
+ " soil_temperature_0cm," +
|
|
|
+ " soil_temperature_6cm," +
|
|
|
+ " soil_temperature_18cm," +
|
|
|
+ " soil_temperature_54cm," +
|
|
|
+ " soil_moisture_0_to_1cm," +
|
|
|
+ " soil_moisture_1_to_3cm," +
|
|
|
+ " soil_moisture_3_to_9cm," +
|
|
|
+ " soil_moisture_9_to_27cm," +
|
|
|
+ " soil_moisture_27_to_81cm," +
|
|
|
+ " uv_index," +
|
|
|
+ " uv_index_clear_sky," +
|
|
|
+ " is_day," +
|
|
|
+ " cape," +
|
|
|
+ " freezing_level_height," +
|
|
|
+ " sunshine_duration," +
|
|
|
+ " shortwave_radiation," +
|
|
|
+ " direct_radiation," +
|
|
|
+ " diffuse_radiation," +
|
|
|
+ " direct_normal_irradiance," +
|
|
|
+ " global_tilted_irradiance," +
|
|
|
+ " terrestrial_radiation," +
|
|
|
+ " shortwave_radiation_instant," +
|
|
|
+ " direct_radiation_instant," +
|
|
|
+ " diffuse_radiation_instant," +
|
|
|
+ " direct_normal_irradiance_instant," +
|
|
|
+ " global_tilted_irradiance_instant," +
|
|
|
+ " terrestrial_radiation_instant," +
|
|
|
+ " station_code," +
|
|
|
+ " insert_time" +
|
|
|
+ ")" +
|
|
|
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
+
|
|
|
+ try {
|
|
|
+ PreparedStatement pstmt = conn.prepareStatement(sql);
|
|
|
+ conn.setAutoCommit(false);
|
|
|
+ log.info("百度天气:共{}条记录", baiduList.size());
|
|
|
+ for (BaiDu b : baiduList) {
|
|
|
+ // 设置参数
|
|
|
+ pstmt.setString(1, b.getTime());
|
|
|
+ pstmt.setString(2, b.getTemperature_2m());
|
|
|
+ pstmt.setString(3, b.getRelative_humidity_2m());
|
|
|
+ pstmt.setString(4, b.getDew_point_2m());
|
|
|
+ pstmt.setString(5, b.getApparent_temperature());
|
|
|
+ pstmt.setString(6, b.getPrecipitation_probability());
|
|
|
+ pstmt.setString(7, b.getPrecipitation());
|
|
|
+ pstmt.setString(8, b.getRain());
|
|
|
+ pstmt.setString(9, b.getShowers());
|
|
|
+ pstmt.setString(10, b.getSnowfall());
|
|
|
+ pstmt.setString(11, b.getSnow_depth());
|
|
|
+ pstmt.setString(12, b.getWeather_code());
|
|
|
+ pstmt.setString(13, b.getPressure_msl());
|
|
|
+ pstmt.setString(14, b.getSurface_pressure());
|
|
|
+ pstmt.setString(15, b.getCloud_cover());
|
|
|
+ pstmt.setString(16, b.getCloud_cover_low());
|
|
|
+ pstmt.setString(17, b.getCloud_cover_mid());
|
|
|
+ pstmt.setString(18, b.getCloud_cover_high());
|
|
|
+ pstmt.setString(19, b.getVisibility());
|
|
|
+ pstmt.setString(20, b.getEvapotranspiration());
|
|
|
+ pstmt.setString(21, b.getEt0_fao_evapotranspiration());
|
|
|
+ pstmt.setString(22, b.getVapour_pressure_deficit());
|
|
|
+ pstmt.setString(23, b.getWind_speed_10m());
|
|
|
+ pstmt.setString(24, b.getWind_speed_80m());
|
|
|
+ pstmt.setString(25, b.getWind_speed_120m());
|
|
|
+ pstmt.setString(26, b.getWind_speed_180m());
|
|
|
+ pstmt.setString(27, b.getWind_direction_10m());
|
|
|
+ pstmt.setString(28, b.getWind_direction_80m());
|
|
|
+ pstmt.setString(29, b.getWind_direction_120m());
|
|
|
+ pstmt.setString(30, b.getWind_direction_180m());
|
|
|
+ pstmt.setString(31, b.getWind_gusts_10m());
|
|
|
+ pstmt.setString(32, b.getTemperature_80m());
|
|
|
+ pstmt.setString(33, b.getTemperature_120m());
|
|
|
+ pstmt.setString(34, b.getTemperature_180m());
|
|
|
+ pstmt.setString(35, b.getSoil_temperature_0cm());
|
|
|
+ pstmt.setString(36, b.getSoil_temperature_6cm());
|
|
|
+ pstmt.setString(37, b.getSoil_temperature_18cm());
|
|
|
+ pstmt.setString(38, b.getSoil_temperature_54cm());
|
|
|
+ pstmt.setString(39, b.getSoil_moisture_0_to_1cm());
|
|
|
+ pstmt.setString(40, b.getSoil_moisture_1_to_3cm());
|
|
|
+ pstmt.setString(41, b.getSoil_moisture_3_to_9cm());
|
|
|
+ pstmt.setString(42, b.getSoil_moisture_9_to_27cm());
|
|
|
+ pstmt.setString(43, b.getSoil_moisture_27_to_81cm());
|
|
|
+ pstmt.setString(44, b.getUv_index());
|
|
|
+ pstmt.setString(45, b.getUv_index_clear_sky());
|
|
|
+ pstmt.setString(46, b.getIs_day());
|
|
|
+ pstmt.setString(47, b.getCape());
|
|
|
+ pstmt.setString(48, b.getFreezing_level_height());
|
|
|
+ pstmt.setString(49, b.getSunshine_duration());
|
|
|
+ pstmt.setString(50, b.getShortwave_radiation());
|
|
|
+ pstmt.setString(51, b.getDirect_radiation());
|
|
|
+ pstmt.setString(52, b.getDiffuse_radiation());
|
|
|
+ pstmt.setString(53, b.getDirect_normal_irradiance());
|
|
|
+ pstmt.setString(54, b.getGlobal_tilted_irradiance());
|
|
|
+ pstmt.setString(55, b.getTerrestrial_radiation());
|
|
|
+ pstmt.setString(56, b.getShortwave_radiation_instant());
|
|
|
+ pstmt.setString(57, b.getDirect_radiation_instant());
|
|
|
+ pstmt.setString(58, b.getDiffuse_radiation_instant());
|
|
|
+ pstmt.setString(59, b.getDirect_normal_irradiance_instant());
|
|
|
+ pstmt.setString(60, b.getGlobal_tilted_irradiance_instant());
|
|
|
+ pstmt.setString(61, b.getTerrestrial_radiation_instant());
|
|
|
+ pstmt.setString(62, stationCode);
|
|
|
+ pstmt.setString(63, day0);
|
|
|
+ // 添加当前记录到批处理中
|
|
|
+ pstmt.addBatch();
|
|
|
+ }
|
|
|
+ pstmt.executeBatch();
|
|
|
+ conn.commit();
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("场站编号:{} ,{}下载:{}-{} 百度天气预测数据下载完成", stationCode, day0, day, day14);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void extracted(List<String> propertyValues, String propertyName, List<BaiDu> baiduList) {
|
|
|
+ // 设置每个 BaiDu 实例的属性
|
|
|
+ for (int i = 0; i < propertyValues.size(); i++) {
|
|
|
+ switch (propertyName) {
|
|
|
+ case "time":
|
|
|
+ baiduList.get(i).setTime(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "temperature_2m":
|
|
|
+ baiduList.get(i).setTemperature_2m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "relative_humidity_2m":
|
|
|
+ baiduList.get(i).setRelative_humidity_2m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "dew_point_2m":
|
|
|
+ baiduList.get(i).setDew_point_2m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "apparent_temperature":
|
|
|
+ baiduList.get(i).setApparent_temperature(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "precipitation_probability":
|
|
|
+ baiduList.get(i).setPrecipitation_probability(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "precipitation":
|
|
|
+ baiduList.get(i).setPrecipitation(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "rain":
|
|
|
+ baiduList.get(i).setRain(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "showers":
|
|
|
+ baiduList.get(i).setShowers(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "snowfall":
|
|
|
+ baiduList.get(i).setSnowfall(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "snow_depth":
|
|
|
+ baiduList.get(i).setSnow_depth(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "weather_code":
|
|
|
+ baiduList.get(i).setWeather_code(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "pressure_msl":
|
|
|
+ baiduList.get(i).setPressure_msl(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "surface_pressure":
|
|
|
+ baiduList.get(i).setSurface_pressure(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "cloud_cover":
|
|
|
+ baiduList.get(i).setCloud_cover(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "cloud_cover_low":
|
|
|
+ baiduList.get(i).setCloud_cover_low(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "cloud_cover_mid":
|
|
|
+ baiduList.get(i).setCloud_cover_mid(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "cloud_cover_high":
|
|
|
+ baiduList.get(i).setCloud_cover_high(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "visibility":
|
|
|
+ baiduList.get(i).setVisibility(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "evapotranspiration":
|
|
|
+ baiduList.get(i).setEvapotranspiration(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "et0_fao_evapotranspiration":
|
|
|
+ baiduList.get(i).setEt0_fao_evapotranspiration(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "vapour_pressure_deficit":
|
|
|
+ baiduList.get(i).setVapour_pressure_deficit(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_speed_10m":
|
|
|
+ baiduList.get(i).setWind_speed_10m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_speed_80m":
|
|
|
+ baiduList.get(i).setWind_speed_80m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_speed_120m":
|
|
|
+ baiduList.get(i).setWind_speed_120m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_speed_180m":
|
|
|
+ baiduList.get(i).setWind_speed_180m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_direction_10m":
|
|
|
+ baiduList.get(i).setWind_direction_10m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_direction_80m":
|
|
|
+ baiduList.get(i).setWind_direction_80m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_direction_120m":
|
|
|
+ baiduList.get(i).setWind_direction_120m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_direction_180m":
|
|
|
+ baiduList.get(i).setWind_direction_180m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "wind_gusts_10m":
|
|
|
+ baiduList.get(i).setWind_gusts_10m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "temperature_80m":
|
|
|
+ baiduList.get(i).setTemperature_80m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "temperature_120m":
|
|
|
+ baiduList.get(i).setTemperature_120m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "temperature_180m":
|
|
|
+ baiduList.get(i).setTemperature_180m(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_temperature_0cm":
|
|
|
+ baiduList.get(i).setSoil_temperature_0cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_temperature_6cm":
|
|
|
+ baiduList.get(i).setSoil_temperature_6cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_temperature_18cm":
|
|
|
+ baiduList.get(i).setSoil_temperature_18cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_temperature_54cm":
|
|
|
+ baiduList.get(i).setSoil_temperature_54cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_moisture_0_to_1cm":
|
|
|
+ baiduList.get(i).setSoil_moisture_0_to_1cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_moisture_1_to_3cm":
|
|
|
+ baiduList.get(i).setSoil_moisture_1_to_3cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_moisture_3_to_9cm":
|
|
|
+ baiduList.get(i).setSoil_moisture_3_to_9cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_moisture_9_to_27cm":
|
|
|
+ baiduList.get(i).setSoil_moisture_9_to_27cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "soil_moisture_27_to_81cm":
|
|
|
+ baiduList.get(i).setSoil_moisture_27_to_81cm(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "uv_index":
|
|
|
+ baiduList.get(i).setUv_index(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "uv_index_clear_sky":
|
|
|
+ baiduList.get(i).setUv_index_clear_sky(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "is_day":
|
|
|
+ baiduList.get(i).setIs_day(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "cape":
|
|
|
+ baiduList.get(i).setCape(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "freezing_level_height":
|
|
|
+ baiduList.get(i).setFreezing_level_height(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "sunshine_duration":
|
|
|
+ baiduList.get(i).setSunshine_duration(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "shortwave_radiation":
|
|
|
+ baiduList.get(i).setShortwave_radiation(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "direct_radiation":
|
|
|
+ baiduList.get(i).setDirect_radiation(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "diffuse_radiation":
|
|
|
+ baiduList.get(i).setDiffuse_radiation(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "direct_normal_irradiance":
|
|
|
+ baiduList.get(i).setDirect_normal_irradiance(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "global_tilted_irradiance":
|
|
|
+ baiduList.get(i).setGlobal_tilted_irradiance(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "terrestrial_radiation":
|
|
|
+ baiduList.get(i).setTerrestrial_radiation(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "shortwave_radiation_instant":
|
|
|
+ baiduList.get(i).setShortwave_radiation_instant(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "direct_radiation_instant":
|
|
|
+ baiduList.get(i).setDirect_radiation_instant(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "diffuse_radiation_instant":
|
|
|
+ baiduList.get(i).setDiffuse_radiation_instant(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "direct_normal_irradiance_instant":
|
|
|
+ baiduList.get(i).setDirect_normal_irradiance_instant(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "global_tilted_irradiance_instant":
|
|
|
+ baiduList.get(i).setGlobal_tilted_irradiance_instant(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ case "terrestrial_radiation_instant":
|
|
|
+ baiduList.get(i).setTerrestrial_radiation_instant(String.valueOf(propertyValues.get(i)));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ // 处理未知属性
|
|
|
+ throw new IllegalArgumentException("Unknown property: " + propertyName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|