燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-06-16 73ff23c1359f5688760ea0279c526136414127ac
src/main/java/com/yssh/entity/Report.java
@@ -3,8 +3,6 @@
import com.yssh.utils.CalculateUtils;
import io.swagger.annotations.ApiModelProperty;
import java.text.SimpleDateFormat;
/**
 * 报告
 * @author WWW
@@ -21,61 +19,76 @@
    private double lat;
    @ApiModelProperty(value = "数值")
    private double value;
    private double val;
    @ApiModelProperty(value = "去年数值")
    private double lastVal;
    @ApiModelProperty(value = "时间")
    private String time;
    @ApiModelProperty(value = "500m范围最大值")
    private double max;
    @ApiModelProperty(value = "距离")
    private double dis;
    @ApiModelProperty(value = "风速")
    private double speed;
    @ApiModelProperty(value = "方向")
    private String dir;
    @ApiModelProperty(value = "500m范围最大值")
    private double maxVal;
    @ApiModelProperty(value = "距离")
    private double dis;
    @ApiModelProperty(value = "500m范围最大值的方向")
    private String maxDir;
    @ApiModelProperty(value = "是否一致")
    private int isSame;
    public Report() {
    }
    public Report(String name, double lon, double lat, double value, String time, double max, double dis, String dir) {
    public Report(String name, double lon, double lat, double val, double lastVal, String time, double speed, String dir, double maxVal, double dis, String maxDir, int isSame) {
        this.name = name;
        this.lon = lon;
        this.lat = lat;
        this.value = value;
        this.val = val;
        this.lastVal = lastVal;
        this.time = time;
        this.max = max;
        this.dis = dis;
        this.speed = speed;
        this.dir = dir;
        this.maxVal = maxVal;
        this.dis = dis;
        this.maxDir = maxDir;
        this.isSame = isSame;
    }
    /**
     * 计算生成报告
     */
    public static Report calcReport(WarningDetail wd, DistanceSuYuan suYuan) {
        String[] sirs = wd.getSuYuanId().split("_");
        int x = Integer.parseInt(sirs[0]);
        int y = Integer.parseInt(sirs[1]);
        double lon = CalculateUtils.getLon(x, y);
        double lat = CalculateUtils.getLat(x, y);
    public static Report calcReport(WarningDetail wd, DistanceSuYuan suYuan, DistanceSuYuan suMax) {
        Coordinate c1 = CalculateUtils.getCoordinate(suYuan);
        Coordinate c2 = CalculateUtils.getCoordinate(suMax);
        String time = CalculateUtils.getYearMonthDayHour(wd.getCreateTime());
        String time = wd.getTableName().replace("su_yuan_", "");
        double lastVal = 0;
        double speed1 = CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU());
        double direction1 = CalculateUtils.getWindDirection(suYuan.getV(), suYuan.getU());
        String dir = CalculateUtils.getDir(direction1);
        double max = suYuan.getVocsValue();
        double maxVal = suMax.getVocsValue();
        String[] sirs2=suYuan.getId().split("_");
        int x2 = Integer.parseInt(sirs2[0]);
        int y2 = Integer.parseInt(sirs2[1]);
        double lon2 = CalculateUtils.getLon(x2, y2);
        double lat2 = CalculateUtils.getLat(x2, y2);
        double dis = CalculateUtils.getDistance2(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double dis1 = CalculateUtils.getDistance1(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double angle = CalculateUtils.getAngle(c1.getX(), c1.getY(), c2.getX(), c2.getY());
        double dis = CalculateUtils.getDistance2(lon, lat, lon2, lat2);
        double dis1 = CalculateUtils.getDistance1(lon, lat, lon2, lat2);
        double angle = CalculateUtils.getAngle(lon, lat, lon2, lat2);
        double speed2 = CalculateUtils.getWindSpeed(suMax.getV(), suMax.getU());
        double direction2 = CalculateUtils.getWindDirection(suMax.getV(), suMax.getU());
        String maxDir = CalculateUtils.getDir(direction2);
        int isSame = (Math.abs(direction1 - direction2) < 15 && Math.abs(speed1 - speed2) < 0.3) ? 1 : 0;
        String dir = "";
        return new Report(wd.getLocationName(), lon, lat, wd.getValue(), time, max, dis, dir);
        return new Report(wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), lastVal, time,
                speed1, dir, maxVal, dis, maxDir, isSame);
    }
    public String getName() {
@@ -102,12 +115,20 @@
        this.lat = lat;
    }
    public double getValue() {
        return value;
    public double getVal() {
        return val;
    }
    public void setValue(double value) {
        this.value = value;
    public void setVal(double val) {
        this.val = val;
    }
    public double getLastVal() {
        return lastVal;
    }
    public void setLastVal(double lastVal) {
        this.lastVal = lastVal;
    }
    public String getTime() {
@@ -118,12 +139,28 @@
        this.time = time;
    }
    public double getMax() {
        return max;
    public double getSpeed() {
        return speed;
    }
    public void setMax(double max) {
        this.max = max;
    public void setSpeed(double speed) {
        this.speed = speed;
    }
    public String getDir() {
        return dir;
    }
    public void setDir(String dir) {
        this.dir = dir;
    }
    public double getMaxVal() {
        return maxVal;
    }
    public void setMaxVal(double maxVal) {
        this.maxVal = maxVal;
    }
    public double getDis() {
@@ -134,11 +171,19 @@
        this.dis = dis;
    }
    public String getDir() {
        return dir;
    public String getMaxDir() {
        return maxDir;
    }
    public void setDir(String dir) {
        this.dir = dir;
    public void setMaxDir(String maxDir) {
        this.maxDir = maxDir;
    }
    public int getIsSame() {
        return isSame;
    }
    public void setIsSame(int isSame) {
        this.isSame = isSame;
    }
}