From 7d536d24aa867e9dd4304db39f267373679a6480 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 13 三月 2024 10:54:18 +0800
Subject: [PATCH] 解决定时器启动计算数据时报错

---
 src/main/java/com/lf/server/service/show/OneMapService.java |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/lf/server/service/show/OneMapService.java b/src/main/java/com/lf/server/service/show/OneMapService.java
index f1e7a6e..5beb4bd 100644
--- a/src/main/java/com/lf/server/service/show/OneMapService.java
+++ b/src/main/java/com/lf/server/service/show/OneMapService.java
@@ -418,26 +418,28 @@
      */
     public String calcData() {
         Integer rows = selectLineBuffer();
-
         List<Map<String, Object>> list = selectMetaByType();
         if (null != list && list.size() > 0) {
-            HttpServletRequest req = WebHelper.getRequest();
-            String rootPath = pathHelper.getUploadFullPath();
-            for (Map<String, Object> map : list) {
-                String sjfl = map.get("type").toString();
-                String id = map.get("id").toString();
-                String wjlj = rootPath + File.separator + map.get("path").toString();
+            try {
+                String rootPath = pathHelper.getConfig().getUploadPath();
+                for (Map<String, Object> map : list) {
+                    String sjfl = map.get("type").toString();
+                    String id = map.get("id").toString();
+                    String wjlj = rootPath + File.separator + map.get("path").toString();
 
-                File file = new File(wjlj);
-                if (!file.exists() || file.isDirectory()) {
-                    continue;
-                }
+                    File file = new File(wjlj);
+                    if (!file.exists() || file.isDirectory()) {
+                        continue;
+                    }
 
-                String str = fmeService.calcArea(sjfl, id, wjlj, req);
-                if (null != str) {
-                    System.out.println(str);
+                    String str = fmeService.calcArea(sjfl, id, wjlj);
+                    if (null != str) {
+                        System.out.println(str);
+                    }
+                    rows++;
                 }
-                rows++;
+            } catch (Exception ex) {
+                log.error(ex.getMessage(), ex);
             }
         }
 

--
Gitblit v1.9.3