From 38ba7d31832433ae355d36d7b5b956771b6b2a05 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4U0TDEF\\20371" <2037158277@qq.com> Date: Mon, 12 Jul 2021 16:09:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=81=AB=E7=82=B9?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=92=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/model/entity/FirePointEntity.java | 214 ++++++++++++++++++ .../java/com/xkrs/model/qo/FirePointQo.java | 155 +++++++++++++ .../java/com/xkrs/utils/DateTimeUtil.java | 10 + 3 files changed, 379 insertions(+) create mode 100644 src/main/java/com/xkrs/model/entity/FirePointEntity.java create mode 100644 src/main/java/com/xkrs/model/qo/FirePointQo.java diff --git a/src/main/java/com/xkrs/model/entity/FirePointEntity.java b/src/main/java/com/xkrs/model/entity/FirePointEntity.java new file mode 100644 index 0000000..9203bed --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/FirePointEntity.java @@ -0,0 +1,214 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @author XinYi Song + */ +@Entity +@Table(name="fire_point") +public class FirePointEntity implements Serializable { + + /** + * 指定主键,建立自增序列,主键值取自序列 + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_user_seq_gen") + @SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq",allocationSize = 1) + private Integer id; + + /** + * 火点编码 + */ + @Column( length = 32,unique = true,columnDefinition = "varchar(32)") + private String fireCode; + + /** + * 经度 + */ + private double longitude; + + /** + * 纬度 + */ + private double latitude; + + /** + * 省市区的编码 + */ + @Column(length = 32, columnDefinition = "varchar(32)") + private String countyCode; + + /** + * 省市区的名称 + */ + @Column( columnDefinition = "varchar(64)") + private String countyName; + + /** + * 卫星监测的时间 + */ + private String satelliteTime; + + /** + * 卫星的类型 + */ + @Column( columnDefinition = "varchar(64)") + private String satelliteType; + + /** + * 植被类型 + */ + @Column( columnDefinition = "varchar(64)") + private String landType; + + /** + * 添加的时间 + */ + private String addTime; + + /** + * 置信度 + */ + @Column(length = 32, columnDefinition = "varchar(32)") + private String confidence; + + /** + * 火点状态 0 发现 1预警 2核查 -1,3结案 + */ + @Column(length = 32, columnDefinition = "varchar(32)") + private String fireType; + + public FirePointEntity() { + } + + public FirePointEntity(Integer id, String fireCode, double longitude, double latitude, String countyCode, String countyName, String satelliteTime, String satelliteType, String landType, String addTime, String confidence, String fireType) { + this.id = id; + this.fireCode = fireCode; + this.longitude = longitude; + this.latitude = latitude; + this.countyCode = countyCode; + this.countyName = countyName; + this.satelliteTime = satelliteTime; + this.satelliteType = satelliteType; + this.landType = landType; + this.addTime = addTime; + this.confidence = confidence; + this.fireType = fireType; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getFireCode() { + return fireCode; + } + + public void setFireCode(String fireCode) { + this.fireCode = fireCode; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getCountyCode() { + return countyCode; + } + + public void setCountyCode(String countyCode) { + this.countyCode = countyCode; + } + + public String getCountyName() { + return countyName; + } + + public void setCountyName(String countyName) { + this.countyName = countyName; + } + + public String getSatelliteTime() { + return satelliteTime; + } + + public void setSatelliteTime(String satelliteTime) { + this.satelliteTime = satelliteTime; + } + + public String getSatelliteType() { + return satelliteType; + } + + public void setSatelliteType(String satelliteType) { + this.satelliteType = satelliteType; + } + + public String getLandType() { + return landType; + } + + public void setLandType(String landType) { + this.landType = landType; + } + + public String getAddTime() { + return addTime; + } + + public void setAddTime(String addTime) { + this.addTime = addTime; + } + + public String getConfidence() { + return confidence; + } + + public void setConfidence(String confidence) { + this.confidence = confidence; + } + + public String getFireType() { + return fireType; + } + + public void setFireType(String fireType) { + this.fireType = fireType; + } + + @Override + public String toString() { + return "FirePointEntity{" + + "id=" + id + + ", fireCode='" + fireCode + '\'' + + ", longitude=" + longitude + + ", latitude=" + latitude + + ", countyCode='" + countyCode + '\'' + + ", countyName='" + countyName + '\'' + + ", satelliteTime='" + satelliteTime + '\'' + + ", satelliteType='" + satelliteType + '\'' + + ", landType='" + landType + '\'' + + ", addTime='" + addTime + '\'' + + ", confidence='" + confidence + '\'' + + ", fireType='" + fireType + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/qo/FirePointQo.java b/src/main/java/com/xkrs/model/qo/FirePointQo.java new file mode 100644 index 0000000..be95369 --- /dev/null +++ b/src/main/java/com/xkrs/model/qo/FirePointQo.java @@ -0,0 +1,155 @@ +package com.xkrs.model.qo; + +/** + * @author XinYi Song + * 火点参数类 + */ +public class FirePointQo { + + /** + * 火点编码 + */ + private String fireCode; + + /** + * 省市区的编码 + */ + private String countyCode; + + /** + * 省市区的名称 + */ + private String countyName; + + /** + * 卫星监测的时间戳 + */ + private Long satelliteTimeTs; + + /** + * 经度 + */ + private Double longitude; + + /** + * 纬度 + */ + private Double latitude; + + /** + * 卫星类型 + */ + private String satelliteType; + + /** + * 植被类型 + */ + private String landType; + + /** + * 置信度 + */ + private String confidence; + + public FirePointQo() { + } + + public FirePointQo(String fireCode, String countyCode, String countyName, Long satelliteTimeTs, Double longitude, Double latitude, String satelliteType, String landType, String confidence) { + this.fireCode = fireCode; + this.countyCode = countyCode; + this.countyName = countyName; + this.satelliteTimeTs = satelliteTimeTs; + this.longitude = longitude; + this.latitude = latitude; + this.satelliteType = satelliteType; + this.landType = landType; + this.confidence = confidence; + } + + public String getFireCode() { + return fireCode; + } + + public void setFireCode(String fireCode) { + this.fireCode = fireCode; + } + + public String getCountyCode() { + return countyCode; + } + + public void setCountyCode(String countyCode) { + this.countyCode = countyCode; + } + + public String getCountyName() { + return countyName; + } + + public void setCountyName(String countyName) { + this.countyName = countyName; + } + + public Long getSatelliteTimeTs() { + return satelliteTimeTs; + } + + public void setSatelliteTimeTs(Long satelliteTimeTs) { + this.satelliteTimeTs = satelliteTimeTs; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public String getSatelliteType() { + return satelliteType; + } + + public void setSatelliteType(String satelliteType) { + this.satelliteType = satelliteType; + } + + public String getLandType() { + return landType; + } + + public void setLandType(String landType) { + this.landType = landType; + } + + public String getConfidence() { + return confidence; + } + + public void setConfidence(String confidence) { + this.confidence = confidence; + } + + @Override + public String toString() { + return "FirePointQo{" + + "fireCode='" + fireCode + '\'' + + ", countyCode='" + countyCode + '\'' + + ", countyName='" + countyName + '\'' + + ", satelliteTimeTs=" + satelliteTimeTs + + ", longitude=" + longitude + + ", latitude=" + latitude + + ", satelliteType='" + satelliteType + '\'' + + ", landType='" + landType + '\'' + + ", confidence='" + confidence + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/utils/DateTimeUtil.java b/src/main/java/com/xkrs/utils/DateTimeUtil.java index 835b97c..5b6d8bf 100644 --- a/src/main/java/com/xkrs/utils/DateTimeUtil.java +++ b/src/main/java/com/xkrs/utils/DateTimeUtil.java @@ -133,6 +133,16 @@ public class DateTimeUtil { return dateTime; } + /** + * 时间戳转时间再转字符串 + * @param timeMillis + * @return + */ + public static String timeMillisToString(long timeMillis){ + LocalDateTime dateTime =LocalDateTime.ofEpochSecond(timeMillis,0, DEFAULT_ZONE_OFFSET); + return COMMON_FORMATTER_DATETIME.format(dateTime); + } + /** * 获取当前时间 hh:mm:ss:nnn * @return