燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-19 48b8018a7f869840d7f076c8d83964ba7214ac9b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
package com.yssh.entity;
 
import com.yssh.utils.CalculateUtils;
import io.swagger.annotations.ApiModelProperty;
 
/**
 * 报告
 * @author WWW
 * @date 2023-06-18
 */
public class Report {
    @ApiModelProperty(value = "溯源ID")
    private String id;
 
    @ApiModelProperty(value = "点位名称")
    private String name;
 
    @ApiModelProperty(value = "经度")
    private double lon;
 
    @ApiModelProperty(value = "纬度")
    private double lat;
 
    @ApiModelProperty(value = "数值")
    private double val;
 
    @ApiModelProperty(value = "去年数值")
    private Double lastVal;
 
    @ApiModelProperty(value = "时间")
    private String time;
 
    @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;
 
    @ApiModelProperty(value = "最大值的ID")
    private String maxId;
 
    public Report() {
    }
 
    public Report(String id, String name, double lon, double lat, double val, String time, double speed, String dir, double maxVal, double dis, String maxDir, int isSame, String maxId) {
        this.id = id;
        this.name = name;
        this.lon = lon;
        this.lat = lat;
        this.val = val;
        this.time = time;
        this.speed = speed;
        this.dir = dir;
        this.maxVal = maxVal;
        this.dis = dis;
        this.maxDir = maxDir;
        this.isSame = isSame;
        this.maxId = maxId;
    }
 
    /**
     * 计算生成报告
     */
    public static Report calcReport(WarningDetail wd, DistanceSuYuan suYuan, DistanceSuYuan suMax) {
        Coordinate c1 = CalculateUtils.getCoordinate(suYuan);
        Coordinate c2 = CalculateUtils.getCoordinate(suMax);
 
        String time = wd.getTableName().replace("su_yuan_", "");
        double speed1 = CalculateUtils.round2(CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU()));
        double direction1 = CalculateUtils.getWindDirection(suYuan.getV(), suYuan.getU());
        String dir = CalculateUtils.getDir(direction1);
 
        double maxVal = suMax.getVocsValue();
 
        //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.getAngle2(c1.getX(), c1.getY(), c2.getX(), c2.getY());
 
        double speed2 = CalculateUtils.getWindSpeed(suMax.getV(), suMax.getU());
        double direction2 = CalculateUtils.getWindDirection(suMax.getV(), suMax.getU());
        String maxDir = CalculateUtils.getDir(direction2); // CalculateUtils.getDir(angle);
        int isSame = (Math.abs(direction1 - direction2) <= 45 && Math.abs(speed1 - speed2) <= 0.5) ? 1 : 0;
 
        String[] strs = suMax.getId().split("_");
        String maxId = (Integer.parseInt(strs[0]) / 10) + "_" + (Integer.parseInt(strs[1]) / 10);
 
        return new Report(wd.getSuYuanId(), wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), time,
                speed1, dir, maxVal, dis1, maxDir, isSame, maxId);
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public double getLon() {
        return lon;
    }
 
    public void setLon(double lon) {
        this.lon = lon;
    }
 
    public double getLat() {
        return lat;
    }
 
    public void setLat(double lat) {
        this.lat = lat;
    }
 
    public double getVal() {
        return val;
    }
 
    public void setVal(double val) {
        this.val = val;
    }
 
    public Double getLastVal() {
        return lastVal;
    }
 
    public void setLastVal(Double lastVal) {
        this.lastVal = lastVal;
    }
 
    public String getTime() {
        return time;
    }
 
    public void setTime(String time) {
        this.time = time;
    }
 
    public double getSpeed() {
        return speed;
    }
 
    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() {
        return dis;
    }
 
    public void setDis(double dis) {
        this.dis = dis;
    }
 
    public String getMaxDir() {
        return maxDir;
    }
 
    public void setMaxDir(String maxDir) {
        this.maxDir = maxDir;
    }
 
    public int getIsSame() {
        return isSame;
    }
 
    public void setIsSame(int isSame) {
        this.isSame = isSame;
    }
 
    public String getMaxId() {
        return maxId;
    }
 
    public void setMaxId(String maxId) {
        this.maxId = maxId;
    }
}