From ac20dc99bf1f463365dba071973e08fffbd294b4 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 14 七月 2023 14:12:21 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/service/data/MetaService.java |   40 ++++++++++++++++++++++------------------
 1 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/lf/server/service/data/MetaService.java b/src/main/java/com/lf/server/service/data/MetaService.java
index 9d75b00..0b6dc99 100644
--- a/src/main/java/com/lf/server/service/data/MetaService.java
+++ b/src/main/java/com/lf/server/service/data/MetaService.java
@@ -10,6 +10,7 @@
 import com.lf.server.entity.sys.UserEntity;
 import com.lf.server.helper.*;
 import com.lf.server.mapper.all.BasicMapper;
+import com.lf.server.mapper.all.GeomBaseMapper;
 import com.lf.server.mapper.data.MetaMapper;
 import com.lf.server.service.all.BaseQueryService;
 import com.lf.server.service.sys.MetaDownService;
@@ -114,8 +115,8 @@
     }
 
     @Override
-    public MetaEntity selectByGuid(String guid, String tab) {
-        return metaMapper.selectByGuid(guid, tab);
+    public MetaEntity selectByGuid(String guid, String dircode, String tab) {
+        return metaMapper.selectByGuid(guid, dircode, tab);
     }
 
     @Override
@@ -238,6 +239,9 @@
             if (str.contains("bs.s_explorationpoint ")) {
                 list.add(str.replace("bs.s_explorationpoint ", "bs.s_surveyworksite "));
             }
+            if (str.contains("bs.m_surface_deformation_data ")) {
+                list.add(str.replace("bs.m_surface_deformation_data ", "bs.m_surface_deformation_data_date "));
+            }
 
             i++;
         }
@@ -269,7 +273,7 @@
                 return;
             }
 
-            MetaEntity me = selectByGuid(guid, null);
+            MetaEntity me = selectByGuid(guid, null, null);
             if (me == null) {
                 WebHelper.writeStr2Page(res, StaticData.NO_FILE);
                 return;
@@ -299,6 +303,11 @@
 
     /**
      * 璇锋眰鍏冩暟鎹笅杞�
+     *
+     * @param ue 鐢ㄦ埛瀹炰綋
+     * @param dr 璇锋眰涓嬭浇瀹炰綋
+     * @return 涓嬭浇鏂囦欢GUID
+     * @throws Exception 寮傚父
      */
     public String downloadMeteReq(UserEntity ue, DownloadReqEntity dr) throws Exception {
         List<MetaEntity> list = selectMetaFiles(dr.getIds());
@@ -306,18 +315,6 @@
             return null;
         }
 
-        return zipFiles(ue, list, dr.getPwd());
-    }
-
-    /**
-     * 鎵撳寘鏂囦欢
-     *
-     * @param ue   鐢ㄦ埛瀹炰綋
-     * @param list 鍏冩暟鎹枃浠堕泦鍚�
-     * @param pwd  瀵嗙爜
-     * @return 涓嬭浇鏂囦欢GUID
-     */
-    public String zipFiles(UserEntity ue, List<MetaEntity> list, String pwd) throws Exception {
         Map<String, List<String>> tabs = getTabs(list);
         rmRepeatMetas(list);
 
@@ -338,7 +335,7 @@
         }
 
         String zipFile = pathHelper.getDownloadFullPath() + File.separator + tempName + ".zip";
-        ZipFile zip = Zip4jHelper.createZipFile(zipFile, pwd);
+        ZipFile zip = Zip4jHelper.createZipFile(zipFile, dr.getPwd());
         ZipParameters params = Zip4jHelper.getZipParams(true);
         addMetaFiles(zip, params, list);
         if (dataMap.size() > 0) {
@@ -346,7 +343,7 @@
             addAnnex(zip, params, annexMap);
         }
 
-        String dbPwd = Md5Helper.reverse(Md5Helper.generate(pwd));
+        String dbPwd = Md5Helper.reverse(Md5Helper.generate(dr.getPwd()));
         DownloadEntity de = getDownloadEntity(ue, zipFile, dbPwd);
         int rows = downloadService.insert(de);
         if (de.getId() > 0) {
@@ -462,6 +459,9 @@
         String filter = String.format("parentid in (%s)", StringHelper.join(ids, ","));
 
         QueryWrapper<T> wrapper = new QueryWrapper<T>();
+        if (baseMapper instanceof GeomBaseMapper) {
+            wrapper.select("ST_AsText(geom) as geom, *");
+        }
         wrapper.apply(filter);
 
         return wrapper;
@@ -512,6 +512,8 @@
                     case StaticData.MPT:
                         addMultiFile(uploadPath, mf, zip, params, StaticData.MPT_EXT);
                         break;
+                    case StaticData.JPG:
+                        addMultiFile(uploadPath, mf, zip, params, StaticData.JPG_EXT);
                     case StaticData.IMG:
                         addMultiFile(uploadPath, mf, zip, params, StaticData.IMG_EXT);
                         break;
@@ -525,6 +527,8 @@
                         addMultiFile(uploadPath, mf, zip, params, StaticData.SHP_EXT);
                         break;
                     case StaticData.GDB:
+                        continue;
+                    case StaticData.OSGB:
                         addFolderFile(uploadPath, mf, zip, params);
                         break;
                     default:
@@ -598,7 +602,7 @@
     private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) {
         DownloadEntity de = new DownloadEntity();
         de.setName(FileHelper.getFileName(file));
-        // 1-Shp鏂囦欢锛�2-涓撻鍥撅紝3-鍏冩暟鎹紝4-涓氬姟鏁版嵁锛�5-绠¢亾鍒嗘瀽锛�6-缁熻鎶ュ憡
+        // 1-Shp鏂囦欢锛�2-涓撻鍥撅紝3-鍏冩暟鎹紝4-涓氬姟鏁版嵁锛�5-绠¢亾鍒嗘瀽锛�6-缁熻鎶ュ憡锛�7-闄勪欢鏂囦欢锛�8-鐡︾墖鏂囦欢
         de.setType(3);
         de.setSizes(FileHelper.sizeToMb(new File(file).length()));
         de.setDepid(ue.getDepid());

--
Gitblit v1.9.3