瀏覽代碼

下载于hash

lyhzzz 3 月之前
父節點
當前提交
2e74e66882
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/main/java/com/fdkankan/fusion/controller/DictFileController.java

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

@@ -91,7 +91,7 @@ public class DictFileController extends BaseController{
             throw new BusinessException(ResultCode.FILE_NOT_EXIST);
         }
         String sceneObjPath = commonUpload.getFileUrl().replace(queryPath,"");
-
+        String foName =  new File(sceneObjPath).getName();
 
         if(!"las".equals(commonUpload.getFileFormat()) && !"laz".equals(commonUpload.getFileFormat()) && !"ply".equals(commonUpload.getFileFormat())
         && !"obj".equals(commonUpload.getFileFormat()) && !"osgb".equals(commonUpload.getFileFormat()) && !"b3dm".equals(commonUpload.getFileFormat())){
@@ -100,12 +100,13 @@ public class DictFileController extends BaseController{
         }
         if("obj".equals(commonUpload.getFileFormat()) || "osgb".equals(commonUpload.getFileFormat()) || "b3dm".equals(commonUpload.getFileFormat())){
             sceneObjPath = new File(sceneObjPath).getParentFile().getPath();
+            foName =  new File(sceneObjPath).getParentFile().getName();
         }
 
         String filePath = String.format(CacheUtil.basePath+"/" +OssPath.MANAGE_FILE_DOWN_PATH ,dictFileId) ;
         String ossPath = String.format(OssPath.MANAGE_FILE_DOWN_PATH ,dictFileId +"/"+dictFileId +".zip") ;
         ShellUtil.yunDownload(sceneObjPath,filePath);
-        ShellUtil.zip(dictFileId+".zip",filePath);
+        ShellUtil.zip(dictFileId+".zip",filePath+"/"+foName);
         ShellUtil.yunDownload(filePath +"/"+dictFileId +".zip",ossPath);
         FileUtil.del(filePath);