Explorar o código

下载于hash

lyhzzz hai 3 meses
pai
achega
1970965aab

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

@@ -120,7 +120,7 @@ public class ShellUtil {
 
     public static void zip(String zipPath, String dataPath) {
         log.info("打包zip开始");
-        String command = "zip -r -m " + zipPath + "  " ;
+        String command = "cd " + dataPath + " &&zip -r -m " + zipPath + "  " ;
         execCmd(command);
         log.info("打包zip完毕:" + command);
     }

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

@@ -91,8 +91,7 @@ public class DictFileController extends BaseController{
             throw new BusinessException(ResultCode.FILE_NOT_EXIST);
         }
         String sceneObjPath = commonUpload.getFileUrl().replace(queryPath,"");
-        String filePath = String.format(CacheUtil.basePath+"/" +OssPath.MANAGE_FILE_DOWN_PATH ,dictFileId) ;
-        String ossPath = String.format(OssPath.MANAGE_FILE_DOWN_PATH ,dictFileId) ;
+
 
         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())){
@@ -102,6 +101,9 @@ public class DictFileController extends BaseController{
         if("obj".equals(commonUpload.getFileFormat()) || "osgb".equals(commonUpload.getFileFormat()) || "b3dm".equals(commonUpload.getFileFormat())){
             sceneObjPath = new File(sceneObjPath).getParentFile().getPath();
         }
+
+        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.yunDownload(filePath +"/"+dictFileId +"zip",ossPath);