package com.jiayue.insu.incloud.pushdata;

import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.file.FileReader;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jiayue.insu.incloud.compermisson.BJZYYJYSDComPermisson;
import com.jiayue.insu.incloud.constants.CommonStant;
import com.jiayue.insu.incloud.constants.CompanyConstant;
import com.jiayue.insu.incloud.constants.enums.StatusEnum;
import com.jiayue.insu.incloud.constants.vo.ResponseLXVo;
import com.jiayue.insu.incloud.entity.ForecastDataLx;
import com.jiayue.insu.incloud.entity.IntegrationCompany;
import com.jiayue.insu.incloud.entity.Record;
import com.jiayue.insu.incloud.entity.Station;
import com.jiayue.insu.incloud.service.ForecastDataLxService;
import com.jiayue.insu.incloud.service.IntegrationCompanyService;
import com.jiayue.insu.incloud.service.RecordService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

/**
 * 林祥上送短期数据
 *
 * @author yh
 * @version 1.0
 * @since 2022/5/22 11:29
 */
@Component
@Slf4j
public class PushDataForLX implements IPushInitForecastData {
    @Autowired
    private RecordService recordService;
    @Autowired
    private IntegrationCompanyService integrationCompanyService;
    @Autowired
    BJZYYJYSDComPermisson bjzyyjysdComPermisson;
    @Autowired
    private ForecastDataLxService forecastDataLxService;

    @Value("${localFilePath.lxFilePath}")
    String lxFilePath;

    /**
     * 推送原始预测数据
     *
     * @param station 场站信息
     * @return 是否成功
     */
    @Override
    public Boolean pushDQAndNWPData(Station station) {
        return null;
    }

    /**
     * 将下载好的原始短期文件通过sftp推送
     *
     * @param station
     * @return
     */
    @Override
    public Boolean pushDQData(Station station) {

        IntegrationCompany integrationCompany = integrationCompanyService.findByCode(CompanyConstant.COMPANY_LX);
        // 获取场站编号
        String stationCode = station.getStationCode();
        Record record = null;

        // 安徽永武风光单独判断
        if ("J00797".equals(stationCode) || "J00637".equals(stationCode)) {

            LocalTime noon = LocalTime.NOON; // 12:00:00
            LocalDateTime noonToday = LocalDateTime.of(LocalDate.now(), noon);
            // 判断当前时间是否在中午12点之前
            if (LocalDateTime.now().isBefore(noonToday)) {
                record = new Record(CommonStant.RECORD_TYPE_PUSH_INIT, CompanyConstant.COMPANY_LX, stationCode, null, LocalDateTimeUtil.beginOfDay(LocalDateTime.now()), LocalDateTime.now(), null, null);

            } else {
                record = new Record(CommonStant.RECORD_TYPE_PUSH_INIT, CompanyConstant.COMPANY_LX, stationCode, null, LocalDateTime.now(), LocalDateTime.now(), null, null);
            }
        } else {
            record = new Record(CommonStant.RECORD_TYPE_PUSH_INIT, CompanyConstant.COMPANY_LX, stationCode, null, LocalDateTimeUtil.beginOfDay(LocalDateTime.now()), LocalDateTime.now(), null, null);
        }

        record.setState(StatusEnum.SUCCESS.getSign());
        // 如果场站编号为空，则返回
        if (stationCode == null || "".equals(stationCode)) {
            record.setState(StatusEnum.STATION_CODE_NULL.getSign());
            record.setStateContent(StatusEnum.STATION_CODE_NULL.getMsg());
            recordService.save(record);
            return false;
        }
        // 获取指定目录下的短期原始数据(/jiayue/insu/file/init/J00269/)
        String filePath = lxFilePath + stationCode + File.separatorChar;
        File files = new File(filePath);
        String[] fileNames = files.list();
        // 如果文件名列表为空
        if (fileNames == null || fileNames.length == 0) {
            log.info("指定目录下无文件");
            record.setState(StatusEnum.FILE_NULL.getSign());
            record.setStateContent(StatusEnum.FILE_NULL.getMsg());
            recordService.save(record);
            return false;
        }
        // 获取当天日期
        LocalDateTime today = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        String todayStr = today.format(formatter);
        // 转为list并根据日期筛选排序
        List<String> fileList = Arrays.stream(fileNames).collect(Collectors.toList());
        List<String> filterFileList = fileList.stream().filter(s -> s.contains(todayStr)).filter(s -> s.contains("DQ")).collect(Collectors.toList());
        // 如果筛选后无文件
        if (filterFileList.size() == 0) {
            log.info("无当日文件");
            record.setState(StatusEnum.FILE_NULL.getSign());
            record.setStateContent(StatusEnum.FILE_NULL.getMsg());
            recordService.save(record);
            return false;
        }
        filterFileList.sort(Collections.reverseOrder());
        // 获取原始文件
        File originalFile = new File(filterFileList.get(0));
        // 读取文件
        FileReader fileReader = new FileReader(filePath + originalFile);
        List<String> originalContents = fileReader.readLines();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        String genDate = dateFormat.format(new Date());

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        List<Double> dataList = new ArrayList<>();

        StringBuilder content = new StringBuilder();
        content = content.append(stationCode + "-dq|" + dateFormat.format(new Date(System.currentTimeMillis() + 24 * 60 * 60 * 1000L)) + "|");

        List<ForecastDataLx> forecastDataLxList = new ArrayList<>();

        List<ForecastDataLx> complementList = new ArrayList<>();

        List<ForecastDataLx> goOnList = new ArrayList<>();

        int i = 0;
        // 循环解析原始短期文件
        for (String originalContent : originalContents) {
            // 林祥上送数据开始时间为当天的00:00:00
            if (originalContent.contains("#")) {
                // 根据分隔符分割，取时间和功率
                String[] originalContentArr = originalContent.split("\t");

                // 如果分割后的数组长度小于4，则数据格式不正确
                if (originalContentArr.length < 4) {
                    continue;
                }
                // 上送三天数据
                try {
                    if ("J00797".equals(stationCode) || "J00637".equals(stationCode)) {
                        if (95 < i && i < 1248) {
                            content.append(Double.valueOf(originalContentArr[3])).append("|");
                            ForecastDataLx forecastDataLx = new ForecastDataLx();
                            forecastDataLx.setGenDate(genDate);
                            forecastDataLx.setFpValue(new BigDecimal(originalContentArr[3]));
                            forecastDataLx.setForecastTime(format.parse(originalContentArr[2]).getTime());
                            forecastDataLx.setStationCode(stationCode);
                            forecastDataLx.setInCode(station.getInCode());
                            // 预测日期yyyy-MM-dd
                            forecastDataLx.setForecastDate(dateFormat.format(new Date(forecastDataLx.getForecastTime())));
                            forecastDataLxList.add(forecastDataLx);
                            dataList.add(Double.valueOf(originalContentArr[3]));
                        }
                    } else {
                        if (95 < i && i < 1056){
                            content.append(Double.valueOf(originalContentArr[3])).append("|");
                            dataList.add(Double.valueOf(originalContentArr[3]));
                        }
                    }


                } catch (Exception e) {
                    e.printStackTrace();
                    break;
                }
                i++;
            }
        }

        if ("J00797".equals(stationCode) || "J00637".equals(stationCode)) {
            // 一次补数
            forecastDataLxList.stream().sorted(Comparator.comparing(ForecastDataLx::getForecastTime)).collect(Collectors.toList());

            AtomicReference<String> changeForecastDate = new AtomicReference<>(addOneDay(forecastDataLxList.get(forecastDataLxList.size() - 1).getForecastDate()));
            // 分组
            Map<String, List<ForecastDataLx>> groupedByForecastDate = forecastDataLxList.stream()
                    .collect(Collectors.groupingBy(ForecastDataLx::getForecastDate));
            groupedByForecastDate.forEach((date, list) -> {
                String[] result = changeForecastDate.get().split("--");
                String genDateSpilt = result[0];

                Long forecastSpit = Long.valueOf(result[1]);
                AtomicInteger flag = new AtomicInteger();
                BigDecimal random = new BigDecimal(getRandom());
                list.forEach(forecastData -> {
                    ForecastDataLx forecastDataLx = new ForecastDataLx();
                    forecastDataLx.setFpValue(forecastData.getFpValue().multiply(random).setScale(2, RoundingMode.HALF_DOWN));
                    forecastDataLx.setForecastDate(genDateSpilt);
                    Long forecast = forecastSpit + flag.get() * 15 * 60 * 1000L;
                    forecastDataLx.setForecastTime(forecast);
                    forecastDataLx.setStationCode(stationCode);
                    forecastDataLx.setInCode(station.getInCode());
                    flag.getAndIncrement();
                    complementList.add(forecastDataLx);
                });
                changeForecastDate.set(addOneDay(genDateSpilt));

            });

            // 二次补数
            complementList.stream().sorted(Comparator.comparing(ForecastDataLx::getForecastTime)).collect(Collectors.toList());

            AtomicReference<String> changeComplementDate = new AtomicReference<>(addOneDay(complementList.get(complementList.size() - 1).getForecastDate()));
            // 分组
            Map<String, List<ForecastDataLx>> groupedByComplement = complementList.stream()
                    .collect(Collectors.groupingBy(ForecastDataLx::getForecastDate));
            final int[] a = {0};
            groupedByComplement.forEach((date, list) -> {
                String[] result = changeComplementDate.get().split("--");
                String genDateSpilt = result[0];

                Long forecastSpit = Long.valueOf(result[1]);
                BigDecimal random = new BigDecimal(getRandom());
                if (a[0] <= 5) {
                    AtomicInteger flag = new AtomicInteger();
                    list.forEach(forecastData -> {
                        ForecastDataLx forecastDataLx = new ForecastDataLx();
                        forecastDataLx.setFpValue(forecastData.getFpValue().multiply(random).setScale(2, RoundingMode.HALF_DOWN));
                        forecastDataLx.setForecastDate(genDateSpilt);
                        Long forecast = forecastSpit + flag.get() * 15 * 60 * 1000L;
                        forecastDataLx.setForecastTime(forecast);
                        forecastDataLx.setStationCode(stationCode);
                        forecastDataLx.setInCode(station.getInCode());
                        flag.getAndIncrement();
                        goOnList.add(forecastDataLx);
                    });
                }
                changeComplementDate.set(addOneDay(genDateSpilt));
                a[0]++;
            });
            complementList.addAll(goOnList);

            complementList.stream().sorted(Comparator.comparing(ForecastDataLx::getForecastTime)).collect(Collectors.toList());
            for (ForecastDataLx forecastDataLx : complementList) {
                content.append(forecastDataLx.getFpValue().doubleValue()).append("|");
            }
            forecastDataLxList.addAll(complementList);
        }

        String body = content.toString();
        List<String> stringList = new ArrayList<>();
        stringList.add(body);
        String jsonString = "";
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            // 将 List<String> 转换为 JSON 格式的字符串
            jsonString = objectMapper.writeValueAsString(stringList);
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            String response;
            HttpRequest httpRequest = HttpRequest.post("http://61.155.87.36:4220/forecast/reportData")
             // 测试地址
//            HttpRequest httpRequest = HttpRequest.post("https://113.219.237.106:33631/forecast/reportData")
//            HttpRequest httpRequest = HttpRequest.post("http://112.2.27.4/forecast")
            // 本地测试地址
//            HttpRequest httpRequest = HttpRequest.post("https://127.0.0.1:9001/consoleOpenInterface/always200")
                    .header("Content-Type", "application/json");
            httpRequest.setGlobalTimeout(20000);
            response = httpRequest.body(jsonString).execute().body();

            ResponseLXVo responseLXVo = JSONUtil.toBean(response, ResponseLXVo.class);
            if (responseLXVo.getCode().equals("200")) {
                record.setState(StatusEnum.SUCCESS.getSign());
                record.setStateContent(responseLXVo.getMessage());
                log.info("=========={}:{} ==>上送短期原始数据成功  {}条==========", integrationCompany.getName(), station.getStationCode(), dataList.size());
//                log.info("{} 原始数据:{}", stationCode, body);
                recordService.save(record);
                forecastDataLxService.saveBatch(forecastDataLxList);
                return true;
            } else {
                log.error("=========={}:{} ==>上送数据失败 失败标识:{} ,失败原因：{} ==========", integrationCompany.getName(), station.getStationCode(), responseLXVo.getCode(), responseLXVo.getMessage());
                log.info("{} 原始数据:{}", stationCode, body);
                record.setState(StatusEnum.FILE_NULL.getSign());
                record.setStateContent(responseLXVo.getMessage());
                recordService.save(record);
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    @Override
    public Boolean pushNWPData(Station station) {
        IntegrationCompany integrationCompany = integrationCompanyService.findByCode(CompanyConstant.COMPANY_LX);
        // 获取场站编号
        String stationCode = station.getStationCode();
        Record record = new Record(CommonStant.RECORD_TYPE_PUSH_INIT_NWP, CompanyConstant.COMPANY_LX, stationCode, null, LocalDateTimeUtil.beginOfDay(LocalDateTime.now()), LocalDateTime.now(), null, null);
        record.setState(StatusEnum.SUCCESS.getSign());
        // 如果场站编号为空，则返回
        if (stationCode == null || "".equals(stationCode)) {
            record.setState(StatusEnum.STATION_CODE_NULL.getSign());
            record.setStateContent(StatusEnum.STATION_CODE_NULL.getMsg());
            recordService.save(record);
            return false;
        }
        // 获取指定目录下的短期原始数据(/jiayue/insu/file/init/J00269/)
        String filePath = lxFilePath + stationCode + File.separatorChar;
        File files = new File(filePath);
        String[] fileNames = files.list();
        // 如果文件名列表为空
        if (fileNames == null || fileNames.length == 0) {
            log.info("指定目录下无文件");
            record.setState(StatusEnum.FILE_NULL.getSign());
            record.setStateContent(StatusEnum.FILE_NULL.getMsg());
            recordService.save(record);
            return false;
        }
        // 获取当天日期
        LocalDateTime today = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        String todayStr = today.format(formatter);
        // 转为list并根据日期筛选排序
        List<String> fileList = Arrays.stream(fileNames).collect(Collectors.toList());
        List<String> filterFileList = fileList.stream().filter(s -> s.contains(todayStr)).filter(s -> s.contains("NWP")).collect(Collectors.toList());
        // 如果筛选后无文件
        if (filterFileList.size() == 0) {
            log.info("无当日文件");
            record.setState(StatusEnum.FILE_NULL.getSign());
            record.setStateContent(StatusEnum.FILE_NULL.getMsg());
            recordService.save(record);
            return false;
        }
        filterFileList.sort(Collections.reverseOrder());
        // 获取原始文件
        File originalFile = new File(filterFileList.get(0));
        // 读取文件
        FileReader fileReader = new FileReader(filePath + originalFile);
        List<String> originalContents = fileReader.readLines();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        String genDate = dateFormat.format(new Date());


        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");

        BigDecimal nwpDirectRadiation = new BigDecimal("0.7"); //直接辐射
        BigDecimal nwpDiffuseRadiation = new BigDecimal("0.3"); //散接辐射
        List<WeatherDataDetail> details = new ArrayList<>();
        int i = 0;
        // 循环解析原始NWP文件
        for (String originalContent : originalContents) {

            // 从有#的数据开始获取 数据示例：#1	帽子山光伏电站	2023-06-22 00:00:00	0.0
            if (originalContent.contains("#")) {

                // 根据分隔符分割，取时间和功率
                String[] originalContentArr = originalContent.split("\t");

                try {
                    // 刨除当天的数据
                    if (sdf.format(format.parse(originalContentArr[5])).contains(genDate)) {
                        continue;
                    }
                } catch (ParseException e) {
                    throw new RuntimeException(e);
                }
                // 如果分割后的数组长度小于4，则数据格式不正确
                if (originalContentArr.length < 35) {
                    continue;
                }
                try {
                    if (i<960){
                        WeatherDataDetail detail = new WeatherDataDetail();
                        detail.setTime(sdf.format(format.parse(originalContentArr[5])));
                        detail.setT(new BigDecimal(originalContentArr[6]).subtract(new BigDecimal("273.15")).toString());//温度
                        detail.setSwr(new BigDecimal(originalContentArr[9]).setScale(2, RoundingMode.HALF_UP).toString());//短波辐射(相当于总辐射)
                        detail.setP(new BigDecimal(originalContentArr[8]).setScale(2, RoundingMode.HALF_UP).toString());//地表气压
                        detail.setRh(new BigDecimal(originalContentArr[7]).setScale(2, RoundingMode.HALF_UP).toString());//2m相对湿度
                        detail.setDiffuseRadiation(new BigDecimal(originalContentArr[9]).multiply(nwpDiffuseRadiation).setScale(2, RoundingMode.HALF_UP).toString());//散接辐射
                        detail.setDirectRadiation(new BigDecimal(originalContentArr[9]).multiply(nwpDirectRadiation).setScale(2, RoundingMode.HALF_UP).toString());//直接辐射

                        detail.setWs10(new BigDecimal(originalContentArr[19]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs30(new BigDecimal(originalContentArr[20]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs50(new BigDecimal(originalContentArr[21]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs70(new BigDecimal(originalContentArr[22]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs80(new BigDecimal(originalContentArr[23]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs90(new BigDecimal(originalContentArr[24]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs100(new BigDecimal(originalContentArr[25]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWs170(new BigDecimal(originalContentArr[26]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd10(new BigDecimal(originalContentArr[27]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd30(new BigDecimal(originalContentArr[28]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd50(new BigDecimal(originalContentArr[29]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd70(new BigDecimal(originalContentArr[30]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd80(new BigDecimal(originalContentArr[31]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd90(new BigDecimal(originalContentArr[32]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd100(new BigDecimal(originalContentArr[33]).setScale(2, RoundingMode.HALF_UP).toString());
                        detail.setWd170(new BigDecimal(originalContentArr[34]).setScale(2, RoundingMode.HALF_UP).toString());
                        details.add(detail);
                        i++;

                    }

                } catch (Exception e) {
                    e.printStackTrace();
                    break;
                }
            }
        }
        WeatherDataValue value = new WeatherDataValue();
        value.setDatas(details);
        List<WeatherDataValue> values = new ArrayList<>();
        values.add(value);
        WeatherDataRequest request = new WeatherDataRequest();
        request.setStationId(stationCode);
        request.setDate(genDate);
        request.setValues(values);


        ObjectMapper objectMapper = new ObjectMapper();
        String json = null;
        try {
            json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(request);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }

        try {
            String response;
            // 测试地址
//            HttpRequest httpRequest = HttpRequest.post("https://frp-end.com:54383/forecast/reportMeteorologyData")
            // 正式地址
          HttpRequest httpRequest = HttpRequest.post("http://61.155.87.36:4220/forecast/reportMeteorologyData")

//            HttpRequest httpRequest = HttpRequest.post("")
//            HttpRequest httpRequest = HttpRequest.post("http://112.2.27.4/forecast")
                    .header("Content-Type", "application/json");
            httpRequest.setGlobalTimeout(20000);
            response = httpRequest.body(json).execute().body();

            ResponseLXVo responseLXVo = JSONUtil.toBean(response, ResponseLXVo.class);
            if (responseLXVo.getCode().equals("200")) {
                record.setState(StatusEnum.SUCCESS.getSign());
                record.setStateContent(responseLXVo.getMessage());
                log.info("=========={}:{} ==>上送NWP原始数据成功  {}条==========", integrationCompany.getName(), station.getStationCode(), details.size());
//                log.info("{} 原始数据:{}", stationCode, json);
                recordService.save(record);

                return true;
            } else {
                log.error("=========={}:{} ==>上送数据失败 失败标识:{} ,失败原因：{} ==========", integrationCompany.getName(), station.getStationCode(), responseLXVo.getCode(), responseLXVo.getMessage());
                record.setState(StatusEnum.FILE_NULL.getSign());
                record.setStateContent(responseLXVo.getMessage());
                recordService.save(record);
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    public String addOneDay(String lastForecastDateStr) {
        // 定义日期格式
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

        // 将字符串解析为 LocalDate
        LocalDate lastForecastDate = LocalDate.parse(lastForecastDateStr, formatter);

        // 加一天
        LocalDate nextForecastDate = lastForecastDate.plusDays(1);

        // 格式化为字符串
        String changeGenDate = nextForecastDate.format(formatter);

        String dateTime = changeGenDate + " 00:00:00";

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long forecast = 0L;
        try {
            forecast = simpleDateFormat.parse(dateTime).getTime();
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }

        return changeGenDate + "--" + forecast;
    }

    /**
     *  生成0.9~1.1之间不包括1的随机数
     * @return
     */
    public Double getRandom(){
        double decision = Math.random();

        double randomNumber;
        if (decision < 0.1) {

            randomNumber = 0.9 + (Math.random() * 0.2);
        } else {
            randomNumber = 0.9 + (Math.random() * 0.1);
        }
        return randomNumber;
    }

    @Data
    public class WeatherDataRequest {
        private String stationId;
        private String date;
        private List<WeatherDataValue> values;
    }

    @Data
    class WeatherDataValue {
        private List<WeatherDataDetail> datas;
    }

    @Data
    class WeatherDataDetail {
        private String time;
        private String swr;               // 总辐射
        private String directRadiation;   // 直辐射
        private String diffuseRadiation; // 散辐射
        private String t;                // 温度
        private String p;                // 气压
        private String rh;               // 湿度
        private String ws10;             // 10米风速
        private String ws30;             // 30米风速
        private String ws50;             // 50米风速
        private String ws70;             // 70米风速
        private String ws80;             // 80米风速
        private String ws90;             // 90米风速
        private String ws100;            // 100米风速
        private String ws170;            // 170米风速
        private String wd10;             // 10米风向
        private String wd30;             // 30米风向
        private String wd50;             // 50米风向
        private String wd70;             // 70米风向
        private String wd80;             // 80米风向
        private String wd90;             // 90米风向
        private String wd100;            // 100米风向
        private String wd170;            // 170米风向
    }
}
