From 99042da077ad98e38340f96cb03ffcf4d249ab87 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 01 十一月 2024 13:49:21 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/entity/DistanceSuYuan.java | 181 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 181 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/yssh/entity/DistanceSuYuan.java b/src/main/java/com/yssh/entity/DistanceSuYuan.java new file mode 100644 index 0000000..25c3484 --- /dev/null +++ b/src/main/java/com/yssh/entity/DistanceSuYuan.java @@ -0,0 +1,181 @@ +package com.yssh.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.RoundingMode; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.yssh.utils.CalculateUtils; + +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@ToString +public class DistanceSuYuan implements Serializable, Comparable<DistanceSuYuan> { + private static final long serialVersionUID = -115407591473808022L; + + private String name; + + private String vocsName; + + private double vocsValue; + + private String id; + + @JsonIgnore + private Integer x; + + @JsonIgnore + private Integer y; + + @JsonIgnore + private double u; + + @JsonIgnore + private double v; + + @JsonIgnore + private String addr; + + private double windSpeed; + + private double windDirection; + + private double lon; + + private double lat; + + public DistanceSuYuan() { + } + + public DistanceSuYuan(String name, String vocsName, double vocsValue, String id, Integer x, Integer y, double u, double v, String addr, double windSpeed, double windDirection, double lon, double lat) { + this.name = name; + this.vocsName = vocsName; + this.vocsValue = vocsValue; + this.id = id; + this.x = x; + this.y = y; + this.u = u; + this.v = v; + this.addr = addr; + this.windSpeed = windSpeed; + this.windDirection = windDirection; + this.lon = lon; + this.lat = lat; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getX() { + return x; + } + + public void setX(Integer x) { + this.x = x; + } + + public Integer getY() { + return y; + } + + public void setY(Integer y) { + this.y = y; + } + + public double getLon() { + return CalculateUtils.getLon(x, y); + } + + public double getLat() { + return CalculateUtils.getLat(x, y); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getVocsName() { + return vocsName; + } + + public void setVocsName(String vocsName) { + this.vocsName = vocsName; + } + + public double getVocsValue() { + return vocsValue; + } + + public void setVocsValue(double vocsValue) { + this.vocsValue = vocsValue; + } + + public void setU(double u) { + this.u = u; + } + + public void setV(double v) { + this.v = v; + } + + public double getWindSpeed() { + return new BigDecimal(CalculateUtils.getWindSpeed(v, u)).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + + public double getWindDirection() { + return new BigDecimal(CalculateUtils.getWindDirection(v, u)).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + + @Override + public int compareTo(DistanceSuYuan o) { + if (vocsValue > o.getVocsValue()) { + return -1; + } else if (vocsValue == o.getVocsValue()) { + return 0; + } + return 1; + } + + public double getU() { + return u; + } + + public double getV() { + return v; + } + + public void setWindSpeed(double windSpeed) { + this.windSpeed = windSpeed; + } + + public void setWindDirection(double windDirection) { + this.windDirection = windDirection; + } + + public void setLon(double lon) { + this.lon = lon; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public String getAddr() { + return addr; + } + + public void setAddr(String addr) { + this.addr = addr; + } +} -- Gitblit v1.9.3