From 50fb24982f4da36d03dbb92db6f97248be9f831f Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 15 二月 2023 13:59:17 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/service/show/MarkService.java |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/lf/server/service/show/MarkService.java b/src/main/java/com/lf/server/service/show/MarkService.java
index 0fb3ade..da8ad3f 100644
--- a/src/main/java/com/lf/server/service/show/MarkService.java
+++ b/src/main/java/com/lf/server/service/show/MarkService.java
@@ -1,5 +1,6 @@
 package com.lf.server.service.show;
 
+import com.lf.server.entity.all.StaticData;
 import com.lf.server.entity.ctrl.MarkJsonEntity;
 import com.lf.server.entity.data.DownloadEntity;
 import com.lf.server.entity.data.MetaEntity;
@@ -89,12 +90,10 @@
      *
      * @param ue   鐢ㄦ埛瀹炰綋
      * @param list 鏍囩粯JSON瀹炰綋绫婚泦鍚�
-     * @param req  璇锋眰
-     * @param res  鍝嶅簲
      * @return GUID
      * @throws Exception 寮傚父
      */
-    public String downloadShp(UserEntity ue, List<MarkJsonEntity> list, HttpServletRequest req, HttpServletResponse res) throws Exception {
+    public String downloadShp(UserEntity ue, List<MarkJsonEntity> list) throws Exception {
         String parent = pathHelper.getTempPath();
 
         String path = createShapeFiles(ue, list, parent);
@@ -145,7 +144,7 @@
      * 鑾峰彇shp鐩綍
      */
     private String getShpDir(UserEntity ue, String parent) {
-        String path = parent + File.separator + WebHelper.getRandomInt(100000, 1000000);
+        String path = parent + File.separator + StringHelper.YMDHMS2_FORMAT.format(new Date());
 
         File file = new File(path);
         if (!file.exists() && !file.isDirectory()) {
@@ -164,7 +163,7 @@
             if (StringHelper.isEmpty(mark.getWkt())) {
                 continue;
             }
-            if (mark.getWkt().indexOf(type) > -1) {
+            if (mark.getWkt().contains(type)) {
                 rs.add(mark);
             }
         }
@@ -219,7 +218,7 @@
     public List<MarkJsonEntity> readShpForMarks(List<MetaFileEntity> list) {
         String fileName = null;
         for (MetaFileEntity mf : list) {
-            if (mf.getName().toLowerCase().contains(".shp")) {
+            if (mf.getName().toLowerCase().contains(StaticData.SHP)) {
                 fileName = mf.getPath();
                 break;
             }

--
Gitblit v1.9.3