package com.yssh.entity; import com.yssh.utils.CalculateUtils; import io.swagger.annotations.ApiModelProperty; import java.text.SimpleDateFormat; /** * 报告 * @author WWW * @date 2023-06-18 */ public class Report { @ApiModelProperty(value = "点位名称") private String name; @ApiModelProperty(value = "经度") private double lon; @ApiModelProperty(value = "纬度") private double lat; @ApiModelProperty(value = "数值") private double value; @ApiModelProperty(value = "时间") private String time; @ApiModelProperty(value = "500m范围最大值") private double max; @ApiModelProperty(value = "距离") private double dis; @ApiModelProperty(value = "方向") private String dir; public Report() { } public Report(String name, double lon, double lat, double value, String time, double max, double dis, String dir) { this.name = name; this.lon = lon; this.lat = lat; this.value = value; this.time = time; this.max = max; this.dis = dis; this.dir = dir; } /** * 计算生成报告 */ 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); String time = CalculateUtils.getYearMonthDayHour(wd.getCreateTime()); double max = suYuan.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(lon, lat, lon2, lat2); double dis1 = CalculateUtils.getDistance1(lon, lat, lon2, lat2); double angle = CalculateUtils.getAngle(lon, lat, lon2, lat2); String dir = ""; return new Report(wd.getLocationName(), lon, lat, wd.getValue(), time, max, dis, dir); } 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 getValue() { return value; } public void setValue(double value) { this.value = value; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public double getMax() { return max; } public void setMax(double max) { this.max = max; } public double getDis() { return dis; } public void setDis(double dis) { this.dis = dis; } public String getDir() { return dir; } public void setDir(String dir) { this.dir = dir; } }