lyhzzz 6 hónapja
szülő
commit
024eba9c04
41 módosított fájl, 585 hozzáadás és 452 törlés
  1. 4 4
      doc/fd_fusion-local-jm.sql
  2. 13 1
      src/main/java/com/fdkankan/fusion/FusionApplication.java
  3. 10 8
      src/main/java/com/fdkankan/fusion/common/FilePath.java
  4. 5 10
      src/main/java/com/fdkankan/fusion/common/OssPath.java
  5. 7 4
      src/main/java/com/fdkankan/fusion/common/util/DateUtils.java
  6. 10 7
      src/main/java/com/fdkankan/fusion/common/util/LocalToOssUtil.java
  7. 11 13
      src/main/java/com/fdkankan/fusion/common/util/OBJToGLBUtil.java
  8. 9 0
      src/main/java/com/fdkankan/fusion/common/util/SceneTypeUtil.java
  9. 6 2
      src/main/java/com/fdkankan/fusion/common/util/ShellCmd.java
  10. 9 12
      src/main/java/com/fdkankan/fusion/common/util/ShellUtil.java
  11. 4 0
      src/main/java/com/fdkankan/fusion/config/CacheUtil.java
  12. 0 142
      src/main/java/com/fdkankan/fusion/config/FdkkLaserConfig.java
  13. 1 2
      src/main/java/com/fdkankan/fusion/controller/CaseController.java
  14. 1 1
      src/main/java/com/fdkankan/fusion/controller/DictFileController.java
  15. 10 1
      src/main/java/com/fdkankan/fusion/controller/DownOfflinePackageController.java
  16. 1 1
      src/main/java/com/fdkankan/fusion/controller/SceneApiController.java
  17. 1 0
      src/main/java/com/fdkankan/fusion/controller/TestController.java
  18. 3 3
      src/main/java/com/fdkankan/fusion/controller/UploadController.java
  19. 58 87
      src/main/java/com/fdkankan/fusion/down/CaseDownService.java
  20. 102 0
      src/main/java/com/fdkankan/fusion/entity/Path.java
  21. 1 1
      src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java
  22. 9 0
      src/main/java/com/fdkankan/fusion/httpClient/LaserService.java
  23. 10 1
      src/main/java/com/fdkankan/fusion/httpClient/address/LaserAddressSource.java
  24. 8 0
      src/main/java/com/fdkankan/fusion/httpClient/client/LaserClient.java
  25. 12 0
      src/main/java/com/fdkankan/fusion/httpClient/request/SSDownSceneParamLocal.java
  26. 18 0
      src/main/java/com/fdkankan/fusion/mapper/IPathMapper.java
  27. 26 8
      src/main/java/com/fdkankan/fusion/mq/consumer/OsgbToB3dmConsumer.java
  28. 2 0
      src/main/java/com/fdkankan/fusion/request/ScenePram.java
  29. 10 0
      src/main/java/com/fdkankan/fusion/response/DownParam.java
  30. 1 1
      src/main/java/com/fdkankan/fusion/service/ICaseService.java
  31. 1 1
      src/main/java/com/fdkankan/fusion/service/ICommonUploadService.java
  32. 17 0
      src/main/java/com/fdkankan/fusion/service/IPathService.java
  33. 31 3
      src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java
  34. 16 14
      src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java
  35. 1 3
      src/main/java/com/fdkankan/fusion/service/impl/CaseViewServiceImpl.java
  36. 75 64
      src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java
  37. 36 0
      src/main/java/com/fdkankan/fusion/service/impl/PathServiceImpl.java
  38. 33 9
      src/main/java/com/fdkankan/fusion/service/impl/SceneCommonService.java
  39. 1 1
      src/main/java/com/fdkankan/fusion/task/TaskService.java
  40. 7 48
      src/main/resources/application.yml
  41. 5 0
      src/main/resources/mapper/fusion/PathMapper.xml

+ 4 - 4
doc/fd_fusion-local-jm.sql

@@ -1,7 +1,7 @@
-CREATE DATABASE IF NOT EXISTS fd_fusion CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
-use fd_fusion;
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
+-- CREATE DATABASE IF NOT EXISTS fd_fusion CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
+-- use fd_fusion;
+-- SET NAMES utf8mb4;
+-- SET FOREIGN_KEY_CHECKS = 0;
 
 -- ----------------------------
 -- Table structure for t_case

+ 13 - 1
src/main/java/com/fdkankan/fusion/FusionApplication.java

@@ -1,7 +1,9 @@
 package com.fdkankan.fusion;
 
 import com.fdkankan.fusion.config.CacheUtil;
+import com.fdkankan.fusion.service.IPathService;
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
@@ -19,6 +21,10 @@ public class FusionApplication  implements CommandLineRunner {
 
     @Value("${upload.type}")
     private String uploadType;
+    @Value("${fdkk.installPath}")
+    private String installPath;
+    @Autowired
+    IPathService pathService;
     public static void main(String[] args) {
         SpringApplication.run(FusionApplication.class, args);
     }
@@ -26,6 +32,12 @@ public class FusionApplication  implements CommandLineRunner {
     @Override
     public void run(String... args) throws Exception {
         CacheUtil.uploadType = uploadType;
-
+        CacheUtil.installPath = installPath;
+        String path = pathService.getBasePath();
+        if(path != null){
+            CacheUtil.basePath = path ;
+        }else {
+            CacheUtil.basePath = installPath +"/4DKK_PROGRAM_STATIC/";
+        }
     }
 }

+ 10 - 8
src/main/java/com/fdkankan/fusion/common/FilePath.java

@@ -1,10 +1,12 @@
 package com.fdkankan.fusion.common;
 
+import com.fdkankan.fusion.config.CacheUtil;
+
 public class FilePath {
 
-    public final static String LOCAL_BASE_PATH = "/mnt/fusion/";
-    public final static String MNTPATH = "/mnt/";
-    public final static String MNT_BASE_PATH = "/mnt/fusion/";
+    public final static String LOCAL_BASE_PATH = CacheUtil.basePath;
+    public final static String MNTPATH = CacheUtil.basePath;
+    public final static String MNT_BASE_PATH = CacheUtil.basePath;
     public final static String OBJ_OSS_PATH = "scene_view_data/%s";
     public final static String VIDEO_OSS_PATH = "fusion/%s/video/%s";
     public final static String File_OSS_PATH = "fusion/%s/file/%s";
@@ -15,12 +17,12 @@ public class FilePath {
      public final static String VIDEO_LOCAL_PATH = LOCAL_BASE_PATH + "%s/video/merge";
      public final static String OBJ_LOCAL_PATH = LOCAL_BASE_PATH + "%s/model/%s";
 
-    public final static String FFMPEG_IMG_PATH  = "/mnt/fusion/ffmpeg_imgs";
+    public final static String FFMPEG_IMG_PATH  = LOCAL_BASE_PATH +"ffmpeg_imgs";
 
-    public final static String OFFLINE_PACKAGE_PATH = "/mnt/fusion/offline/offline_";
-    public final static String OFFLINE_TEMPLATE_PATH = "/mnt/fusion/offline/template";
-    public final static String OFFLINE_RESOURCE_PACKAGE_PATH = OFFLINE_PACKAGE_PATH + "%s/www/package/resource/";
-    public final static String OFFLINE_OSS_PATH = OFFLINE_PACKAGE_PATH + "%s/www";
+    public final static String OFFLINE_PACKAGE_PATH = LOCAL_BASE_PATH+  "offline/offline_";
+    public final static String OFFLINE_TEMPLATE_PATH = LOCAL_BASE_PATH +"offline/template";
+    public final static String OFFLINE_RESOURCE_PACKAGE_PATH  = "/www/package/resource/";
+    public final static String OFFLINE_OSS_PATH = "/www/oss/";
     public final static String OFFLINE_LASER_OSS_PATH =  "/swss/%s/www/%s/";
     public final static String LASER_OSS_PATH = "laser-prod/%s/data/%s/webcloud";
 }

+ 5 - 10
src/main/java/com/fdkankan/fusion/common/OssPath.java

@@ -1,17 +1,12 @@
 package com.fdkankan.fusion.common;
 
-public class OssPath {
-
-    public final static String localPath = "/mnt/";
-    public final static String MANAGE_FILE_PATH = "manage/file/%s/%s";
-    public final static String invoiceOssDir = "manage/invoice/";
-    public final static String v3_statusPath = "data/data%s/status.json";
-    public final static String v4_statusPath = "scene_view_data/%s/data/status.json";
-    public final static String localStatusPath = System.getProperty("java.io.tmpdir") +"status.json";   //获取临时文件目录
+import com.fdkankan.fusion.config.CacheUtil;
 
-    public final static String default_head ="manage/user/newHead.png";
+public class OssPath {
 
-    public final static String MANAGE_MODEL_FILE_PATH = "manage/media-library/%s";
+    public final static String localPath = CacheUtil.basePath;
+    public final static String MANAGE_FILE_PATH = "fusion/media-library/file/%s";
+    public final static String MANAGE_MODEL_FILE_PATH = "fusion/media-library/model/%s";
 
 
 

+ 7 - 4
src/main/java/com/fdkankan/fusion/common/util/DateUtils.java

@@ -89,10 +89,6 @@ public class DateUtils {
     }
 
 
-    public static void main(String[] args) {
-       // System.out.println(getMonthdateList(getYearAgo(),getMonthStr(new Date())));
-        System.out.println(getHoursTime(new Date()));
-    }
 
     public static String dateStr() {
         SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
@@ -100,4 +96,11 @@ public class DateUtils {
         long timeMillis = System.currentTimeMillis();
         return format + "_" + timeMillis + "_";
     }
+
+    public static void main(String[] args) {
+        String timeKey = DateUtils.dateStr();
+
+        System.out.println(timeKey);
+    }
+
 }

+ 10 - 7
src/main/java/com/fdkankan/fusion/common/util/LocalToOssUtil.java

@@ -1,6 +1,7 @@
 package com.fdkankan.fusion.common.util;
 
 import cn.hutool.core.io.FileUtil;
+import com.fdkankan.fusion.config.CacheUtil;
 import com.fdkankan.fusion.response.FileInfoVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
@@ -20,16 +21,14 @@ public class LocalToOssUtil {
     @Value("${oss.bucket:4dkankan}")
     private String bucket;
 
-    @Value("${oss.basePath:/oss/}")
-    private String basePath;
 
     private String getOssPath(String bucket, String filePath) {
-        return basePath.concat(bucket).concat(File.separator).concat(filePath);
+        return CacheUtil.basePath.concat(bucket).concat(File.separator).concat(filePath);
 
     }
 
     public String getOssPath( String filePath) {
-        return basePath.concat(bucket).concat(File.separator).concat(filePath);
+        return CacheUtil.basePath.concat(bucket).concat(File.separator).concat(filePath);
 
     }
 
@@ -40,7 +39,7 @@ public class LocalToOssUtil {
 
     public boolean downFormAli(String objectName, String localPath) {
         try {
-            FileUtil.copy(getOssPath(bucket, objectName), localPath, true);
+            FileUtil.copyContent(new File(getOssPath(bucket, objectName)), new File(localPath), true);
         }catch (Exception e){
             log.info("下载文件失败,remoteFilePath:{},localPath:{}", objectName, localPath);
             log.info("下载文件失败", e);
@@ -55,7 +54,7 @@ public class LocalToOssUtil {
                 log.warn("文件不存在:{}", filePath);
                 return null;
             }
-            FileUtil.copy(filePath, getOssPath(bucket, remoteFilePath), true);
+            FileUtil.copyContent(new File(filePath), new File(getOssPath(bucket, remoteFilePath)), true);
             //FileUtils.contentEqualsIgnoreEOL(new File(filePath),new File(getOssPath(bucket, remoteFilePath)), "UTF-8");
         }catch (Exception e){
             log.error("上传文件失败,filePath:{},remoteFilePath:{}", filePath, remoteFilePath);
@@ -90,7 +89,7 @@ public class LocalToOssUtil {
 
     public List<String> listKeysFromAli(String sourcePath) {
         return FileUtil.loopFiles(getOssPath(bucket, sourcePath)).stream()
-                .map(f -> f.getAbsolutePath().replace(basePath.concat(bucket).concat(File.separator), ""))
+                .map(f -> f.getAbsolutePath().replace(CacheUtil.basePath.concat(bucket).concat(File.separator), ""))
                 .collect(Collectors.toList());
     }
 
@@ -127,4 +126,8 @@ public class LocalToOssUtil {
     public Long getSize(String filePath) {
         return getSizeCount( getOssPath(bucket, filePath));
     }
+
+    public String getObjectContent(String s) {
+        return FileUtil.readUtf8String(new File(getOssPath(s)));
+    }
 }

+ 11 - 13
src/main/java/com/fdkankan/fusion/common/util/OBJToGLBUtil.java

@@ -5,8 +5,10 @@ import cn.hutool.core.io.file.FileReader;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.config.CacheUtil;
 import com.fdkankan.fusion.exception.BusinessException;
 import lombok.extern.slf4j.Slf4j;
+import okhttp3.Cache;
 import org.apache.commons.lang3.StringUtils;
 import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper;
 
@@ -18,13 +20,15 @@ import java.util.LinkedHashSet;
 @Slf4j
 public class OBJToGLBUtil {
 
+    public static String obj2glbCmd = CacheUtil.installPath +File.separator +"CGAII" +File.separator + "obj2gltf.exe -i %s -o %s";
+
     public static String objToGlb(String objPath, String glbPath)  {
         log.info("obj转换glb开始,{}",objPath);
         if(!checkObj(objPath)){
             throw new BusinessException(-1,"obj文件错误");
         }
         log.info("obj转换glb开始");
-        String command = "obj2gltf -i " + objPath + " -o " + glbPath;
+        String command = String.format(obj2glbCmd,objPath,glbPath);
         log.info("执行obj转换glb命令路径-{}", command);
         ShellUtil.execCmd(command);
         log.info("obj转换glb完毕:" + command);
@@ -33,7 +37,7 @@ public class OBJToGLBUtil {
     public static void objToGlb2(String objPath,String glbPath)  {
         log.info("obj转换glb开始,{}",objPath);
         log.info("obj转换glb开始");
-        String command = "obj2gltf -i " + objPath + " -o " + glbPath;
+        String command = String.format(obj2glbCmd,objPath,glbPath);
         log.info("执行obj转换glb命令路径-{}", command);
         ShellUtil.execCmd(command);
         log.info("obj转换glb完毕:" + command);
@@ -93,7 +97,7 @@ public class OBJToGLBUtil {
             throw new BusinessException(ResultCode.UPLOAD_FILE_OBJ_ERROR);
         }
         LinkedHashSet<String> imgName = new LinkedHashSet<>();
-        if(allFile == null || allFile.length()<=0 ){
+        if(allFile == null  ){
             throw new BusinessException(ResultCode.UPLOAD_FILE_OBJ_ERROR);
         }
         File[] files = allFile.listFiles();
@@ -178,15 +182,13 @@ public class OBJToGLBUtil {
         return imgName;
     }
 
-    public final static String LAS_TO_BIN = "bash  /home/ubuntu/bin/PotreeConverter.sh @inPath @outPath ''";
+    public final static String LAS_TO_BIN = CacheUtil.installPath + File.separator+"CGAII"+File.separator +"PotreeConverter.bat %s %s ''";
 
     public static File lasOrPlyToBin(File srcFile){
         if(!srcFile.exists()){
             srcFile.mkdirs();
         }
-        String cmd = LAS_TO_BIN;
-        cmd =  cmd.replace("@inPath",srcFile.getPath());
-        cmd = cmd.replace("@outPath",srcFile.getParentFile().getPath());
+        String cmd = String.format(LAS_TO_BIN,srcFile.getPath(),srcFile.getParentFile().getPath());
         ShellUtil.execCmd(cmd);
         log.info("lasOrPlyToBin---------cmd-over");
         String cloudJs = srcFile.getParentFile().getPath() +"/webcloud/"+ "cloud.js";
@@ -218,17 +220,13 @@ public class OBJToGLBUtil {
         File file = new File(targetPath);
         FileUtil.copyContent(objPathFile,file,true);
 
-        String cmd = ShellCmd.osgbTob3dmCmd.replaceAll("@path",FilePath.MNT_BASE_PATH);
-        cmd =cmd.replaceAll("@inputFile",targetPath);
-        cmd =cmd.replaceAll("@outputFile",sourcePath);
+        String cmd = String.format(ShellCmd.osgbTob3dmCmd,targetPath,sourcePath);
         ShellUtil.execCmd(cmd);
         return sourcePath;
     }
 
     public static String OsgbToB3dm(String  targetPath,String sourcePath) {
-        String cmd = ShellCmd.osgbTob3dmCmd.replaceAll("@path",FilePath.MNT_BASE_PATH);
-        cmd =cmd.replaceAll("@inputFile",targetPath);
-        cmd =cmd.replaceAll("@outputFile",sourcePath);
+        String cmd = String.format(ShellCmd.osgbTob3dmCmd,targetPath,sourcePath);
         ShellUtil.execCmd(cmd);
         return sourcePath;
     }

+ 9 - 0
src/main/java/com/fdkankan/fusion/common/util/SceneTypeUtil.java

@@ -1,5 +1,7 @@
 package com.fdkankan.fusion.common.util;
 
+import java.util.Arrays;
+
 public class SceneTypeUtil {
 
 
@@ -38,4 +40,11 @@ public class SceneTypeUtil {
             default:return false;
         }
     }
+
+    public static Object getSceneSourceList(Integer isObj) {
+        if(isObj == 0){
+            return Arrays.asList(4,5);
+        }
+        return Arrays.asList(1,3,4,5);
+    }
 }

+ 6 - 2
src/main/java/com/fdkankan/fusion/common/util/ShellCmd.java

@@ -1,5 +1,9 @@
 package com.fdkankan.fusion.common.util;
 
+import com.fdkankan.fusion.config.CacheUtil;
+
+import java.io.File;
+
 public class ShellCmd {
 
 	/**
@@ -10,6 +14,6 @@ public class ShellCmd {
 	public static final String FYUN_UPLOAD = "bash /opt/ossutil/fyun-upload.sh %s %s /%s %s %s";
 	public static final String FYUN_DOWN = "bash /opt/ossutil/fyun-download.sh %s /%s %s %s %s";
 
-	public static final String osgbTob3dmCmd = "bash /mnt/fusion/3dtile.sh -f osgb -i " +
-			"@inputFile -o @outputFile";
+	public static final String osgbTob3dmCmd = CacheUtil.installPath + File.separator+"CGAII" +File.separator +"3dtile"+File.separator  + "3dtile.exe -f osgb -i " +
+			"%s -o %s";
 }

+ 9 - 12
src/main/java/com/fdkankan/fusion/common/util/ShellUtil.java

@@ -1,5 +1,6 @@
 package com.fdkankan.fusion.common.util;
 
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.file.FileReader;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.config.CacheUtil;
@@ -12,9 +13,6 @@ import java.nio.charset.StandardCharsets;
 @Slf4j
 public class ShellUtil {
 
-    public final static String LAS_TO_BIN = "bash  /home/ubuntu/bin/PotreeConverter.sh @inPath @outPath ''";
-
-
 
         /**
          * 执行系统命令, 返回执行结果
@@ -178,19 +176,18 @@ public class ShellUtil {
      *  //@param fyunType   oss or aws
      */
     public static void yunUpload(String srcPath,String destPath){
-        String opType = srcPath.contains(".")? "file":"folder" ;
-        String cmd = String.format(ShellCmd.FYUN_UPLOAD, "4dkankan",srcPath,destPath, CacheUtil.uploadType,opType);
-        execCmd(cmd);
+        log.info("yunUpload:{},{}",srcPath,destPath);
+        FileUtil.copyContent(new File(srcPath),new File(destPath),true);
     }
     public static void yunDownload(String srcPath,String destPath){
-        String opType = srcPath.contains(".")? "file":"folder" ;
-        String cmd = String.format(ShellCmd.FYUN_DOWN,"4dkankan",srcPath,destPath, CacheUtil.uploadType,opType);
-        execCmd(cmd);
+        log.info("yunDownload:{},{}",srcPath,destPath);
+        FileUtil.copyContent(new File(srcPath),new File(destPath),true);
+
     }
 
     public static void yunDownloadSs(String srcPath,String destPath){
-        String opType = srcPath.contains(".")? "file":"folder" ;
-        String cmd = String.format(ShellCmd.FYUN_DOWN,"laser-data",srcPath.replace("/laser-data/",""),destPath, "minio",opType);
-        execCmd(cmd);
+        log.info("yunDownloadSs:{},{}",srcPath,destPath);
+        FileUtil.copyContent(new File(srcPath),new File(destPath),true);
+
     }
 }

+ 4 - 0
src/main/java/com/fdkankan/fusion/config/CacheUtil.java

@@ -1,6 +1,10 @@
 package com.fdkankan.fusion.config;
 
+import org.springframework.beans.factory.annotation.Value;
+
 public class CacheUtil {
     public static String uploadType;
 
+    public static String basePath;
+    public static String installPath;
 }

+ 0 - 142
src/main/java/com/fdkankan/fusion/config/FdkkLaserConfig.java

@@ -1,142 +0,0 @@
-package com.fdkankan.fusion.config;
-
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.util.StrUtil;
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-/**
- * 读取项目相关配置
- *
- * @author fdkk
- */
-@Component
-@ConfigurationProperties(prefix = "fdkk")
-@Data
-public class FdkkLaserConfig {
-
-
-    /**
-     * 上传路径
-     */
-    private static String profile;
-
-
-
-    /**
-     * 是否本地化文件存储
-     */
-    private static boolean isLocalization;
-    /**
-     * 本地化化部署,是否启用软连接
-     */
-    private static boolean isLink;
-
-    /**
-     * 是否使用文件存储系统
-     */
-    private static boolean isBucket;
-
-    /**
-     * java存放路径
-     */
-    public String binPath;
-
-
-    /**
-     * OSS默认路径
-     */
-    public String defaultFolder;
-
-
-    /**
-     * 生成模型的路径
-     */
-    public String buildModelPath;
-
-    public Integer laserPort;
-
-    public Integer getLaserPort() {
-        return laserPort;
-    }
-
-    public void setLaserPort(Integer laserPort) {
-        this.laserPort = laserPort;
-    }
-
-    @PostConstruct
-    private void init() {
-        FileUtil.mkdir(FdkkLaserConfig.profile);
-    }
-
-
-    public static String getProfile(String prefix) {
-        if(StrUtil.isNotEmpty(prefix)){
-            return prefix;
-        }
-        return FdkkLaserConfig.profile;
-    }
-
-    public void setProfile(String profile) {
-        FdkkLaserConfig.profile = profile;
-    }
-
-
-
-
-    public static boolean isLocalization() {
-        return FdkkLaserConfig.isLocalization;
-    }
-
-    public void setIsLocalization(boolean isLocalization) {
-        FdkkLaserConfig.isLocalization = isLocalization;
-    }
-
-    public static boolean isIsLink() {
-        return FdkkLaserConfig.isLink;
-    }
-
-    public  void setIsLink(boolean isLink) {
-        FdkkLaserConfig.isLink = isLink;
-    }
-
-
-    public static boolean isBucket() {
-        return FdkkLaserConfig.isBucket;
-    }
-
-    public  void setIsBucket(boolean isBucket) {
-        FdkkLaserConfig.isBucket = isBucket;
-    }
-
-    /**
-     * 获取导入上传路径
-     */
-    public static String getImportPath(String prefix) {
-        return FdkkLaserConfig.getProfile(prefix) + "/import";
-    }
-
-    /**
-     * 获取头像上传路径
-     */
-    public static String getAvatarPath(String prefix) {
-        return FdkkLaserConfig.getProfile(prefix) + "/avatar";
-    }
-
-    /**
-     * 获取下载路径
-     */
-    public static String getDownloadPath(String prefix) {
-        return FdkkLaserConfig.getProfile(prefix) + "/download/";
-    }
-
-    /**
-     * 获取上传路径
-     */
-    public static String getUploadPath(String prefix) {
-        return FdkkLaserConfig.getProfile(prefix) + "/upload";
-    }
-}

+ 1 - 2
src/main/java/com/fdkankan/fusion/controller/CaseController.java

@@ -49,8 +49,7 @@ public class CaseController extends BaseController{
 
     @PostMapping("/addOrUpdate")
     public ResultData addOrUpdate(@RequestBody CaseEntity param){
-        caseService.addOrUpdate(param);
-        return ResultData.ok();
+        return ResultData.ok(caseService.addOrUpdate(param));
     }
 
     @PostMapping("/delete")

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/DictFileController.java

@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
  * @since 2024-12-02
  */
 @RestController
-@RequestMapping("/service/manage/dictFile")
+@RequestMapping("/dictFile")
 public class DictFileController extends BaseController{
 
     @Autowired

+ 10 - 1
src/main/java/com/fdkankan/fusion/controller/DownOfflinePackageController.java

@@ -3,6 +3,7 @@ package com.fdkankan.fusion.controller;
 
 import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.down.CaseDownService;
+import com.fdkankan.fusion.response.DownParam;
 import com.fdkankan.fusion.response.DownVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -29,7 +30,7 @@ public class DownOfflinePackageController {
     }
     @GetMapping("/down")
     public ResultData down(@RequestParam(required = false) Integer caseId){
-        caseDownService.downOffline(caseId);
+        caseDownService.downOffline(caseId,null);
         DownVo downVo = new DownVo();
         downVo.setDownloadStatus(1);
         return ResultData.ok(downVo);
@@ -38,5 +39,13 @@ public class DownOfflinePackageController {
     public ResultData process(@RequestParam(required = false) Integer caseId){
         return ResultData.ok(caseDownService.process(caseId));
     }
+
+    @PostMapping("/downPath")
+    public ResultData downPath(@RequestBody DownParam param){
+        caseDownService.downOffline(param.getCaseId(),param.getPath());
+        DownVo downVo = new DownVo();
+        downVo.setDownloadStatus(1);
+        return ResultData.ok(downVo);
+    }
 }
 

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/SceneApiController.java

@@ -23,7 +23,7 @@ public class SceneApiController extends BaseController{
 
     @PostMapping("/list")
     public ResultData list(@RequestBody ScenePram param){
-        if(param.getType() == null || param.getNumList() == null || param.getNumList().size() <=0){
+        if(param.getIsObj() == null || param.getNumList() == null || param.getNumList().size() <=0){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         param.setPageNum(1);

+ 1 - 0
src/main/java/com/fdkankan/fusion/controller/TestController.java

@@ -13,6 +13,7 @@ import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.common.util.ShellUtil;
 import com.fdkankan.fusion.entity.*;
 import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.httpClient.client.LaserClient;
 import com.fdkankan.fusion.response.CaseInquestVo;
 import com.fdkankan.fusion.response.WitnessVo;
 import com.fdkankan.fusion.service.*;

+ 3 - 3
src/main/java/com/fdkankan/fusion/controller/UploadController.java

@@ -37,12 +37,12 @@ public class UploadController {
 
     /**
      * 文件上传
-     * @param file 文件
      */
     @RequestMapping(value = "/fileNew", method = RequestMethod.POST)
     public ResultData uploadNew(
-            @RequestParam(value = "file") MultipartFile file,@RequestParam(value = "dictId",required = false) Integer dictId) {
+            @RequestParam(value = "dictId",required = false) Integer dictId,
+            @RequestParam(value = "filePath",required = false) String filePath) {
 
-        return commonUploadService.uploadFileNew(file,dictId);
+        return commonUploadService.uploadFileNew(dictId,filePath);
     }
 }

+ 58 - 87
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.deepoove.poi.XWPFTemplate;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultData;
+import com.fdkankan.fusion.common.util.DateUtils;
 import com.fdkankan.fusion.common.util.ShellUtil;
 import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.*;
@@ -30,6 +31,7 @@ import org.springframework.stereotype.Service;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.nio.charset.StandardCharsets;
+import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 
@@ -131,7 +133,9 @@ public class CaseDownService {
         return downVo;
     }
     @Async
-    public void downOffline(Integer caseId){
+    public void downOffline(Integer caseId,String zipPath){
+        String timeKey = DateUtils.dateStr();
+        String caseOffPath = FilePath.OFFLINE_PACKAGE_PATH+timeKey + caseId;
         try {
             String redisKey = String.format(downProcessKey, caseId);
             if( redisUtil.hasKey(redisKey)){
@@ -144,28 +148,27 @@ public class CaseDownService {
 
             setRedisProcess(caseId,0);
             //复制前端资源
-            cpIndexHtml(caseId);
+            cpIndexHtml(caseId,caseOffPath);
             setRedisProcess(caseId,10);
             //创建data.json并下载资源
-            createDataJson(caseId);
+            createDataJson(caseId,caseOffPath);
             setRedisProcess(caseId,50);
             //打包zip
-            String path = "/mnt/fusion/offline";
-            String name = "offline_"+ caseId;
-            String zipName = path+File.separator+name+".zip";
-            ShellUtil.zipOffline(zipName,name);
-            setRedisProcess(caseId,70);
-            //上传oss
-            String ossUrl = zipName.replace("/mnt/", "");
-            ShellUtil.yunUpload(zipName,ossUrl);
-            Thread.sleep(2000L);
-            FileUtil.del(zipName);
-            ossUrl = queryPath + ossUrl;
-            caseOfflineService.saveByCase(caseId,ossUrl);
-            setRedisProcess(caseId,100,ossUrl);
+            FileUtil.copyContent(new File(caseOffPath),new File(zipPath),true);
+            caseOfflineService.saveByCase(caseId,zipPath);
+            setRedisProcess(caseId,100,zipPath);
+
         }catch (Exception e){
             log.info("down-offline-error:{}",caseId,e);
             setRedisProcess(caseId,0,null,1003);
+        }finally {
+            try {
+                Thread.sleep(2000L);
+                FileUtil.del(caseOffPath);
+                setRedisProcess(caseId,0,null,1003);
+            }catch (Exception e){
+                log.info("down-offline-del-error:{}",caseId,e);
+            }
         }
 
     }
@@ -197,8 +200,8 @@ public class CaseDownService {
         return downVo;
     }
 
-    public void createDataJson(Integer caseId){
-        log.info("down-offline-createDataJson:{}",caseId);
+    public void createDataJson(Integer caseId,String caseOffPath){
+        log.info("down-offline-createDataJson:{}",caseOffPath);
         JSONObject jsonObject = new JSONObject();
         CaseParam param = new CaseParam();
         param.setCaseId(caseId);
@@ -210,8 +213,8 @@ public class CaseDownService {
         List<CaseSettings> caseSettings = caseSettingsService.getByCaseId(caseId);
         jsonObject.put(basePath+caseSettingsInfo+caseId, ResultData.ok(caseSettings));
         for (CaseSettings caseSetting : caseSettings) {
-            downResource(caseId,caseSetting.getBack());
-            downResource(caseId,caseSetting.getCover());
+            downResource(caseId,caseSetting.getBack(),caseOffPath);
+            downResource(caseId,caseSetting.getCover(),caseOffPath);
         }
 
         List<FusionNumVo> listByCaseId = fusionNumService.getListByCaseId(caseId,null);
@@ -224,7 +227,7 @@ public class CaseDownService {
         for (SceneVo sceneData : sceneVos) {
             //下载模型
             if(StringUtils.isNotBlank(sceneData.getModelGlbUrl())){
-                downModel(caseId,sceneData.getModelGlbUrl());
+                downModel(caseId,sceneData.getModelGlbUrl(),caseOffPath);
             }
             if(sceneData.getType() != 3){
                 //下载场景离线包
@@ -266,27 +269,27 @@ public class CaseDownService {
         List<CaseView> caseViews = caseViewService.allList(caseId, null, null, null, null);
         jsonObject.put(basePath+caseView+caseId, ResultData.ok(caseViews));
         for (CaseView view : caseViews) {
-            downResource(caseId,view.getViewImg());
-            downResource(caseId,view.getViewImgSmall());
+            downResource(caseId,view.getViewImg(),caseOffPath);
+            downResource(caseId,view.getViewImgSmall(),caseOffPath);
         }
 
         List<CaseVideoFolder> videoFolders = caseVideoFolderService.getAllList(caseId);
         jsonObject.put(basePath+caseVideoFolder+caseId, ResultData.ok(videoFolders));
         for (CaseVideoFolder videoFolder : videoFolders) {
-            downResource(caseId,videoFolder.getVideoFolderCover());
-            downResource(caseId,videoFolder.getVideoMergeUrl());
+            downResource(caseId,videoFolder.getVideoFolderCover(),caseOffPath);
+            downResource(caseId,videoFolder.getVideoMergeUrl(),caseOffPath);
 
             List<CaseVideo> allList = caseVideoService.getAllList(videoFolder.getVideoFolderId());
             for (CaseVideo video : allList) {
-                downResource(caseId,video.getVideoCover());
-                downResource(caseId,video.getVideoPath());
+                downResource(caseId,video.getVideoCover(),caseOffPath);
+                downResource(caseId,video.getVideoPath(),caseOffPath);
             }
             jsonObject.put(basePath+caseVideo+videoFolder.getVideoFolderId(), ResultData.ok(allList));
         }
 
         List<CaseFiles> caseFilesList = caseFilesService.allList(caseId, null);
         for (CaseFiles files : caseFilesList) {
-            downResource(caseId,files.getFilesUrl());
+            downResource(caseId,files.getFilesUrl(),caseOffPath);
         }
         jsonObject.put(basePath+caseFiles+caseId, ResultData.ok(caseFilesList));
 
@@ -295,7 +298,7 @@ public class CaseDownService {
 
         List<HotIcon> hotIconList = hotIconService.getListByCaseId(caseId);
         for (HotIcon hotIcon : hotIconList) {
-            downResource(caseId,hotIcon.getIconUrl());
+            downResource(caseId,hotIcon.getIconUrl(),caseOffPath);
         }
         jsonObject.put(basePath+hostIcon+caseId, ResultData.ok(hotIconList));
 
@@ -303,8 +306,8 @@ public class CaseDownService {
         jsonObject.put(basePath+caseTag+caseId, ResultData.ok(caseTagList));
         for (CaseTag tag : caseTagList) {
             jsonObject.put(basePath+caseTagPoint+tag.getTagId(), ResultData.ok(caseTagPointService.allList(tag.getTagId())));
-            downResources(caseId,tag.getTagImgUrl());
-            downResource(caseId,tag.getHotIconUrl());
+            downResources(caseId,tag.getTagImgUrl(),caseOffPath);
+            downResource(caseId,tag.getHotIconUrl(),caseOffPath);
         }
 
         jsonObject.put(basePath+casePathInfoUrl+caseId, ResultData.ok(casePathService.getByCaseId(caseId)));
@@ -312,35 +315,35 @@ public class CaseDownService {
         jsonObject.put(basePath+fusionGuide+caseId, ResultData.ok(fusionGuides));
 
         for (FusionGuide guide : fusionGuides) {
-            downResource(caseId,guide.getCover());
+            downResource(caseId,guide.getCover(),caseOffPath);
             List<FusionGuidePath> listByGuideId = fusionGuidePathService.getListByGuideId(guide.getFusionGuideId());
             for (FusionGuidePath guidePath : listByGuideId) {
-                downResource(caseId,guidePath.getCover());
+                downResource(caseId,guidePath.getCover(),caseOffPath);
             }
             jsonObject.put(basePath+fusionGuidePath+guide.getFusionGuideId(), ResultData.ok(listByGuideId));
         }
         CaseInquest caseInquest1 = caseInquestService.getByCaseId(caseId);
         if(caseInquest1 != null){
             XWPFTemplate inquestTemp = caseInquestService.getWordByTemplate(caseInquest1);
-            downWordByTemplate(caseId,inquestTemp,"caseInquest.doc");
+            downWordByTemplate(caseId,inquestTemp,"caseInquest.doc",caseOffPath);
         }
         jsonObject.put(basePath+caseInquest+caseId, ResultData.ok(caseInquest1));
 
         CaseExtractDetail caseExtractDetail1 = caseExtractDetailService.getByCaseId(caseId);
         if(caseExtractDetail1 != null){
             XWPFTemplate detailTemp = caseExtractDetailService.getWordByTemplate(caseExtractDetail1);
-            downWordByTemplate(caseId,detailTemp,"caseExtractDetail.doc");
+            downWordByTemplate(caseId,detailTemp,"caseExtractDetail.doc",caseOffPath);
         }
         jsonObject.put(basePath+caseExtractDetail+caseId, ResultData.ok(caseExtractDetail1));
 
         List<CaseImg> caseImgList = caseImgService.getByCaseId(caseId, 1);
         for (CaseImg img : caseImgList) {
-            downResource(img.getCaseId(),img.getImgUrl());
+            downResource(img.getCaseId(),img.getImgUrl(),caseOffPath);
         }
         jsonObject.put(basePath+caseImg+caseId, ResultData.ok(caseImgList));
 
 
-        FileUtil.writeString(JSON.toJSONString(jsonObject), FilePath.OFFLINE_PACKAGE_PATH+caseId+"/www/package/"+jsonDataName,"UTF-8");
+        FileUtil.writeString(JSON.toJSONString(jsonObject), caseOffPath+"/www/package/"+jsonDataName,"UTF-8");
 
     }
 
@@ -350,15 +353,14 @@ public class CaseDownService {
     //http://127.0.0.1:8080/offline.html?caseId=362&app=1&share=1#/show/summary
 
     static String batName = "start-browser.bat";
-   public void cpIndexHtml(Integer caseId){
-       log.info("down-offline-cpIndexHtml:{}",caseId);
+   public void cpIndexHtml(Integer caseId,String caseOffPath){
+       log.info("down-offline-cpIndexHtml:{}",caseOffPath);
 
-       String caseOfflinePath = FilePath.OFFLINE_PACKAGE_PATH+caseId;
-       FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH),new File(caseOfflinePath),true);
+       FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH),new File(caseOffPath),true);
 
-       String s = FileUtil.readString(caseOfflinePath + File.separator + batName, StandardCharsets.UTF_8);
+       String s = FileUtil.readString(caseOffPath + File.separator + batName, StandardCharsets.UTF_8);
        String s1 = s.replaceAll("@caseId", String.valueOf(caseId));
-       FileUtil.writeString(s1, caseOfflinePath + File.separator + batName,"UTF-8");
+       FileUtil.writeString(s1, caseOffPath + File.separator + batName,"UTF-8");
    }
 
 
@@ -370,31 +372,16 @@ public class CaseDownService {
    public void downSwkk(Integer caseId,String num,Integer type){
 
        String swkkPath = FilePath.OFFLINE_PACKAGE_PATH+caseId + "/www/swkk/"+num;
-       String swkkZipPath = swkkPath +".zip";
        String swssPath = FilePath.OFFLINE_PACKAGE_PATH+caseId + "/www/swss/"+num;
-       String swssZipPath = swssPath +".zip";
 
        Integer isObj = 0;
        if(type == 4 || type == 6){
            isObj =1;
        }
        try {
+           FdkkResponse fdkkResponse = laserService.sceneLocInfo(num);
+
 
-           DownVo downVo = downService.checkDownLoad(num, isObj,"offline");
-           log.info("down:{}",downVo);
-           if(downVo.getDownloadStatus() == 3 && StringUtils.isNotBlank(downVo.getDownloadUrl())){
-               downZip(type,downVo.getDownloadUrl(),swkkZipPath,swkkPath,swssZipPath,swssPath);
-           }else {
-               DownVo down = downService.down(num, isObj,"offline");
-               if(down.getDownloadStatus() == 1){
-                   DownloadProcessVo downloadProcessVo = downService.downloadProcess(num, isObj);
-                   while (downloadProcessVo.getStatus() != 1002 ){
-                       downloadProcessVo =  downService.downloadProcess(num, isObj);
-                       Thread.sleep(2000L);
-                   }
-                   downZip(type,downloadProcessVo.getUrl(),swkkZipPath,swkkPath,swssZipPath,swssPath);
-               }
-           }
        }catch (Exception e){
            log.info("下载场景离线包失败:{}",num,e);
        }
@@ -409,20 +396,9 @@ public class CaseDownService {
                    uri = uri.split("[?]")[0];
                }
                ShellUtil.yunDownload(uri.replace(queryPath, ""), kkzipPath);
-
                ShellUtil.unZip(kkzipPath,kknumPath);
                FileUtil.del(kkzipPath);
            }else {
-//               InputStream in = minIoUploadService.getObject(uri);
-//               FileOutputStream out = new FileOutputStream(sszipPath);
-//               byte[] buffer = new byte[1024];
-//               int bytesRead;
-//               while ((bytesRead = in.read(buffer)) != -1) {
-//                   out.write(buffer, 0, bytesRead);
-//               }
-//               out.flush();
-//               out.close();
-//               in.close();
                ShellUtil.yunDownloadSs(uri.replace(queryPath, ""), sszipPath);
                ShellUtil.unZip(sszipPath,ssNumPath);
                FileUtil.del(sszipPath);
@@ -432,8 +408,8 @@ public class CaseDownService {
        }
 
    }
-    public void downModel(Integer caseId, String modelGlbUrl) {
-        String path = String.format(FilePath.OFFLINE_OSS_PATH,caseId);
+    public void downModel(Integer caseId, String modelGlbUrl,String offPath) {
+        String path = offPath +FilePath.OFFLINE_OSS_PATH;
 
         JSONArray jsonArray = JSONArray.parseArray(modelGlbUrl);
         for (Object object : jsonArray) {
@@ -443,25 +419,20 @@ public class CaseDownService {
             if(res.contains(".json") || res.contains(".shp")){
                 res = new File(res).getParentFile().getPath();
             }
-            ShellUtil.yunDownload(res, path +queryPath + res);
+            localToOssUtil.downFormAli(res,path+queryPath+res);
+
         }
     }
-    public void downResources(Integer caseId,String urls) {
+    public void downResources(Integer caseId,String urls,String offPath) {
 
         JSONArray jsonArray = JSONArray.parseArray(urls);
         for (Object object : jsonArray) {
             String res = (String) object;
-            downResource(caseId,res);
-        }
-    }
-    public void downResources(Integer caseId,JSONArray urls) {
-        for (Object object : urls) {
-            String res = (String) object;
-            downResource(caseId,res);
+            downResource(caseId,res,offPath);
         }
     }
 
-    public void downResource(Integer caseId,String url) {
+    public void downResource(Integer caseId,String url,String offPath) {
         if(StringUtils.isBlank(url) ){
             return;
         }
@@ -470,13 +441,13 @@ public class CaseDownService {
             log.info("downResource文件不存在:{},{}",caseId,url);
             return;
         }
-        String path = String.format(FilePath.OFFLINE_OSS_PATH,caseId);
-        ShellUtil.yunDownload(url,path+queryPath+url);
+        String path = offPath + FilePath.OFFLINE_OSS_PATH;
+        localToOssUtil.downFormAli(url,path+queryPath+url);
     }
 
-    public void downWordByTemplate(Integer caseId,XWPFTemplate template,String name){
+    public void downWordByTemplate(Integer caseId,XWPFTemplate template,String name,String offPath){
         // 指定输出文件的路径
-        String outputPath = String.format(FilePath.OFFLINE_RESOURCE_PACKAGE_PATH,caseId) + name;
+        String outputPath = offPath +FilePath.OFFLINE_RESOURCE_PACKAGE_PATH + name;
         try {
             FileOutputStream out = new FileOutputStream(outputPath);
             template.write(out);

+ 102 - 0
src/main/java/com/fdkankan/fusion/entity/Path.java

@@ -0,0 +1,102 @@
+package com.fdkankan.fusion.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 路径主表
+ * </p>
+ *
+ * @author 
+ * @since 2025-02-24
+ */
+@Getter
+@Setter
+@TableName("t_path")
+public class Path implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 坐标类型 1,原始资源 2,计算资源
+     */
+    @TableField("type")
+    private Integer type;
+
+    /**
+     * 更新者
+     */
+    @TableField("update_by")
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
+
+    /**
+     * 创建者
+     */
+    @TableField("create_by")
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 资源路径本地
+     */
+    @TableField("dir")
+    private String dir;
+
+    /**
+     * 逻辑未删除值0,逻辑已删除值1
+     */
+    @TableField("deleted")
+    @TableLogic
+    private String deleted;
+
+    /**
+     * 逻辑删除
+     */
+    @TableField("delete_flag")
+    private Date deleteFlag;
+
+    /**
+     * 映射路径
+     */
+    @TableField("mapping")
+    private String mapping;
+
+    /**
+     * 停用启用 01 
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 展示状态
+     */
+    @TableField("enable")
+    private Integer enable;
+
+
+}

+ 1 - 1
src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir") ;
 
         generate(path,"fusion", getTables(new String[]{
-               "t_scene"
+               "t_path"
         }));
 
 //        generate(path,"goods", getTables(new String[]{

+ 9 - 0
src/main/java/com/fdkankan/fusion/httpClient/LaserService.java

@@ -74,6 +74,15 @@ public class LaserService {
         }
         return  null;
     }
+    public FdkkResponse sceneLocInfo(String num) {
+        try {
+            return laserClient.sceneLocInfo(num);
+
+        }catch (Exception e){
+            log.info("获取激光场景信息失败getSceneInfo-error:{}",num,e);
+        }
+        return  null;
+    }
     public FdkkResponse getSceneInfoQuery(String num,String id) {
         try {
            return laserClient.getSceneInfoQuery(num,id);

+ 10 - 1
src/main/java/com/fdkankan/fusion/httpClient/address/LaserAddressSource.java

@@ -1,11 +1,16 @@
 package com.fdkankan.fusion.httpClient.address;
 
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.dtflys.forest.callback.AddressSource;
 import com.dtflys.forest.http.ForestAddress;
 import com.dtflys.forest.http.ForestRequest;
+import com.fdkankan.fusion.config.CacheUtil;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
+import java.io.File;
+
 @Component
 public class LaserAddressSource implements AddressSource {
 
@@ -15,6 +20,10 @@ public class LaserAddressSource implements AddressSource {
 
     @Override
     public ForestAddress getAddress(ForestRequest forestRequest) {
-        return new ForestAddress("","",null,basePath);
+        String setting = CacheUtil.installPath + File.separator +"bin" +File.separator +"resources"+File.separator+"static"+File.separator +"setting.json";
+        String data = FileUtil.readString(setting, "UTF-8");
+        JSONObject config = JSONObject.parseObject(data);
+        Integer javaPort = config.getInteger("javaPort");
+        return new ForestAddress("","",javaPort,basePath);
     }
 }

+ 8 - 0
src/main/java/com/fdkankan/fusion/httpClient/client/LaserClient.java

@@ -53,5 +53,13 @@ public interface LaserClient {
 
     @Get("/laser/filter/{num}/query")
     FdkkResponse getSceneInfoQuery(@Var("num")String num,@Query("datasetId") String datasetId);
+    @Get("/laser/loc/sceneLocInfo/{sceneCode}")
+    FdkkResponse sceneLocInfo(@Var("sceneCode")String sceneCode);
 
+
+    /**
+     * 下载深时场景
+     */
+    @Post(value = "/laser/loc/downOfflineScene")
+    FdkkResponse downOfflineSceneNew(@JSONBody SSDownSceneParam param) ;
 }

+ 12 - 0
src/main/java/com/fdkankan/fusion/httpClient/request/SSDownSceneParamLocal.java

@@ -0,0 +1,12 @@
+package com.fdkankan.fusion.httpClient.request;
+
+import lombok.Data;
+
+@Data
+public class SSDownSceneParamLocal {
+    private Integer id;
+    private String resultPath;
+    private String lang = "zh";
+    //1点云,2mesh
+    private Integer offlineType;
+}

+ 18 - 0
src/main/java/com/fdkankan/fusion/mapper/IPathMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.fusion.mapper;
+
+import com.fdkankan.fusion.entity.Path;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 路径主表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-02-24
+ */
+@Mapper
+public interface IPathMapper extends BaseMapper<Path> {
+
+}

+ 26 - 8
src/main/java/com/fdkankan/fusion/mq/consumer/OsgbToB3dmConsumer.java

@@ -3,14 +3,17 @@ package com.fdkankan.fusion.mq.consumer;
 import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.common.FilePath;
+import com.fdkankan.fusion.common.OssPath;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.util.*;
+import com.fdkankan.fusion.config.CacheUtil;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.ICommonUploadService;
 import com.fdkankan.redis.util.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -18,6 +21,7 @@ import org.w3c.dom.Element;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import java.io.File;
+import java.lang.reflect.Field;
 import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.UUID;
@@ -33,9 +37,13 @@ public class OsgbToB3dmConsumer {
     ICommonUploadService commonUploadService;
     @Value("${upload.query-path}")
     private String ossUrlPrefix;
+    @Autowired
+    LocalToOssUtil localToOssUtil;
+
+    @Async
     public void consumerQueue(String localPath)  {
+        String sourcePath = null;
         try {
-
             File file = new File(localPath);
             if(!file.exists()){
                 log.info("osgbToB3dm-mq--,msg:{},文件不存在",localPath);
@@ -43,7 +51,8 @@ public class OsgbToB3dmConsumer {
             }
             commonUploadService.updateStatus(localPath,0);
             ///mnt/manage/media-library/result/ea041f3237df46568f4e83e723e743d4
-            String sourcePath = file.getParentFile().getPath() +"/"+UUID.randomUUID().toString().replace("-","");
+            String dir = String.format(OssPath.MANAGE_MODEL_FILE_PATH ,UUID.randomUUID().toString().replace("-",""));
+            sourcePath = CacheUtil.basePath +File.separator+ dir;
 
             OBJToGLBUtil.OsgbToB3dm(localPath,sourcePath);
             String b3dmJsonPath =  FileWriterUtil.checkB3dmTileset(new File(sourcePath));
@@ -51,24 +60,33 @@ public class OsgbToB3dmConsumer {
                 log.info("osgbToB3dm-mq,msg:{},转化失败tileset.json不存在",localPath);
                 throw new BusinessException(-1,"转化失败tileset.json不存在");
             }
-            String ossPath = sourcePath.replace("/mnt/","");
-            ShellUtil.yunUpload(sourcePath,ossPath);
-            String url = ossUrlPrefix + b3dmJsonPath.replace("/mnt/","");
+            File jsonFile = new File(b3dmJsonPath);
+            if(!jsonFile.exists()){
+                log.info("osgbToB3dm-mq,msg:{},转化失败tileset.json不存在",localPath);
+                throw new BusinessException(-1,"转化失败tileset.json不存在");
+            }
+            //String ossPath = sourcePath.replace(CacheUtil.basePath,"");
+            //localToOssUtil.uploadOss(sourcePath,ossPath);
+            String url = ossUrlPrefix + dir+ File.separator +jsonFile.getName();
             HashMap<String,String> resultMap = ReadXmlUtil.getLatMap(file);
             if(resultMap != null && !resultMap.isEmpty()){
                 commonUploadService.updateByPath(localPath,url,resultMap.get("wgs84"),resultMap.get("gcj02"));
             }else {
                 commonUploadService.updateByPath(localPath,url);
             }
-            FileUtil.del(localPath);
-            FileUtil.del(sourcePath);
+
         }catch (Exception e){
             log.info("osgbToB3dm-status----消费失败",e);
             if(localPath != null){
                 commonUploadService.updateStatus(localPath,-1);
             }
         }finally {
-
+            try {
+                FileUtil.del(localPath);
+                //FileUtil.del(sourcePath);
+            }catch ( Exception e){
+                log.info("删除文件失败:{}",e);
+            }
         }
 
     }

+ 2 - 0
src/main/java/com/fdkankan/fusion/request/ScenePram.java

@@ -25,6 +25,8 @@ public class ScenePram extends RequestBase {
 
     private String num;
 
+    private Integer isObj;
+
     private Boolean isLaserMesh = false;
 
     public String getSceneName() {

+ 10 - 0
src/main/java/com/fdkankan/fusion/response/DownParam.java

@@ -0,0 +1,10 @@
+package com.fdkankan.fusion.response;
+
+import lombok.Data;
+
+@Data
+public class DownParam {
+    private Integer caseId;
+    private String path;
+    private String lang;
+}

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ICaseService.java

@@ -23,7 +23,7 @@ public interface ICaseService extends IService<CaseEntity> {
 
     PageInfo pageList(CaseParam param);
 
-    void addOrUpdate(CaseEntity param);
+    CaseEntity addOrUpdate(CaseEntity param);
 
     void addScene(CaseParam param);
 

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ICommonUploadService.java

@@ -16,7 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
  */
 public interface ICommonUploadService extends IService<CommonUpload> {
 
-    ResultData uploadFileNew(MultipartFile file, Integer dictId);
+    ResultData uploadFileNew( Integer dictId,String FilePath);
 
     CommonUpload add(String replace, String url, String s, String uuid, FileTypeEnum fileTypeEnum,String resultFormat, String replace1, Integer status, String unzipPath, Integer dictId);
 

+ 17 - 0
src/main/java/com/fdkankan/fusion/service/IPathService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.fusion.service;
+
+import com.fdkankan.fusion.entity.Path;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 路径主表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-02-24
+ */
+public interface IPathService extends IService<Path> {
+
+    String getBasePath();
+}

+ 31 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -2,6 +2,7 @@ package com.fdkankan.fusion.service.impl;
 
 import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
@@ -126,9 +127,36 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                         model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath +mesh3DtilesPath)));
                         model.setModelSize(FileWriterUtil.setFileSize(localToOssUtil.getSize( sizePath)));
                     }else {
-                        model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
-                        model.setModelGlbUrl(getGlbUrl(type,num,model));
-                        model.setModelType("glb");
+                        //model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
+                        //model.setModelGlbUrl(getGlbUrl(param.getType(),num,model));
+                        String meshPath = String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh";
+                        if(localToOssUtil.existKey(meshPath +"/mesh.obj")){
+                            Long size = localToOssUtil.getSize(meshPath);
+                            model.setModelSize(FileWriterUtil.setFileSize(size));
+                            model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + meshPath+"/mesh.obj")));
+                        }else {
+                            List<String> objPaths = new ArrayList<>();
+                            String meshPathjs = String.format(FilePath.OBJ_OSS_PATH, num)+"/data/";
+
+                            String jsonPath = meshPath + "/floors.json";
+                            if(!localToOssUtil.existKey(jsonPath)){
+                               jsonPath = meshPath +"mesh.json";
+                            }
+                            if(localToOssUtil.existKey(jsonPath)){
+                                String objectContent = localToOssUtil.getObjectContent(meshPath + "/floors.json");
+                                JSONObject jsonObject = JSONObject.parseObject(objectContent);
+                                JSONArray floors1 = jsonObject.getJSONArray("floors");
+                                for (Object object : floors1) {
+                                    JSONObject jb = (JSONObject) object;
+                                    String string = jb.getString("objPath");
+                                    objPaths.add(queryPath +meshPathjs + string);
+                                }
+                                model.setModelGlbUrl(JSONArray.toJSONString(objPaths));
+                                Long size = localToOssUtil.getSize(meshPath);
+                                model.setModelSize(FileWriterUtil.setFileSize(size));
+                            }
+                        }
+                        model.setModelType("obj");
                     }
 
                 }

+ 16 - 14
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -11,6 +11,7 @@ import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.mapper.ICaseMapper;
 import com.fdkankan.fusion.request.CaseParam;
+import com.fdkankan.fusion.request.SceneNumParam;
 import com.fdkankan.fusion.request.ScenePram;
 import com.fdkankan.fusion.response.CaseVo;
 import com.fdkankan.fusion.response.SceneVo;
@@ -108,37 +109,37 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
             param.setTypeMap(typeMap);
         }
         List<SceneVo> listAll = new ArrayList<>();
-        HashMap<Integer,List<String>> map = new HashMap<>();
+        HashMap<String,List<String>> numListMap = new HashMap<>();
+
         for (Integer type : param.getTypeMap().keySet()) {
             List<String> numList = param.getTypeMap().get(type);
             if(numList ==null || numList.size() <=0 || type ==3){
                 continue;
             }
-            Integer mapKey = 0;
-            if(SceneTypeUtil.isLaserMesh(type)){
-                mapKey =1 ;
+            String mapKey = "mesh";
+            if(SceneTypeUtil.isLaser(type)){
+                mapKey = "laser";
             }
-            if(map.get(mapKey) == null){
-                map.put(mapKey,numList);
+            if(numListMap.get(mapKey) == null){
+                numListMap.put(mapKey,numList);
             }else {
-                map.get(mapKey).addAll(numList);
+                numListMap.get(mapKey).addAll(numList);
             }
 
         }
-        for (Integer type : map.keySet()) {
+
+        for (String key : numListMap.keySet()) {
             ScenePram scenePram = new ScenePram();
-            //scenePram.setType(type);
             scenePram.setPageNum(1);
             scenePram.setPageSize(99999);
-            scenePram.setNumList(param.getTypeMap().get(type));
-
+            scenePram.setNumList(numListMap.get(key));
+            scenePram.setIsObj("laser".equals(key) ?0 :1);
             PageInfo pageInfo = sceneService.pageList(scenePram);
             List<SceneVo> list1 = (List<SceneVo>) pageInfo.getList();
             listAll.addAll(list1);
-
-
         }
 
+
         if(listAll.size() >0){
             List<String> numList = listAll.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
             //设置模型
@@ -236,8 +237,9 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     }
 
     @Override
-    public void addOrUpdate(CaseEntity param) {
+    public CaseEntity addOrUpdate(CaseEntity param) {
         this.saveOrUpdate(param);
+        return param;
     }
 
     @Override

+ 1 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseViewServiceImpl.java

@@ -32,8 +32,6 @@ import java.util.stream.Collectors;
 @Service
 public class CaseViewServiceImpl extends ServiceImpl<ICaseViewMapper, CaseView> implements ICaseViewService {
 
-   @Value("${oss.small}")
-   private String small;
 
     @Override
     public List<CaseView> allList(Integer caseId,Integer fusionId,  String num,String smallImgH, String smallImgW){
@@ -65,7 +63,7 @@ public class CaseViewServiceImpl extends ServiceImpl<ICaseViewMapper, CaseView>
             || StringUtils.isEmpty(caseView.getViewPoint())) {
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        String ImageSmall = caseView.getViewImg() +small;
+        String ImageSmall = caseView.getViewImg() ;
         caseView.setViewImgSmall(ImageSmall);
         this.save(caseView);
         return caseView;

+ 75 - 64
src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java

@@ -11,6 +11,7 @@ import com.fdkankan.fusion.common.util.FileWriterUtil;
 import com.fdkankan.fusion.common.util.OBJToGLBUtil;
 import com.fdkankan.fusion.common.util.ShellUtil;
 import com.fdkankan.fusion.common.util.LocalToOssUtil;
+import com.fdkankan.fusion.config.CacheUtil;
 import com.fdkankan.fusion.entity.CommonUpload;
 import com.fdkankan.fusion.entity.DictFile;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -51,33 +52,33 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
     IDictFileService dictFileService;
     @Autowired
     LocalToOssUtil localToOssUtil;
-    
-    @Value("${fyun.host:https://4dkk.4dage.com/}")
+
+    @Value("${upload.query-path}")
     private String ossUrlPrefix;
     
 
     @Override
-    public ResultData uploadFileNew(MultipartFile file, Integer dictId) {
-        if(file.isEmpty() ){
+    public ResultData uploadFileNew( Integer dictId,String filePath) {
+        if( StringUtils.isBlank(filePath) ){
+            throw new BusinessException(ResultCode.UPLOAD_ERROR);
+        }
+        File file = new File(filePath);
+        if(!file.exists() ){
             throw new BusinessException(ResultCode.UPLOAD_ERROR);
         }
-        File tempFile = null;
         try {
+            if(file.isDirectory()){
+                return uploadModelZip(file.getName(),file,dictId);
+            }
             String uuid = UUID.randomUUID().toString().replace("-","");
-            String originalFilename = file.getOriginalFilename();
-            String extName = originalFilename.substring(originalFilename.lastIndexOf(".")).toLowerCase();
-            String ossPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, uuid + extName);
+            String name = file.getName();
+            String extName = name.substring(name.lastIndexOf(".")).toLowerCase();
+            String ossPath = String.format(OssPath.MANAGE_FILE_PATH, uuid + extName);
+
+            //file.transferTo(tempFile);
 
-            tempFile = new File(OssPath.localPath + ossPath);
-            if(!tempFile.getParentFile().exists()){
-                tempFile.getParentFile().mkdirs();
-            }
-            file.transferTo(tempFile);
-            if(extName.equals(".zip")){
-                return uploadModelZip(originalFilename.replace(extName, ""),tempFile,dictId);
-            }
 
-            localToOssUtil.uploadOss(tempFile.getPath(), ossPath);
+            localToOssUtil.uploadOss(file.getPath(), ossPath);
             String url = this.ossUrlPrefix + ossPath;
 
             FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(extName.replace(".", ""));
@@ -85,8 +86,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
                 throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
             }
             String format = extName.replace(".", "");
-            CommonUpload commonUpload = commonUploadService.add(originalFilename.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum, format,format,1,null,dictId);
-            tempFile.delete();
+            CommonUpload commonUpload = commonUploadService.add(name.replace(extName, ""), url, String.valueOf(file.length()), uuid, fileTypeEnum, format,format,1,null,dictId);
             return ResultData.ok(commonUpload);
         }catch ( BusinessException e){
             log.info("upload-file-error:{}",e);
@@ -97,12 +97,14 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         }
     }
 
-    private ResultData uploadModelZip(String oldName,File tempFile,Integer dictId) {
-        String unzipPath = tempFile.getParentFile().getPath() +"/result/"+UUID.randomUUID().toString().replace("-","");
-        ShellUtil.unZip(tempFile.getPath(),unzipPath);
+    private ResultData uploadModelZip(String oldName,File file,Integer dictId) {
+        String ossZipPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, UUID.randomUUID().toString().replace("-", ""));
+        String unzipPath = CacheUtil.basePath + ossZipPath;
 
+        FileUtil.copyContent(file,new File(unzipPath),true);
         File unZipFile = new File(unzipPath);
-        if(!unZipFile.exists() || !unZipFile.isDirectory()){
+
+        if(!unZipFile.exists() || !unZipFile.isDirectory() ){
             throw new BusinessException(ResultCode.UNZIP_ERROR);
         }
         List<File> fileList = new ArrayList<>();
@@ -123,14 +125,14 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         String resultFormat = modelFileFormat;
         switch (modelFileFormat){
             case "obj" :  resultFormat = "glb";
-                url = uploadObjOss(unzipPath,modelFile);break;
-            case "laz" :    url = uploadLazOss(unzipPath,modelFile); break;
-            case "shp" :   url = uploadOss(unzipPath,modelFile); break;
-            case "b3dm" :  url = uploadB3dm(unzipPath,modelFile); break;
+                url = uploadObjOss(ossZipPath,modelFile);break;
+            case "laz" :    url = uploadLazOss(ossZipPath,modelFile); break;
+            case "shp" :   url = uploadOss(ossZipPath,modelFile); break;
+            case "b3dm" :  url = uploadB3dm(ossZipPath,modelFile); break;
             case "las" :
-            case "ply" :  url = uploadLasOrPly(unzipPath,modelFile);break;
+            case "ply" :  url = uploadLasOrPly(ossZipPath,modelFile);break;
             case "osgb":  resultFormat = "b3dm";
-                uploadOsgb(unzipPath,modelFile) ;break;
+                    uploadOsgb(ossZipPath,modelFile) ;break;
             default: break;
         }
         FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(modelFileFormat);
@@ -138,9 +140,8 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
             throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
         }
         Integer status = StringUtils.isNotBlank(url) ?1:-1;
-        CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(tempFile.length()),
-                null, fileTypeEnum, modelFileFormat,resultFormat,status,unzipPath,dictId);
-        tempFile.delete();
+        CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(getDirectorySize(unZipFile)),
+                null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId);
         return ResultData.ok(commonUpload);
     }
 
@@ -148,70 +149,61 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         OBJToGLBUtil.checkObj(modelFile.getPath());
         String localGlbPath = modelFile.getPath().replace(".obj",".glb");
         OBJToGLBUtil.objToGlb2(modelFile.getPath(),localGlbPath);
-        String ossPath = unzipPath.replace(OssPath.localPath,"");
-        ShellUtil.yunUpload(unzipPath,ossPath);
-        if(!localToOssUtil.existKey(localGlbPath.replace(OssPath.localPath,""))){
+        //String ossPath = unzipPath.replace(OssPath.localPath,"");
+        //localToOssUtil.uploadOss(unzipPath,ossPath);
+//        if(!localToOssUtil.existKey(localGlbPath.replace(OssPath.localPath,""))){
+//            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
+//        }
+        File file = new File(localGlbPath);
+        if(!file.exists()){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
-        FileUtil.del(unzipPath);
-        return  ossUrlPrefix +  localGlbPath.replace(OssPath.localPath,"");
+        return  ossUrlPrefix + unzipPath +File.separator+file.getName();
     }
 
     private String uploadB3dm(String unzipPath, File modelFile) {
-        String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(new File(unzipPath));
+        String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(new File(CacheUtil.basePath + unzipPath));
         if(b3dmJsonPath == null){
             throw new BusinessException(ResultCode.UPLOAD_FILE_OBJ_ERROR);
         }
-        String ossPath = b3dmJsonPath.replace(OssPath.localPath, "");
-        uploadOss(unzipPath,modelFile);
-        if(!localToOssUtil.existKey(ossPath)){
+        //uploadOss(unzipPath,modelFile);
+        File file = new File(b3dmJsonPath);
+        if(!file.exists()){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
-        FileUtil.del(unzipPath);
-        return ossUrlPrefix +  ossPath;
+        return  ossUrlPrefix +unzipPath +File.separator +file.getName();
     }
 
     @Autowired
     OsgbToB3dmConsumer osgbToB3dmConsumer;
 
     private void uploadOsgb(String unzipPath, File modelFile) {
-        osgbToB3dmConsumer.consumerQueue(unzipPath);
+         osgbToB3dmConsumer.consumerQueue(CacheUtil.basePath + unzipPath);
     }
 
     private String uploadLazOss(String unzipPath,File modelFile) {
-        String ossPath = unzipPath.replace(OssPath.localPath,"");
-        String modelOssPath = modelFile.getPath().replace(OssPath.localPath, "");
-        ShellUtil.yunUpload(unzipPath,ossPath);
-        if(!localToOssUtil.existKey(modelOssPath)){
+        if(!modelFile.exists()){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
-        FileUtil.del(unzipPath);
-        return ossUrlPrefix +  ossPath;
+        return  ossUrlPrefix +unzipPath +File.separator +modelFile.getParentFile().getName();
     }
 
     private String uploadOss(String unzipPath,File modelFile) {
-        String ossPath = unzipPath.replace(OssPath.localPath,"");
-        String modelOssPath = modelFile.getPath().replace(OssPath.localPath, "");
-        ShellUtil.yunUpload(unzipPath,ossPath);
-        if(!localToOssUtil.existKey(modelOssPath)){
+        if(!modelFile.exists()){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
-        FileUtil.del(unzipPath);
-        return ossUrlPrefix +  modelOssPath;
+        return  ossUrlPrefix + unzipPath+File.separator +modelFile.getName();
     }
 
     private String uploadLasOrPly(String unzipPath ,File modelFile) {
         File mntFile = OBJToGLBUtil.lasOrPlyToBin(modelFile);
-        String ossPath = mntFile.getPath().replace(OssPath.localPath,"");
-        ShellUtil.yunUpload(mntFile.getPath(),ossPath);
-        if(!localToOssUtil.existKey(ossPath+"/webcloud/cloud.js")){
-            throw new BusinessException(-1,"缺少cloud.js文件");
+        File file = new File(mntFile.getPath() + "/webcloud/cloud.js");
+        if(!file.exists()){
+            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
-        FileUtil.del(unzipPath);
-        return ossUrlPrefix +  ossPath + "/webcloud";
-    }
-
+        return  ossUrlPrefix +unzipPath+File.separator +mntFile.getName() + File.separator +"webcloud";
 
+    }
 
 
 
@@ -267,4 +259,23 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         wrapper.set(CommonUpload::getGcj02,gcj02);
         this.update(wrapper);
     }
+
+
+    public static long getDirectorySize(File directory) {
+        long size = 0;
+        try {
+            File[] files = directory.listFiles();
+            if (files != null) {
+                for (File file : files) {
+                    if (file.isFile()) {
+                        size += file.length();
+                    } else if (file.isDirectory()) {
+                        size += getDirectorySize(file);
+                    }
+                }
+            }
+        }catch (Exception e){
+        }
+        return size;
+    }
 }

+ 36 - 0
src/main/java/com/fdkankan/fusion/service/impl/PathServiceImpl.java

@@ -0,0 +1,36 @@
+package com.fdkankan.fusion.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.fusion.entity.Path;
+import com.fdkankan.fusion.mapper.IPathMapper;
+import com.fdkankan.fusion.service.IPathService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 路径主表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-02-24
+ */
+@Service
+public class PathServiceImpl extends ServiceImpl<IPathMapper, Path> implements IPathService {
+
+    @Override
+    public String getBasePath() {
+        LambdaQueryWrapper<Path> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Path::getType,2);
+        wrapper.eq(Path::getStatus,1);
+        wrapper.eq(Path::getEnable,1);
+
+        List<Path> list = this.list(wrapper);
+        if(!list.isEmpty()){
+            return list.get(0).getDir();
+        }
+        return null;
+    }
+}

+ 33 - 9
src/main/java/com/fdkankan/fusion/service/impl/SceneCommonService.java

@@ -80,20 +80,24 @@ public class SceneCommonService implements ISceneCommonService {
     ISceneService sceneService;
     @Override
     public PageInfo pageList(ScenePram param) {
-        if(param.getType() == null){
-           throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
 
         LambdaQueryWrapper<Scene> wrapper = new LambdaQueryWrapper<>();
         if(StringUtils.isNotBlank(param.getSceneName())){
             wrapper.like(Scene::getTitle,param.getSceneName());
         }
-        wrapper.eq(Scene::getSceneSource, SceneTypeUtil.getSceneSource(param.getType()));
-        if(SceneTypeUtil.isLaserMesh(param.getType())){
-            param.setIsLaserMesh(true);
+        if(param.getIsObj() != null && param.getIsObj() == 0){  //点云场景
+            wrapper.in(Scene::getSceneSource,SceneTypeUtil.getSceneSourceList(0));
+        }
+        if(param.getIsObj() != null && param.getIsObj() == 1){  //mesh场景
+            wrapper.notIn(Scene::getBuildObjStatus,0)
+                    .or()
+                    .notIn(Scene::getSceneSource,SceneTypeUtil.getSceneSourceList(0));
         }
-        if(param.getIsLaserMesh()){
-            wrapper.notIn(Scene::getBuildObjStatus,0);
+        if(param.getNumList() != null && !param.getNumList().isEmpty()){
+            wrapper.in(Scene::getSceneCode,param.getNumList());
+        }
+        if(param.getStatus() != null){
+            wrapper.eq(Scene::getStatus,param.getStatus());
         }
 
         Page<Scene> page = sceneService.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
@@ -113,7 +117,8 @@ public class SceneCommonService implements ISceneCommonService {
             vo.setTitle(scene.getTitle());
             vo.setViewCount(scene.getViewCount());
             vo.setIsLaser(SceneTypeUtil.isLaser(param.getType()));
-            vo.setType(param.getType());
+
+            vo.setType(setSceneType(scene.getSceneSource(),param.getIsObj()));
             vo.setPhone(scene.getUserName());
             vo.setBind(true);
             vo.setLocation(scene.getLocation());
@@ -129,6 +134,25 @@ public class SceneCommonService implements ISceneCommonService {
         return PageInfo.PageInfo(voPage);
     }
 
+    private Integer setSceneType(Integer sceneSource,Integer isObj) {
+        if(sceneSource == 3 ){
+            return 1;
+        }
+        if(sceneSource == 4 && isObj ==0){
+            return 2;
+        }
+        if(sceneSource == 4 && isObj ==1){
+            return 4;
+        }
+        if(sceneSource == 5 && isObj ==0){
+            return 5;
+        }
+        if(sceneSource == 5 && isObj ==1){
+            return 6;
+        }
+        return 0;
+    }
+
     /**
      * 四维看看返回数据格式转换
      */

+ 1 - 1
src/main/java/com/fdkankan/fusion/task/TaskService.java

@@ -27,7 +27,7 @@ public class TaskService {
 
     @Autowired
     RedisUtil redisUtil;
-    @PostConstruct
+    //@PostConstruct
     public void cleanRedisKey(){
         String redisKey = String.format(downProcessKey, "*");
         Set<String>  keys = redisUtil.keys(redisKey);

+ 7 - 48
src/main/resources/application.yml

@@ -45,71 +45,30 @@ spring:
 
 4dkk:
   laserService:
-    basePath: http://127.0.0.1:9295
+    basePath: http://127.0.0.1
   fdService:
-    basePath: http://127.0.0.1:8081
+    basePath: http://127.0.0.1
   takeLookService:
-    basePath: http://127.0.0.1:8081
+    basePath: http://127.0.0.1
 
 
 logging:
   config: classpath:logback-spring.xml
-  path: /www/VR/4dkankan
+  path: ${FDMGEA_HOME}/bin/log
 
 mybatis-plus:
   configuration:
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
 
-
-forest:
-  ## 日志总开关,打开/关闭Forest请求/响应日志(默认为 true)
-  log-enabled: true
-  ## 打开/关闭Forest请求日志(默认为 true)
-  log-request: true
-  ## 打开/关闭Forest响应状态日志(默认为 true)
-  log-response-status: true
-  ## 打开/关闭Forest响应内容日志(默认为 false)
-  log-response-content: true
-  ## 请求超时时间,单位为毫秒, 默认值为3000
-  timeout: 10000
-  ## 连接超时时间,单位为毫秒, 默认值为2000
-  connect-timeout: 10000
-
 upload:
   type: local
-  query-path: /oss/
+  query-path:
 oss:
-  #point: http://oss-cn-shenzhen-internal.aliyuncs.com
-  point:
-  key:
-  secrey:
-  bucket: 4dkankan
-  small:
-  basePath: /oss/
+  bucket:
 
 
 fdkk:
-  register:
-    validCode: 2a22bac40f44af4d3b5fdc20ea706fc5
-  # 文件路径 示例( Windows配置D:/fdkk/uploadPath,Linux配置 /home/fdkk/uploadPath)
-  profile: ${PROFILE_PATH}
-  #算法软件目录
-  binPath: ${BIN_PATH}
-  defaultFolder: datav1
-  # 是否本地化部署:开启此项会使用minio文件管理
-  isLocalization: true
-  # 是否使用文件存储系统
-  isBucket: false
-  #是否使用软连接
-  isLink: false
-
-# MinIO 配置
-minio:
-  endpoint: http://127.0.0.1:9000      # MinIO服务地址
-  fileHost: http://127.0.0.1:9000      # 文件地址host
-  bucketName: laser-data                      # 存储桶bucket名称
-  accessKey: Ux8mKEBFj4j2N63Kdj5g                         # 用户名
-  secretKey: cPA5XSYcDzTCIHbeBxaSqzt9ZQjLZFbgQe38EiRW      # 密码
+  installPath: ${FDMGEA_HOME}
 
 
 geoquery:

+ 5 - 0
src/main/resources/mapper/fusion/PathMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.fusion.mapper.IPathMapper">
+
+</mapper>