From a6d15c664be4d949ff55e38d847f67859925dbf8 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 11:23:05 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/FirePointApplication.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/com/xkrs/FirePointApplication.java b/src/main/java/com/xkrs/FirePointApplication.java index c68eba6..8edf418 100644 --- a/src/main/java/com/xkrs/FirePointApplication.java +++ b/src/main/java/com/xkrs/FirePointApplication.java @@ -4,17 +4,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; -import org.springframework.http.client.OkHttp3ClientHttpRequestFactory; -import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.web.client.RestTemplate; import java.nio.charset.StandardCharsets; -import java.util.List; -/** - * @author XinYi Song - */ @SpringBootApplication public class FirePointApplication { @@ -29,5 +23,5 @@ public class FirePointApplication { restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8)); return restTemplate; } -// + } From cab6ff55e818a121e61ccf227d8cf8835042e13e Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 13:44:25 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xkrs/model/entity/FirePoint.java | 288 ------------------ .../java/com/xkrs/model/entity/FireTask.java | 91 ------ .../com/xkrs/model/entity/FireTaskPhoto.java | 74 ----- .../com/xkrs/model/entity/ForestRanger.java | 155 ---------- 4 files changed, 608 deletions(-) delete mode 100644 src/main/java/com/xkrs/model/entity/FirePoint.java delete mode 100644 src/main/java/com/xkrs/model/entity/FireTask.java delete mode 100644 src/main/java/com/xkrs/model/entity/FireTaskPhoto.java delete mode 100644 src/main/java/com/xkrs/model/entity/ForestRanger.java diff --git a/src/main/java/com/xkrs/model/entity/FirePoint.java b/src/main/java/com/xkrs/model/entity/FirePoint.java deleted file mode 100644 index e08ddf9..0000000 --- a/src/main/java/com/xkrs/model/entity/FirePoint.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; - -/** - * @author XinYi Song - */ -@Entity -@Table(name="fire") -public class FirePoint { - /** - * 指定主键,建立自增序列,主键值取自序列 - */ - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fire_seq_gen") - @SequenceGenerator(name = "fire_seq_gen", sequenceName = "fire_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; - - /** - * 详细地址 - */ - private String firePointAddress; - - /** - * 火点状态 0 发现 1预警 2核查 -1,3结案 - */ - @Column(length = 32, columnDefinition = "varchar(32)") - private String fireType; - - /** - * 当前火点的图片 - */ - private String fireImage; - - /** - * 卫星影像图片 - */ - private String satelliteImage; - - /** - * 火点前的图片 - */ - private String beforeFireImage; - - /** - * 火点后的图片 - */ - private String afterFireImage; - - - public FirePoint() { - } - - public FirePoint(Integer id, String fireCode, double longitude, double latitude, String countyCode, String countyName, String satelliteTime, String satelliteType, String landType, String addTime, String confidence, String firePointAddress, String fireType, String fireImage, String satelliteImage, String beforeFireImage, String afterFireImage) { - 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.firePointAddress = firePointAddress; - this.fireType = fireType; - this.fireImage = fireImage; - this.satelliteImage = satelliteImage; - this.beforeFireImage = beforeFireImage; - this.afterFireImage = afterFireImage; - } - - 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 getFirePointAddress() { - return firePointAddress; - } - - public void setFirePointAddress(String firePointAddress) { - this.firePointAddress = firePointAddress; - } - - public String getFireType() { - return fireType; - } - - public void setFireType(String fireType) { - this.fireType = fireType; - } - - public String getFireImage() { - return fireImage; - } - - public void setFireImage(String fireImage) { - this.fireImage = fireImage; - } - - public String getSatelliteImage() { - return satelliteImage; - } - - public void setSatelliteImage(String satelliteImage) { - this.satelliteImage = satelliteImage; - } - - public String getBeforeFireImage() { - return beforeFireImage; - } - - public void setBeforeFireImage(String beforeFireImage) { - this.beforeFireImage = beforeFireImage; - } - - public String getAfterFireImage() { - return afterFireImage; - } - - public void setAfterFireImage(String afterFireImage) { - this.afterFireImage = afterFireImage; - } - - @Override - public String toString() { - return "FirePoint{" + - "id=" + id + - ", fireCode='" + fireCode + '\'' + - ", longitude=" + longitude + - ", latitude=" + latitude + - ", countyCode='" + countyCode + '\'' + - ", countyName='" + countyName + '\'' + - ", satelliteTime='" + satelliteTime + '\'' + - ", satelliteType='" + satelliteType + '\'' + - ", landType='" + landType + '\'' + - ", addTime='" + addTime + '\'' + - ", confidence='" + confidence + '\'' + - ", firePointAddress='" + firePointAddress + '\'' + - ", fireType='" + fireType + '\'' + - ", fireImage='" + fireImage + '\'' + - ", satelliteImage='" + satelliteImage + '\'' + - ", beforeFireImage='" + beforeFireImage + '\'' + - ", afterFireImage='" + afterFireImage + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/entity/FireTask.java b/src/main/java/com/xkrs/model/entity/FireTask.java deleted file mode 100644 index e588755..0000000 --- a/src/main/java/com/xkrs/model/entity/FireTask.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; -import java.io.Serializable; - -/** - * @author xkrs - * 任务表 - */ -@Entity -@Table(name = "fire_task") -public class FireTask implements Serializable { - - /** - * id 主键 - */ - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fire_task_seq_gen") - @SequenceGenerator(name = "fire_task_seq_gen", sequenceName = "fire_task_id_seq",allocationSize = 1) - private Integer id; - - /** - * 火点编码 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String taskFireCode; - - /** - * 任务描述 - */ - @Column(length = 2000, columnDefinition = "varchar(2000)") - private String taskInformation; - - /** - * 提交任务的时间 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String taskTime; - - public FireTask() { - } - - public FireTask(Integer id, String taskFireCode, String taskInformation, String taskTime) { - this.id = id; - this.taskFireCode = taskFireCode; - this.taskInformation = taskInformation; - this.taskTime = taskTime; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getTaskFireCode() { - return taskFireCode; - } - - public void setTaskFireCode(String taskFireCode) { - this.taskFireCode = taskFireCode; - } - - public String getTaskInformation() { - return taskInformation; - } - - public void setTaskInformation(String taskInformation) { - this.taskInformation = taskInformation; - } - - public String getTaskTime() { - return taskTime; - } - - public void setTaskTime(String taskTime) { - this.taskTime = taskTime; - } - - @Override - public String toString() { - return "FireTask{" + - "id=" + id + - ", taskFireCode='" + taskFireCode + '\'' + - ", taskInformation='" + taskInformation + '\'' + - ", taskTime='" + taskTime + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/entity/FireTaskPhoto.java b/src/main/java/com/xkrs/model/entity/FireTaskPhoto.java deleted file mode 100644 index d22cc6e..0000000 --- a/src/main/java/com/xkrs/model/entity/FireTaskPhoto.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; -import java.io.Serializable; - -/** - * @author xkrs - * 任务和图片中间表 - */ -@Entity -@Table(name = "fire_task_photo") -public class FireTaskPhoto implements Serializable { - /** - * id 主键 - */ - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "fire_task_photo_seq_gen") - @SequenceGenerator(name = "fire_task_photo_seq_gen", sequenceName = "fire_task_photo_id_seq",allocationSize = 1) - private Integer id; - - /** - * 火点编码 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String photoFireCode; - - /** - * 任务图片链接 - */ - @Column(length = 85, columnDefinition = "varchar(85)") - private String taskPhoto; - - public FireTaskPhoto() { - } - - public FireTaskPhoto(Integer id, String photoFireCode, String taskPhoto) { - this.id = id; - this.photoFireCode = photoFireCode; - this.taskPhoto = taskPhoto; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getPhotoFireCode() { - return photoFireCode; - } - - public void setPhotoFireCode(String photoFireCode) { - this.photoFireCode = photoFireCode; - } - - public String getTaskPhoto() { - return taskPhoto; - } - - public void setTaskPhoto(String taskPhoto) { - this.taskPhoto = taskPhoto; - } - - @Override - public String toString() { - return "FireTaskPhoto{" + - "id=" + id + - ", photoFireCode='" + photoFireCode + '\'' + - ", taskPhoto='" + taskPhoto + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/entity/ForestRanger.java b/src/main/java/com/xkrs/model/entity/ForestRanger.java deleted file mode 100644 index 7ebfb2b..0000000 --- a/src/main/java/com/xkrs/model/entity/ForestRanger.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; -import java.io.Serializable; - -/** - * @author xkrs - * 护林员信息 - */ -@Entity -@Table(name = "forest_ranger") -public class ForestRanger implements Serializable { - - /** - * 主键 - */ - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "forest_ranger_seq_gen") - @SequenceGenerator(name = "forest_ranger_seq_gen", sequenceName = "forest_ranger_id_seq",allocationSize = 1) - private Integer id; - - /** - * 护林员的姓名 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String rangerName; - - /** - * 护林员的电话 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String rangerPhone; - - /** - * 纬度 - */ - @Column(length = 85, columnDefinition = "varchar(85)") - private String rangerLatitude; - - /** - * 经度 - */ - @Column(length = 85, columnDefinition = "varchar(85)") - private String rangerLongitude; - - /** - * 护林员所在市区县 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String rangerCountyName; - - /** - * 市区县的编码 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String rangerCountyCode; - - /** - * 护林员的状态(0空闲 1正在执行任务) - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String rangerType; - - public ForestRanger() { - } - - public ForestRanger(Integer id, String rangerName, String rangerPhone, String rangerLatitude, String rangerLongitude, String rangerCountyName, String rangerCountyCode, String rangerType) { - this.id = id; - this.rangerName = rangerName; - this.rangerPhone = rangerPhone; - this.rangerLatitude = rangerLatitude; - this.rangerLongitude = rangerLongitude; - this.rangerCountyName = rangerCountyName; - this.rangerCountyCode = rangerCountyCode; - this.rangerType = rangerType; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getRangerName() { - return rangerName; - } - - public void setRangerName(String rangerName) { - this.rangerName = rangerName; - } - - public String getRangerPhone() { - return rangerPhone; - } - - public void setRangerPhone(String rangerPhone) { - this.rangerPhone = rangerPhone; - } - - public String getRangerLatitude() { - return rangerLatitude; - } - - public void setRangerLatitude(String rangerLatitude) { - this.rangerLatitude = rangerLatitude; - } - - public String getRangerLongitude() { - return rangerLongitude; - } - - public void setRangerLongitude(String rangerLongitude) { - this.rangerLongitude = rangerLongitude; - } - - public String getRangerCountyName() { - return rangerCountyName; - } - - public void setRangerCountyName(String rangerCountyName) { - this.rangerCountyName = rangerCountyName; - } - - public String getRangerCountyCode() { - return rangerCountyCode; - } - - public void setRangerCountyCode(String rangerCountyCode) { - this.rangerCountyCode = rangerCountyCode; - } - - public String getRangerType() { - return rangerType; - } - - public void setRangerType(String rangerType) { - this.rangerType = rangerType; - } - - @Override - public String toString() { - return "XkRsForestRanger{" + - "id=" + id + - ", rangerName='" + rangerName + '\'' + - ", rangerPhone='" + rangerPhone + '\'' + - ", rangerLatitude='" + rangerLatitude + '\'' + - ", rangerLongitude='" + rangerLongitude + '\'' + - ", rangerCountyName='" + rangerCountyName + '\'' + - ", rangerCountyCode='" + rangerCountyCode + '\'' + - ", rangerType='" + rangerType + '\'' + - '}'; - } -} From 69c10fed80f4546d77876a1d21d0b8ad03f0e197 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 14:02:20 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/dao/ShanDongFirePointDao.java | 33 -- .../model/entity/ShanDongFirePointEntity.java | 292 ------------------ 2 files changed, 325 deletions(-) delete mode 100644 src/main/java/com/xkrs/dao/ShanDongFirePointDao.java delete mode 100644 src/main/java/com/xkrs/model/entity/ShanDongFirePointEntity.java diff --git a/src/main/java/com/xkrs/dao/ShanDongFirePointDao.java b/src/main/java/com/xkrs/dao/ShanDongFirePointDao.java deleted file mode 100644 index 0811740..0000000 --- a/src/main/java/com/xkrs/dao/ShanDongFirePointDao.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xkrs.dao; - -import com.xkrs.model.entity.ShanDongFirePointEntity; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.stereotype.Component; - -import java.util.List; - -@Component -public interface ShanDongFirePointDao extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据火点编码查询火点信息 - * - * @param fireCode - * @return - */ - ShanDongFirePointEntity findByFireCode(String fireCode); - - @Query(value = "SELECT * FROM fire_point_shandong WHERE longitude = ?1 AND latitude = ?2 AND street_code = ?3 AND satellite_time = ?4 AND satellite_type = ?5 AND land_type = ?6", nativeQuery = true) - List findDuplicatedData(double longitude, double latitude, String streetCode, String satelliteTime, String satelliteType, String landType); - - /** - * 在山东临时火点表中根据火点编码修改审核状态 - */ - @Modifying(clearAutomatically = true) - @Query(value = "UPDATE fire_point_shandong SET verify_state = ?2 WHERE fire_code = ?1", nativeQuery = true) - void updateVerifyStateByFireCode(String fireCode, String verifyState); - -} diff --git a/src/main/java/com/xkrs/model/entity/ShanDongFirePointEntity.java b/src/main/java/com/xkrs/model/entity/ShanDongFirePointEntity.java deleted file mode 100644 index 97ab427..0000000 --- a/src/main/java/com/xkrs/model/entity/ShanDongFirePointEntity.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; -import java.io.Serializable; - -/** - * @author XinYi Song - */ -@Entity -@Table(name = "fire_point_shandong") -public class ShanDongFirePointEntity implements Serializable { - - /** - * 指定主键,建立自增序列,主键值取自序列 - */ - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fire_point_shandong_seq_gen") - @SequenceGenerator(name = "fire_point_shandong_seq_gen", sequenceName = "fire_point_shandong_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; - - /** - * 详细地址 - */ - private String firePointAddress; - - /** - * 火点状态 0 发现 1预警 2核查 -1,3结案 - */ - @Column(length = 32, columnDefinition = "varchar(32)") - private String fireType; - - /** - * 当前火点的图片 - */ - private String fireImage; - - /** - * 卫星影像图片 - */ - private String satelliteImage; - - /** - * 火点前的图片 - */ - private String beforeFireImage; - - /** - * 火点后的图片 - */ - private String afterFireImage; - - /** - * 街道编码 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String streetCode; - - @Column(length = 65, columnDefinition = "varchar(85)") - private String streetName; - - /** - * 0:未审核 - * 1:审核通过 - * 2:审核不通过 - */ - @Column(length = 65, columnDefinition = "varchar(85)") - private String verifyState; - - public ShanDongFirePointEntity() { - } - - 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 getFirePointAddress() { - return firePointAddress; - } - - public void setFirePointAddress(String firePointAddress) { - this.firePointAddress = firePointAddress; - } - - public String getFireType() { - return fireType; - } - - public void setFireType(String fireType) { - this.fireType = fireType; - } - - public String getFireImage() { - return fireImage; - } - - public void setFireImage(String fireImage) { - this.fireImage = fireImage; - } - - public String getSatelliteImage() { - return satelliteImage; - } - - public void setSatelliteImage(String satelliteImage) { - this.satelliteImage = satelliteImage; - } - - public String getBeforeFireImage() { - return beforeFireImage; - } - - public void setBeforeFireImage(String beforeFireImage) { - this.beforeFireImage = beforeFireImage; - } - - public String getAfterFireImage() { - return afterFireImage; - } - - public void setAfterFireImage(String afterFireImage) { - this.afterFireImage = afterFireImage; - } - - public String getStreetCode() { - return streetCode; - } - - public void setStreetCode(String streetCode) { - this.streetCode = streetCode; - } - - public String getStreetName() { - return streetName; - } - - public void setStreetName(String streetName) { - this.streetName = streetName; - } - - public String getVerifyState() { - return verifyState; - } - - public void setVerifyState(String verifyState) { - this.verifyState = verifyState; - } - - @Override - public String toString() { - return "ShanDongFirePointEntity{" + "id=" + id + ", fireCode='" + fireCode + '\'' + ", longitude=" + longitude + ", latitude=" + latitude + ", countyCode='" + countyCode + '\'' + ", countyName='" + countyName + '\'' + ", satelliteTime='" + satelliteTime + '\'' + ", satelliteType='" + satelliteType + '\'' + ", landType='" + landType + '\'' + ", addTime='" + addTime + '\'' + ", confidence='" + confidence + '\'' + ", firePointAddress='" + firePointAddress + '\'' + ", fireType='" + fireType + '\'' + ", fireImage='" + fireImage + '\'' + ", satelliteImage='" + satelliteImage + '\'' + ", beforeFireImage='" + beforeFireImage + '\'' + ", afterFireImage='" + afterFireImage + '\'' + ", streetCode='" + streetCode + '\'' + ", streetName='" + streetName + '\'' + ", verifyState='" + verifyState + '\'' + '}'; - } -} From 1953732ef361df25dafd92fa5bb632679d09fa5f Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 14:04:05 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/controller/FirePointController.java | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index 8b09c6b..8806300 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -3,10 +3,8 @@ package com.xkrs.controller; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.tool.TokenUtil; import com.xkrs.dao.FirePointDao; -import com.xkrs.dao.ShanDongFirePointDao; import com.xkrs.dao.SysUserDao; import com.xkrs.model.entity.FirePointEntity; -import com.xkrs.model.entity.ShanDongFirePointEntity; import com.xkrs.model.entity.SysUserEntity; import com.xkrs.model.qo.AuditFireTypeQo; import com.xkrs.model.qo.FirePointQo; @@ -19,12 +17,9 @@ import org.apache.hc.core5.util.TextUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.data.domain.Sort; -import org.springframework.data.jpa.domain.Specification; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.persistence.criteria.Predicate; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.transaction.Transactional; @@ -51,9 +46,6 @@ public class FirePointController { @Resource private FirePointDao firePointDao; - @Resource - private ShanDongFirePointDao shanDongFirePointDao; - @Resource private StreetService streetService; @@ -98,20 +90,6 @@ public class FirePointController { } } - /** - * 查询山东临时火点表 - * - * @return - */ - @GetMapping("/queryshandongfirepointlist") - public String queryShanDongFirePointList() { - List shanDongFirePointList = shanDongFirePointDao.findAll(Sort.by(Sort.Direction.DESC, "satelliteTime")); - if (shanDongFirePointList.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有火点数据", locale); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, shanDongFirePointList, locale); - } - /** * 将山东临时火点表中的火点根据火点编号更新审核状态 * 操作1:如果verifyState==1,将火点编号对应的火点从山东火点表转存到火点表 @@ -140,26 +118,6 @@ public class FirePointController { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale); } - @GetMapping("/queryshandongfirepointbytime") - public String queryShanDongFirePointByTime(@RequestParam(required = false, value = "startTime") String startTime, @RequestParam(required = false, value = "endTime") String endTime) { - Specification specification = (root, criteriaQuery, criteriaBuilder) -> { - List list = new ArrayList<>(); - if (startTime != null && !"".equals(startTime)) { - list.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), startTime)); - } - if (endTime != null && !"".equals(endTime)) { - list.add(criteriaBuilder.lessThanOrEqualTo(root.get("satelliteTime").as(String.class), endTime)); - } - Predicate[] predicates = new Predicate[list.size()]; - return criteriaBuilder.and(list.toArray(predicates)); - }; - List shanDongFirePointList = shanDongFirePointDao.findAll(specification, Sort.by(Sort.Direction.DESC, "satelliteTime")); - if (shanDongFirePointList.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有火点数据", locale); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, shanDongFirePointList, locale); - } - @RequestMapping(value = "/download/vipuserfirepoint", method = RequestMethod.GET) public String downloadVipUserFirePoint(HttpServletResponse response, HttpServletRequest request) { return firePointService.downloadVipUserFilePoint(request, response); From f7f635f0923244ce4a1f55e9851375c1292f1c20 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 14:19:33 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/common/StaticScheduleTask.java | 36 ------ .../xkrs/controller/SettingController.java | 37 ------ src/main/java/com/xkrs/dao/SettingDao.java | 20 ---- .../com/xkrs/model/entity/SettingEntity.java | 50 -------- .../java/com/xkrs/model/qo/SettingQo.java | 27 ----- .../com/xkrs/service/FirePointService.java | 7 -- .../java/com/xkrs/service/SettingService.java | 18 --- .../service/impl/FirePointServiceImpl.java | 110 ------------------ .../xkrs/service/impl/SettingServiceImpl.java | 61 ---------- 9 files changed, 366 deletions(-) delete mode 100644 src/main/java/com/xkrs/common/StaticScheduleTask.java delete mode 100644 src/main/java/com/xkrs/controller/SettingController.java delete mode 100644 src/main/java/com/xkrs/dao/SettingDao.java delete mode 100644 src/main/java/com/xkrs/model/entity/SettingEntity.java delete mode 100644 src/main/java/com/xkrs/model/qo/SettingQo.java delete mode 100644 src/main/java/com/xkrs/service/SettingService.java delete mode 100644 src/main/java/com/xkrs/service/impl/SettingServiceImpl.java diff --git a/src/main/java/com/xkrs/common/StaticScheduleTask.java b/src/main/java/com/xkrs/common/StaticScheduleTask.java deleted file mode 100644 index 234401c..0000000 --- a/src/main/java/com/xkrs/common/StaticScheduleTask.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.xkrs.common; - -import com.xkrs.model.qo.SettingQo; -import com.xkrs.service.SettingService; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; - -import javax.annotation.Resource; - -/** - * 火点审核开关计划任务 - */ -@Configuration -@EnableScheduling -public class StaticScheduleTask { - - @Resource - private SettingService settingService; - - //早上八点打开火点审核开关 - @Scheduled(cron = "0 0 8 * * ?") - private void openVerifySwitch() { - SettingQo settingQo = new SettingQo(); - settingQo.setSwitchState("1"); - settingService.updateSwitchState(settingQo); - } - -// //晚上十点关闭火点审核开关 -// @Scheduled(cron = "0 0 22 * * ?") -// private void closeVerifySwitch() { -// SettingQo settingQo = new SettingQo(); -// settingQo.setSwitchState("0"); -// settingService.updateSwitchState(settingQo); -// } -} \ No newline at end of file diff --git a/src/main/java/com/xkrs/controller/SettingController.java b/src/main/java/com/xkrs/controller/SettingController.java deleted file mode 100644 index 8dd2a85..0000000 --- a/src/main/java/com/xkrs/controller/SettingController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xkrs.controller; - -import com.xkrs.model.qo.SettingQo; -import com.xkrs.service.SettingService; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -/** - * 设置审核开关状态 - */ -@RestController -public class SettingController { - - @Resource - private SettingService settingService; - - /** - * 更新审核开关状态 - */ - @PostMapping("/updateswitchstate") - public String updateSwitchState(@RequestBody SettingQo settingQo) { - return settingService.updateSwitchState(settingQo); - } - - /** - * 查询审核开关状态 - */ - @GetMapping("/queryswitchstate") - public String querySwitchState() { - return settingService.querySwitchState(); - } - -} diff --git a/src/main/java/com/xkrs/dao/SettingDao.java b/src/main/java/com/xkrs/dao/SettingDao.java deleted file mode 100644 index 5be593a..0000000 --- a/src/main/java/com/xkrs/dao/SettingDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xkrs.dao; - -import com.xkrs.model.entity.SettingEntity; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.stereotype.Component; - -/** - * @author xkrs - */ -@Component -public interface SettingDao extends JpaRepository, JpaSpecificationExecutor { - - @Modifying(clearAutomatically = true) - @Query(value = "UPDATE setting SET switch_state = ?2 where id = ?1", nativeQuery = true) - void updateSwitchStateById(Long id, String switchState); - -} diff --git a/src/main/java/com/xkrs/model/entity/SettingEntity.java b/src/main/java/com/xkrs/model/entity/SettingEntity.java deleted file mode 100644 index caab61d..0000000 --- a/src/main/java/com/xkrs/model/entity/SettingEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; -import java.io.Serializable; - -/** - * @author xkrs - */ -@Entity -@Table(name = "setting") -public class SettingEntity implements Serializable { - - /** - * 主键id - */ - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "setting_seq_gen") - @SequenceGenerator(name = "setting_seq_gen", sequenceName = "setting_id_seq", allocationSize = 1) - private Long id; - - /** - * 0:关,1:开 - */ - @Column(length = 64, columnDefinition = "varchar(64)") - private String switchState; - - public SettingEntity() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getSwitchState() { - return switchState; - } - - public void setSwitchState(String switchState) { - this.switchState = switchState; - } - - @Override - public String toString() { - return "SettingEntity{" + "id=" + id + ", switchState='" + switchState + '\'' + '}'; - } -} diff --git a/src/main/java/com/xkrs/model/qo/SettingQo.java b/src/main/java/com/xkrs/model/qo/SettingQo.java deleted file mode 100644 index b00a5dd..0000000 --- a/src/main/java/com/xkrs/model/qo/SettingQo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xkrs.model.qo; - -import com.xkrs.model.validation.SettingQoUpdate; - -import javax.validation.constraints.NotNull; - -public class SettingQo { - - @NotNull(message = "{Setting.switchState.blank}", groups = {SettingQoUpdate.class}) - private String switchState; - - public SettingQo() { - } - - public String getSwitchState() { - return switchState; - } - - public void setSwitchState(String switchState) { - this.switchState = switchState; - } - - @Override - public String toString() { - return "SettingQo{" + "switchState='" + switchState + '\'' + '}'; - } -} diff --git a/src/main/java/com/xkrs/service/FirePointService.java b/src/main/java/com/xkrs/service/FirePointService.java index 0f33460..163e500 100644 --- a/src/main/java/com/xkrs/service/FirePointService.java +++ b/src/main/java/com/xkrs/service/FirePointService.java @@ -63,13 +63,6 @@ public interface FirePointService { */ String selectFirePointNumWeek(); - /** - * 根据火点编号更新审核状态 - * 操作1:将火点编号对应的火点从山东火点表转存到火点表 - * 操作2:将山东火点表中的这个火点的审核状态更新 - */ - String updateVerifyStateByFireCode(String fireCode, String verifyState); - /** * download vip user's fire point * diff --git a/src/main/java/com/xkrs/service/SettingService.java b/src/main/java/com/xkrs/service/SettingService.java deleted file mode 100644 index b1b9ac3..0000000 --- a/src/main/java/com/xkrs/service/SettingService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xkrs.service; - -import com.xkrs.model.qo.SettingQo; -import org.springframework.web.bind.annotation.RequestBody; - -public interface SettingService { - - /** - * 更新审核开关状态 - */ - String updateSwitchState(@RequestBody SettingQo settingQo); - - /** - * 查询审核开关状态 - */ - String querySwitchState(); - -} diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 566123b..7af8e57 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -22,7 +22,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.transaction.Transactional; import java.io.IOException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -50,12 +49,6 @@ public class FirePointServiceImpl implements FirePointService { @Resource private FirePointDao firePointDao; - @Resource - private SettingDao settingDao; - - @Resource - private ShanDongFirePointDao shanDongFirePointDao; - @Resource private SysUserDao sysUserDao; @@ -162,56 +155,6 @@ public class FirePointServiceImpl implements FirePointService { return duplicatedDataList != null && duplicatedDataList.size() > 0; } - /** - * 根据山东火点生成全国火点 - */ - private FirePointEntity getFirePointByShanDongFirePoint(ShanDongFirePointEntity shanDongFirePoint) { - FirePointEntity firePoint = new FirePointEntity(); - firePoint.setFireCode(shanDongFirePoint.getFireCode()); - firePoint.setCountyCode(shanDongFirePoint.getCountyCode()); - firePoint.setCountyName(shanDongFirePoint.getCountyName()); - firePoint.setSatelliteTime(shanDongFirePoint.getSatelliteTime()); - firePoint.setLongitude(shanDongFirePoint.getLongitude()); - firePoint.setLatitude(shanDongFirePoint.getLatitude()); - firePoint.setFirePointAddress(shanDongFirePoint.getFirePointAddress()); - firePoint.setSatelliteType(shanDongFirePoint.getSatelliteType()); - firePoint.setLandType(shanDongFirePoint.getLandType()); - firePoint.setConfidence(shanDongFirePoint.getConfidence()); - firePoint.setAddTime(shanDongFirePoint.getAddTime()); - firePoint.setFireType(shanDongFirePoint.getFireType()); - firePoint.setFireImage(shanDongFirePoint.getFireImage()); - firePoint.setSatelliteImage(shanDongFirePoint.getSatelliteImage()); - firePoint.setStreetCode(shanDongFirePoint.getStreetCode()); - firePoint.setStreetName(shanDongFirePoint.getStreetName()); - firePoint.setAuditFireType("0");//初始化火点为未审核状态 - return firePoint; - } - - private ShanDongFirePointEntity getShanDongFirePointByFirePoint(FirePointEntity firePoint) { - ShanDongFirePointEntity shanDongFirePoint = new ShanDongFirePointEntity(); - shanDongFirePoint.setId(firePoint.getId()); - shanDongFirePoint.setFireCode(firePoint.getFireCode()); - shanDongFirePoint.setLongitude(firePoint.getLongitude()); - shanDongFirePoint.setLatitude(firePoint.getLatitude()); - shanDongFirePoint.setCountyCode(firePoint.getCountyCode()); - shanDongFirePoint.setCountyName(firePoint.getCountyName()); - shanDongFirePoint.setSatelliteTime(firePoint.getSatelliteTime()); - shanDongFirePoint.setSatelliteType(firePoint.getSatelliteType()); - shanDongFirePoint.setLandType(firePoint.getLandType()); - shanDongFirePoint.setAddTime(firePoint.getAddTime()); - shanDongFirePoint.setConfidence(firePoint.getConfidence()); - shanDongFirePoint.setFirePointAddress(firePoint.getFirePointAddress()); - shanDongFirePoint.setFireType(firePoint.getFireType()); - shanDongFirePoint.setFireImage(firePoint.getFireImage()); - shanDongFirePoint.setSatelliteImage(firePoint.getSatelliteImage()); - shanDongFirePoint.setBeforeFireImage(firePoint.getBeforeFireImage()); - shanDongFirePoint.setAfterFireImage(firePoint.getAfterFireImage()); - shanDongFirePoint.setStreetCode(firePoint.getStreetCode()); - shanDongFirePoint.setStreetName(firePoint.getStreetName()); - shanDongFirePoint.setVerifyState("0"); - return shanDongFirePoint; - } - /** * 为实体类绑定地址、编号、名称 */ @@ -231,47 +174,6 @@ public class FirePointServiceImpl implements FirePointService { firePointEntity.setStreetName(addressComponent.getTownship()); } - /** - * 根据火点编号更新审核状态 - * 操作1:将火点编号对应的火点从山东火点表转存到火点表 - * 操作2:将山东火点表中的这个火点的审核状态更新 - */ - @Transactional(rollbackOn = Exception.class) - @Override - public String updateVerifyStateByFireCode(String fireCode, String verifyState) { - if ((!"0".equals(verifyState)) && (!"1".equals(verifyState)) && (!"2".equals(verifyState))) { - return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL, "审核失败,审核状态参数错误", locale); - } - ShanDongFirePointEntity existShanDongFirePoint = shanDongFirePointDao.findByFireCode(fireCode); - //山东火点表找不到这个火点,返回失败 - if (existShanDongFirePoint == null) { - return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "审核失败,没有指定的火点编号", locale); - } - if ("0".equals(existShanDongFirePoint.getVerifyState()) || "2".equals(existShanDongFirePoint.getVerifyState())) { - if ("0".equals(verifyState)) { - return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "审核失败,审核状态不能被设置为未审核", locale); - } - if ("1".equals(verifyState)) { - //火点表能找到这个火点,返回失败 - FirePointEntity existFirePoint = firePointDao.findByFireCode(fireCode); - if (existFirePoint != null) { - return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "修改失败,火点库已存在指定的火点编号", locale); - } - //操作1:将火点编号对应的火点从山东火点表转存到火点表 - FirePointEntity firePoint = getFirePointByShanDongFirePoint(existShanDongFirePoint); - log.info("-------转存新火点"); - firePointDao.save(firePoint); - //发送消息通知 - sendBroadcast(firePoint); - } - //操作2:将山东火点表中的这个火点的审核状态更新 - shanDongFirePointDao.updateVerifyStateByFireCode(fireCode, verifyState); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale); - } - //0或者2可以被审核为1(未审核和未通过可以被审核为通过),已经通过了的就不能再处理了 - return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "审核失败,火点不能被重复审核", locale); - } - private void sendBroadcast(FirePointEntity firePointEntity) { //发送微信群聊消息 sendWeChatGroupMessage(firePointEntity); @@ -349,18 +251,6 @@ public class FirePointServiceImpl implements FirePointService { return content; } - private String getMessageContent(ShanDongFirePointEntity firePointEntity) { - java.text.DecimalFormat decimalFormat = new DecimalFormat("#.000000"); - String satelliteTime = firePointEntity.getSatelliteTime(); - String formatLongitude = decimalFormat.format(firePointEntity.getLongitude()); - String formatLatitude = decimalFormat.format(firePointEntity.getLatitude()); - String countyName = firePointEntity.getCountyName(); - String streetName = firePointEntity.getStreetName(); - String landType = firePointEntity.getLandType(); - String content = firePointEntity.getSatelliteType() + "发现1个待审核火点。\n卫星时间:" + satelliteTime + ";\nlongitude:" + formatLongitude + ";\nlatitude:" + formatLatitude + ";\ncountyName:" + countyName + ";\nstreetName:" + streetName + ";\nlandType:" + landType; - return content; - } - /** * 下载VIP用户火点数据 */ diff --git a/src/main/java/com/xkrs/service/impl/SettingServiceImpl.java b/src/main/java/com/xkrs/service/impl/SettingServiceImpl.java deleted file mode 100644 index f2d4396..0000000 --- a/src/main/java/com/xkrs/service/impl/SettingServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xkrs.service.impl; - -import com.xkrs.common.encapsulation.PromptMessageEnum; -import com.xkrs.dao.SettingDao; -import com.xkrs.model.entity.SettingEntity; -import com.xkrs.model.qo.SettingQo; -import com.xkrs.service.SettingService; -import org.apache.http.util.TextUtils; -import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.transaction.Transactional; -import java.util.List; -import java.util.Locale; - -import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; - -@Service -public class SettingServiceImpl implements SettingService { - - @Resource - private SettingDao settingDao; - - /** - * 更新审核开关状态 - */ - @Transactional(rollbackOn = Exception.class) - @Override - public String updateSwitchState(SettingQo settingQo) { - Locale locale = LocaleContextHolder.getLocale(); - if (TextUtils.isEmpty(settingQo.getSwitchState())) { - return outputEncapsulationObject(PromptMessageEnum.PARAM_NULL, "switchState参数不能为空", locale); - } - List settingEntityList = settingDao.findAll(); - if (settingEntityList.isEmpty()) { - SettingEntity settingEntity = new SettingEntity(); - settingEntity.setSwitchState(settingQo.getSwitchState()); - settingDao.save(settingEntity); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale); - } - for (SettingEntity settingEntity : settingEntityList) { - settingDao.updateSwitchStateById(settingEntity.getId(), settingQo.getSwitchState()); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale); - } - - /** - * 查询审核开关状态 - */ - @Override - public String querySwitchState() { - Locale locale = LocaleContextHolder.getLocale(); - List settingEntityList = settingDao.findAll(); - if (settingEntityList.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有状态信息", locale); - } - SettingEntity settingEntity = settingEntityList.get(0); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, settingEntity.getSwitchState(), locale); - } -} From c88e71d62fdcebf292737f74ad75305caa48de59 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 14:30:25 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/controller/FileController.java | 22 ++- .../xkrs/controller/FirePointController.java | 13 -- .../com/xkrs/model/entity/FireAndRanger.java | 151 ------------------ .../qo/ShanDongFirePointVerifyStateQo.java | 38 ----- .../java/com/xkrs/model/qo/SysUserQo.java | 5 - .../model/validation/SettingQoUpdate.java | 4 - .../ShanDongFirePointVerifyStateQoUpdate.java | 4 - 7 files changed, 10 insertions(+), 227 deletions(-) delete mode 100644 src/main/java/com/xkrs/model/entity/FireAndRanger.java delete mode 100644 src/main/java/com/xkrs/model/qo/ShanDongFirePointVerifyStateQo.java delete mode 100644 src/main/java/com/xkrs/model/validation/SettingQoUpdate.java delete mode 100644 src/main/java/com/xkrs/model/validation/ShanDongFirePointVerifyStateQoUpdate.java diff --git a/src/main/java/com/xkrs/controller/FileController.java b/src/main/java/com/xkrs/controller/FileController.java index e1b7cba..9e45a33 100644 --- a/src/main/java/com/xkrs/controller/FileController.java +++ b/src/main/java/com/xkrs/controller/FileController.java @@ -21,10 +21,6 @@ import java.util.Map; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.utils.FileUtil.getUploadInfo; -/** - * @author XinYi Song - * 文件上传 - */ @RestController public class FileController { @@ -36,20 +32,20 @@ public class FileController { /** * 上传多张图片 + * * @param files * @return */ @PostMapping("/uploadFileMore") public String uploadFileMore(MultipartFile[] files) throws Exception { Locale locale = LocaleContextHolder.getLocale(); - if (null == files || files.length == 0){ + if (null == files || files.length == 0) { return outputEncapsulationObject(PromptMessageEnum.PARAM_NULL, "result or fileType is null", locale); } List list = new ArrayList(); - for (MultipartFile file : - files) { + for (MultipartFile file : files) { boolean m = FileUtil.checkFileSize(file.getSize(), 100, "M"); - if(m == false){ + if (m == false) { return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "图片大小不能超过100M", locale); } File file1 = fileFastDfs.multipartFileToFile(file); @@ -72,17 +68,18 @@ public class FileController { /** * 上传单张图片 + * * @param file * @return */ @PostMapping("/uploadFile") public String uploadFile(MultipartFile file) throws Exception { Locale locale = LocaleContextHolder.getLocale(); - if (null == file){ + if (null == file) { return outputEncapsulationObject(PromptMessageEnum.PARAM_NULL, "result or fileType is null", locale); } boolean m = FileUtil.checkFileSize(file.getSize(), 100, "M"); - if(m == false){ + if (m == false) { return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "图片大小不能超过100M", locale); } File file1 = fileFastDfs.multipartFileToFile(file); @@ -104,13 +101,14 @@ public class FileController { /** * 查询火点图片路径 + * * @return */ @GetMapping("/findPath") - public String findPath(){ + public String findPath() { Locale locale = LocaleContextHolder.getLocale(); List> path = filePathDao.findPath(); - if(path == null || path.size() == 0){ + if (path == null || path.size() == 0) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "还未上传任何图片信息!", locale); } return outputEncapsulationObject(PromptMessageEnum.SUCCESS, path, locale); diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index 8806300..c1e31ba 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -8,7 +8,6 @@ import com.xkrs.model.entity.FirePointEntity; import com.xkrs.model.entity.SysUserEntity; import com.xkrs.model.qo.AuditFireTypeQo; import com.xkrs.model.qo.FirePointQo; -import com.xkrs.model.qo.ShanDongFirePointVerifyStateQo; import com.xkrs.service.FirePointService; import com.xkrs.service.StreetService; import com.xkrs.service.impl.FirePointServiceImpl; @@ -90,18 +89,6 @@ public class FirePointController { } } - /** - * 将山东临时火点表中的火点根据火点编号更新审核状态 - * 操作1:如果verifyState==1,将火点编号对应的火点从山东火点表转存到火点表 - * 操作2:将山东火点表中的这个火点的审核状态更新 - */ - @PostMapping("/updateverifystatebyfirecode") - public String updateVerifyStateByFireCode(@RequestBody ShanDongFirePointVerifyStateQo shanDongFirePointVerifyStateQo) { - String fireCode = shanDongFirePointVerifyStateQo.getFireCode(); - String verifyState = shanDongFirePointVerifyStateQo.getVerifyState(); - return firePointService.updateVerifyStateByFireCode(fireCode, verifyState); - } - /** * 在全国火点表中根据火点编码修改审核火点状态 */ diff --git a/src/main/java/com/xkrs/model/entity/FireAndRanger.java b/src/main/java/com/xkrs/model/entity/FireAndRanger.java deleted file mode 100644 index ea549bf..0000000 --- a/src/main/java/com/xkrs/model/entity/FireAndRanger.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.xkrs.model.entity; - -import javax.persistence.*; - -/** - * 护林员和火点中间表 - * @author xkrs - */ -@Entity -@Table(name="fire_and_ranger") -public class FireAndRanger { - - /** - * 主键id - */ - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fire_and_ranger_seq_gen") - @SequenceGenerator(name = "fire_and_ranger_seq_gen", sequenceName = "fire_and_ranger_id_seq",allocationSize = 1) - private Integer id; - - /** - * 护林员的账号(手机号作为和火点的标识) - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String rangerName; - - /** - * 火点编码 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String fireCode; - - /** - * 处理人 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String handler; - - /** - * 核查人 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String verifier; - - /** - * 处理时间(核查时间) - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String handlerTime; - - /** - * 结束时间 - */ - @Column(length = 65, columnDefinition = "varchar(65)") - private String endTime; - - @Column(length = 32, columnDefinition = "varchar(32)") - private String progressType; - - public FireAndRanger() { - } - - public FireAndRanger(Integer id, String rangerName, String fireCode, String handler, String verifier, String handlerTime, String endTime, String progressType) { - this.id = id; - this.rangerName = rangerName; - this.fireCode = fireCode; - this.handler = handler; - this.verifier = verifier; - this.handlerTime = handlerTime; - this.endTime = endTime; - this.progressType = progressType; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getRangerName() { - return rangerName; - } - - public void setRangerName(String rangerName) { - this.rangerName = rangerName; - } - - public String getFireCode() { - return fireCode; - } - - public void setFireCode(String fireCode) { - this.fireCode = fireCode; - } - - public String getHandler() { - return handler; - } - - public void setHandler(String handler) { - this.handler = handler; - } - - public String getVerifier() { - return verifier; - } - - public void setVerifier(String verifier) { - this.verifier = verifier; - } - - public String getHandlerTime() { - return handlerTime; - } - - public void setHandlerTime(String handlerTime) { - this.handlerTime = handlerTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public String getProgressType() { - return progressType; - } - - public void setProgressType(String progressType) { - this.progressType = progressType; - } - - @Override - public String toString() { - return "FireAndRanger{" + - "id=" + id + - ", rangerName='" + rangerName + '\'' + - ", fireCode='" + fireCode + '\'' + - ", handler='" + handler + '\'' + - ", verifier='" + verifier + '\'' + - ", handlerTime='" + handlerTime + '\'' + - ", endTime='" + endTime + '\'' + - ", progressType='" + progressType + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/qo/ShanDongFirePointVerifyStateQo.java b/src/main/java/com/xkrs/model/qo/ShanDongFirePointVerifyStateQo.java deleted file mode 100644 index e6e725d..0000000 --- a/src/main/java/com/xkrs/model/qo/ShanDongFirePointVerifyStateQo.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xkrs.model.qo; - -import com.xkrs.model.validation.ShanDongFirePointVerifyStateQoUpdate; - -import javax.validation.constraints.NotNull; - -public class ShanDongFirePointVerifyStateQo { - - @NotNull(message = "{FirePoint.fireCode.blank}", groups = {ShanDongFirePointVerifyStateQoUpdate.class}) - private String fireCode; - - @NotNull(message = "{FirePoint.verifyState.blank}", groups = {ShanDongFirePointVerifyStateQoUpdate.class}) - private String verifyState; - - public ShanDongFirePointVerifyStateQo() { - } - - public String getFireCode() { - return fireCode; - } - - public void setFireCode(String fireCode) { - this.fireCode = fireCode; - } - - public String getVerifyState() { - return verifyState; - } - - public void setVerifyState(String verifyState) { - this.verifyState = verifyState; - } - - @Override - public String toString() { - return "ShanDongFirePointVerifyStateQo{" + "fireCode='" + fireCode + '\'' + ", verifyState='" + verifyState + '\'' + '}'; - } -} diff --git a/src/main/java/com/xkrs/model/qo/SysUserQo.java b/src/main/java/com/xkrs/model/qo/SysUserQo.java index fa54f2b..b4d71ba 100644 --- a/src/main/java/com/xkrs/model/qo/SysUserQo.java +++ b/src/main/java/com/xkrs/model/qo/SysUserQo.java @@ -9,11 +9,6 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; -/** - * SysUserQo - * - * @author tajochen - */ public class SysUserQo { @NotNull(message = "{SysUser.id.blank}", groups = {SysUserQoUpdate.class}) diff --git a/src/main/java/com/xkrs/model/validation/SettingQoUpdate.java b/src/main/java/com/xkrs/model/validation/SettingQoUpdate.java deleted file mode 100644 index 7d05642..0000000 --- a/src/main/java/com/xkrs/model/validation/SettingQoUpdate.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.xkrs.model.validation; - -public interface SettingQoUpdate { -} diff --git a/src/main/java/com/xkrs/model/validation/ShanDongFirePointVerifyStateQoUpdate.java b/src/main/java/com/xkrs/model/validation/ShanDongFirePointVerifyStateQoUpdate.java deleted file mode 100644 index 42f06d3..0000000 --- a/src/main/java/com/xkrs/model/validation/ShanDongFirePointVerifyStateQoUpdate.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.xkrs.model.validation; - -public interface ShanDongFirePointVerifyStateQoUpdate { -} From d156aac21dcacf4d233b3f1968256161e2c28461 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 10 Jan 2023 15:01:39 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/utils/FileFastDfs.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/xkrs/utils/FileFastDfs.java b/src/main/java/com/xkrs/utils/FileFastDfs.java index 8eb184a..a6c5e43 100644 --- a/src/main/java/com/xkrs/utils/FileFastDfs.java +++ b/src/main/java/com/xkrs/utils/FileFastDfs.java @@ -95,9 +95,11 @@ public class FileFastDfs { final String fail = "fail"; if (null != node) { if (fail.equals(node.path(STATUS).asText())) { +// file1.delete();//TODO 删还是不删啊? return null; } } +// file1.delete();//TODO 删还是不删啊? return result; } From c71990264aa0951d917ea024705958d96670350c Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Sat, 14 Jan 2023 10:15:52 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/utils/FileFastDfs.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xkrs/utils/FileFastDfs.java b/src/main/java/com/xkrs/utils/FileFastDfs.java index a6c5e43..c39dc24 100644 --- a/src/main/java/com/xkrs/utils/FileFastDfs.java +++ b/src/main/java/com/xkrs/utils/FileFastDfs.java @@ -95,11 +95,11 @@ public class FileFastDfs { final String fail = "fail"; if (null != node) { if (fail.equals(node.path(STATUS).asText())) { -// file1.delete();//TODO 删还是不删啊? + file1.delete(); return null; } } -// file1.delete();//TODO 删还是不删啊? + file1.delete(); return result; }