jinpengyong
2023-08-11 010f4ba252db180fc7fea4d7cb1b84a0bca7479f
screen-api/src/main/java/com/moral/api/service/impl/HistoryFiveMinutelyServiceImpl.java
@@ -2,10 +2,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.ISqlSegment;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import com.baomidou.mybatisplus.core.conditions.segments.NormalSegmentList;
import com.moral.api.config.mybatis.MybatisPlusConfig;
import com.moral.api.entity.*;
import com.moral.api.mapper.HistoryFiveMinutelyMapper;
@@ -32,8 +29,6 @@
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
 * <p>
@@ -186,6 +181,9 @@
            datas.put("dataTime", time);
        } else {
            datas = queryLastDataByMac(mac);
            if (ObjectUtils.isEmpty(datas)){
                return null;
            }
        }
        //构建返回对象
        Map<String, Object> result = new HashMap<>();
@@ -305,8 +303,6 @@
        List<Object> list = new ArrayList<>();
        List<Map<String, Object>> mapList = new ArrayList<>();
        for (WindData data : windData) {
            //经度
            Double longitude = data.getLongitude();
            //纬度
@@ -353,25 +349,23 @@
        laLaMap.put("minLo", lomi);
        laLaMap.put("maxLa", lama);
        laLaMap.put("minLa", lami);
        Double lo1 = lomi - length * 0.00001141;
//        Double lo1 = lomi - length * 0.000001141 * 2;
       //Double lo1 = lomi - length * 0.000001141 * 2;
        Double lo2 = loma + length * 0.00001141;
//        Double lo2 = loma + length * 0.000001141 * 2;
//        Double la2 = lami - length * 0.000000899 * 2;
       //Double lo2 = loma + length * 0.000001141 * 2;
       //Double la2 = lami - length * 0.000000899 * 2;
        Double la2 = lami - length * 0.00000899;
//        Double la1 = lama + length * 0.000000899 * 2;
        //Double la1 = lama + length * 0.000000899 * 2;
        Double la1 = lama + length * 0.00000899;
        double dx = 0.00001141 * perdlen;
        double dy = 0.00000899 * perdlen;
//        double dx = 0.000001141 * perdlen * 2;
//        double dy = 0.000000899 * perdlen * 2;
       //double dx = 0.000001141 * perdlen * 2;
       //double dy = 0.000000899 * perdlen * 2;
        int nx = (int) Math.floor((lo2 - lo1) / dx);
        int ny = (int) Math.floor((la1 - la2) / dy);
        List<Double> uList = new ArrayList<>();
        List<Double> vList = new ArrayList<>();
@@ -430,6 +424,7 @@
            }
        }
        String uData = "\"" + "data" + "\"" + ": " + uList;
        String vData = "\"" + "data" + "\"" + ": " + vList;
@@ -447,6 +442,7 @@
        String s1 = "[" + "{" + header1 + ", " + uData + "}" + ", " + "{" + header2 + ", " + vData + "}" + "]";
        //System.out.println(s1);
        JSONArray jsonArray = JSONArray.parseArray(s1);
        list.add(jsonArray);
@@ -489,13 +485,5 @@
        }
        MybatisPlusConfig.tableName.remove();
        return result;
    }
    public static void main(String[] args) {
        ArrayList<Double> objects = new ArrayList<>();
        for (int i = 0; i < 7949760L; i++) {
            objects.add(0.0d);
        }
        System.out.println(objects.size());
    }
}