From 208731a6c41b644186bb68c93c19ef7026284e3b Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Thu, 12 Mar 2026 16:04:43 +0800
Subject: [PATCH] 2026-03-09 优化标注功能 增加GeoCalculator计算工具类,算出面、圆的水平面积和水平周长,线的水平距离和直线距离。在调取按标注id获取标注详细信息接口给出,不入库。

---
 ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java b/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
index 1b1e497..7a49d70 100644
--- a/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
+++ b/ard-work/src/main/java/com/ard/work/component/forest/MyAddressSource.java
@@ -5,10 +5,12 @@
 import com.dtflys.forest.callback.AddressSource;
 import com.dtflys.forest.http.ForestAddress;
 import com.dtflys.forest.http.ForestRequest;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 
+@Slf4j
 @Component
 public class MyAddressSource implements AddressSource {
 
@@ -17,7 +19,15 @@
     @Override
     public ForestAddress getAddress(ForestRequest request) {
         String serverKey = request.varAsString("serverId");
-        ArdServerInfo serverInfo = ardServerService.selectArdServerManagementById(serverKey);
+        if(serverKey == null){
+            log.warn("请求属性serverId为空");
+            return null;
+        }
+        ArdServerInfo serverInfo = ardServerService.selectArdServerInfoById(serverKey);
+        if(serverInfo == null){
+            log.warn("边缘服务器不存在");
+            return null;
+        }
         // 返回 Forest 地址对象
         return new ForestAddress(serverInfo.getHost(), serverInfo.getHttpPort());
     }

--
Gitblit v1.9.3