From 22713a6cb6bed3e3f2cdfffae58161fabbb5d120 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 20 七月 2023 10:35:19 +0800
Subject: [PATCH] 1

---
 src/main/java/com/yssh/entity/DistanceSuYuan.java         |   15 +++++++++++++++
 pom.xml                                                   |    2 +-
 src/main/java/com/yssh/service/WarningAnalyseService.java |    9 +++++++++
 src/main/java/com/yssh/entity/Report.java                 |   17 +++++++++++++++--
 4 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0c77bed..45d1281 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
         <relativePath/>
     </parent>
     <!--鎵撳寘鎴恓ar銆亀ar-->
-    <packaging>jar</packaging>
+    <packaging>war</packaging>
 
     <groupId>com</groupId>
     <artifactId>yssh</artifactId>
diff --git a/src/main/java/com/yssh/entity/DistanceSuYuan.java b/src/main/java/com/yssh/entity/DistanceSuYuan.java
index c7bc9cc..9d9a6bb 100644
--- a/src/main/java/com/yssh/entity/DistanceSuYuan.java
+++ b/src/main/java/com/yssh/entity/DistanceSuYuan.java
@@ -24,14 +24,21 @@
 	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;
 
@@ -146,4 +153,12 @@
 	public void setLat(double lat) {
 		this.lat = lat;
 	}
+
+	public String getAddr() {
+		return addr;
+	}
+
+	public void setAddr(String addr) {
+		this.addr = addr;
+	}
 }
diff --git a/src/main/java/com/yssh/entity/Report.java b/src/main/java/com/yssh/entity/Report.java
index 84b5628..e582283 100644
--- a/src/main/java/com/yssh/entity/Report.java
+++ b/src/main/java/com/yssh/entity/Report.java
@@ -51,10 +51,14 @@
     @ApiModelProperty(value = "鏈�澶у�肩殑ID")
     private String maxId;
 
+    @ApiModelProperty(value = "鏈�澶у�肩殑鍦板悕")
+    private String maxAddr;
+
     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) {
+    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, String maxAddr) {
         this.id = id;
         this.name = name;
         this.lon = lon;
@@ -68,6 +72,7 @@
         this.maxDir = maxDir;
         this.isSame = isSame;
         this.maxId = maxId;
+        this.maxAddr = maxAddr;
     }
 
     /**
@@ -97,7 +102,7 @@
         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);
+                speed1, dir, maxVal, dis1, maxDir, isSame, maxId, suMax.getAddr());
     }
 
     public String getId() {
@@ -211,4 +216,12 @@
     public void setMaxId(String maxId) {
         this.maxId = maxId;
     }
+
+    public String getMaxAddr() {
+        return maxAddr;
+    }
+
+    public void setMaxAddr(String maxAddr) {
+        this.maxAddr = maxAddr;
+    }
 }
diff --git a/src/main/java/com/yssh/service/WarningAnalyseService.java b/src/main/java/com/yssh/service/WarningAnalyseService.java
index 7a9d6d2..05a9979 100644
--- a/src/main/java/com/yssh/service/WarningAnalyseService.java
+++ b/src/main/java/com/yssh/service/WarningAnalyseService.java
@@ -50,6 +50,9 @@
     @Resource
     private QxshMapper qxshMapper;
 
+    @Resource
+    private SuYuanService suYuanService;
+
     private SimpleDateFormat ym = new SimpleDateFormat("yyyyMM%");
 
     @Async("threadPoolTaskExecutor")
@@ -397,6 +400,12 @@
             List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50);
             DistanceSuYuan suMax = suYuanMapper.getSuYuan500Max(wd.getTableName(), ids3d);
 
+            String[] strs = suMax.getId().split("_");
+            int x = Integer.parseInt(strs[0]) / 10;
+            int y = Integer.parseInt(strs[1]) / 10;
+            String addr = suYuanService.selectAddrByXY(x, y);
+            suMax.setAddr(addr);
+
             Report report = Report.calcReport(wd, suYuan, suMax);
             report.setLastVal(lastVal);
 

--
Gitblit v1.9.3