From 0db5d12f25e1532790b569d9570ec9a79808eaa0 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 28 二月 2024 15:22:11 +0800
Subject: [PATCH] 添加JTS类库

---
 src/main/java/com/lf/server/entity/ctrl/CountEntity.java   |   10 +++++
 pom.xml                                                    |    6 +++
 src/main/java/com/lf/server/entity/all/RedisCacheKey.java  |    7 +++
 src/main/java/com/lf/server/service/sys/ReportService.java |   39 +++++++++++++++++--
 4 files changed, 57 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0a48474..ac38c49 100644
--- a/pom.xml
+++ b/pom.xml
@@ -260,6 +260,12 @@
             <artifactId>proj4j</artifactId>
             <version>0.1.0</version>
         </dependency>
+        <!-- JTS -->
+        <dependency>
+            <groupId>org.locationtech.jts</groupId>
+            <artifactId>jts-core</artifactId>
+            <version>1.19.0</version>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/src/main/java/com/lf/server/entity/all/RedisCacheKey.java b/src/main/java/com/lf/server/entity/all/RedisCacheKey.java
index 0699458..1e68645 100644
--- a/src/main/java/com/lf/server/entity/all/RedisCacheKey.java
+++ b/src/main/java/com/lf/server/entity/all/RedisCacheKey.java
@@ -81,4 +81,11 @@
     public static String sridKey(String key) {
         return "geom:srid:" + key;
     }
+
+    /**
+     * 鏁版嵁缁熻鎺堟潈閿�
+     */
+    public static String dataCountKey(String key) {
+        return "data:count:" + key;
+    }
 }
diff --git a/src/main/java/com/lf/server/entity/ctrl/CountEntity.java b/src/main/java/com/lf/server/entity/ctrl/CountEntity.java
index c84de19..06c01a5 100644
--- a/src/main/java/com/lf/server/entity/ctrl/CountEntity.java
+++ b/src/main/java/com/lf/server/entity/ctrl/CountEntity.java
@@ -17,6 +17,8 @@
 
     private Double sizes;
 
+    private Double area;
+
     public CountEntity() {
     }
 
@@ -67,4 +69,12 @@
     public void setSizes(Double sizes) {
         this.sizes = sizes;
     }
+
+    public Double getArea() {
+        return area;
+    }
+
+    public void setArea(Double area) {
+        this.area = area;
+    }
 }
diff --git a/src/main/java/com/lf/server/service/sys/ReportService.java b/src/main/java/com/lf/server/service/sys/ReportService.java
index e01b58e..a01529c 100644
--- a/src/main/java/com/lf/server/service/sys/ReportService.java
+++ b/src/main/java/com/lf/server/service/sys/ReportService.java
@@ -1,5 +1,8 @@
 package com.lf.server.service.sys;
 
+import com.lf.server.entity.all.RedisCacheKey;
+import com.lf.server.entity.all.ResAuthEntity;
+import com.lf.server.entity.all.SettingData;
 import com.lf.server.entity.all.StaticData;
 import com.lf.server.entity.ctrl.CountEntity;
 import com.lf.server.entity.data.DownloadEntity;
@@ -8,13 +11,16 @@
 import com.lf.server.entity.sys.UserEntity;
 import com.lf.server.helper.*;
 import com.lf.server.mapper.sys.ReportMapper;
+import com.lf.server.service.all.RedisService;
 import com.lf.server.service.data.DownloadService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 
 /**
  * 鎶ュ憡妯℃澘
@@ -22,17 +28,20 @@
  */
 @Service
 public class ReportService implements ReportMapper {
-    @Autowired
+    @Resource
     ReportMapper reportMapper;
 
-    @Autowired
+    @Resource
     AttachService attachService;
 
-    @Autowired
+    @Resource
     PathHelper pathHelper;
 
-    @Autowired
+    @Resource
     DownloadService downloadService;
+
+    @Resource
+    RedisService redisService;
 
     @Override
     public Integer selectCount(String name, String code) {
@@ -115,7 +124,27 @@
 
     @Override
     public List<CountEntity> countExplorationPoints() {
-        return reportMapper.countExplorationPoints();
+        String key = RedisCacheKey.dataCountKey("countExplorationPoints");
+        Object obj = redisService.get(key);
+        if (obj instanceof List<?>) {
+            return (List<CountEntity>) obj;
+        }
+
+        List<CountEntity> list = reportMapper.countExplorationPoints();
+        if (null != list && list.size() > 0) {
+            countExplorationArea(list);
+            redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES);
+        }
+
+        return list;
+    }
+
+    /**
+     * 缁熻閽诲瓟鐐归潰绉�
+     */
+    private void countExplorationArea(List<CountEntity> list) {
+
+
     }
 
     /**

--
Gitblit v1.9.3