Explorar el Código

打包功能支持下载edit目录

wuweihao hace 3 años
padre
commit
3fb1a6147f

+ 6 - 3
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/controller/OpsController.java

@@ -37,11 +37,14 @@ public class OpsController {
         return entityService.mergeTour(workId);
     }
 
-    @ApiOperation(value = "根据作品码打包数据", notes = "返回值直接下载结果文件")
+    @ApiOperation(value = "根据作品码打包数据(标准)", notes = "isEdit:有值-> 下载edit目录")
     @GetMapping("/pack/{workId}")
-    public Result pack(@PathVariable String workId) {
-        return entityService.pack(workId);
+    public Result pack(@PathVariable String workId, String isEdit) {
+        return entityService.pack(workId, isEdit);
     }
 
 
+
+
+
 }

+ 2 - 1
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/service/OpsService.java

@@ -17,5 +17,6 @@ public interface OpsService  {
 
     Result mergeTour(String workId);
 
-    Result pack(String workId);
+    Result pack(String workId, String isEdit);
+
 }

+ 21 - 6
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/service/impl/OpsServiceImpl.java

@@ -146,14 +146,14 @@ public class OpsServiceImpl  implements OpsService {
     }
 
     @Override
-    public Result pack(String workId) {
+    public Result pack(String workId, String isEdit) {
         // 复制作品目录
         WorkEntity entity = workService.getById(workId);
         BaseRuntimeException.isNull(entity, ErrorEnum.FAILURE_SYS_2001);
         copyWork(workId);
 
         // 复制场景目录
-        copyScene(workId, entity.getSceneCodes());
+        copyScene(workId, entity.getSceneCodes(), isEdit);
 
         // 合并tour.xml
         mergeTour(workId, entity.getSceneCodes());
@@ -165,6 +165,8 @@ public class OpsServiceImpl  implements OpsService {
         return Result.success(filePath);
     }
 
+
+
     private void zipWork(String workId) {
         String outPath = configConstant.serverBasePath + "/download/" + workId +".zip";
 //        String intPath = configConstant.serverBasePath + "/download/" + workId ;
@@ -179,7 +181,13 @@ public class OpsServiceImpl  implements OpsService {
 
     }
 
-    private void copyScene(String workId, String sceneCodes) {
+    /**
+     *
+     * @param workId
+     * @param sceneCodes
+     * @param isEdit 是否复制edit目录
+     */
+    private void copyScene(String workId, String sceneCodes, String isEdit) {
         log.info("场景码: {}", sceneCodes);
         if (StringUtils.isBlank(sceneCodes)){
             log.info("场景码为空, 不需要下载");
@@ -192,17 +200,24 @@ public class OpsServiceImpl  implements OpsService {
         String inTourPath;
         String outPath;
         for (String sceneCode : split) {
-//            inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/panos/" + sceneCode + ".tiles";
-            inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/panos";
-            outPath = outBasePath + "/" + sceneCode;
 
             // 创建目录
+            outPath = outBasePath + "/" + sceneCode;
             FileUtil.mkdir(outPath);
 
             // 复制全景图
+            inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/panos";
             String cmd = StrUtil.format("cp -r {} {} ", inPath,  outPath);
             CmdUtils.callCmd(cmd);
 
+            // 复制编辑目录
+            if (StrUtil.isNotBlank(isEdit)){
+                log.info("下载edit目录");
+                inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/edit";
+                cmd = StrUtil.format("cp -r {} {} ", inPath,  outPath);
+                CmdUtils.callCmd(cmd);
+            }
+
             // 复制tour.xml
             inTourPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/tour.xml";
             String cmdTour = StrUtil.format("cp -r {} {} ", inTourPath,  outPath);

+ 3 - 1
README.md

@@ -3,5 +3,7 @@
 720yun 资料本地化
 
 # sit 
-http://project.4dage.com:8021/doc.html
+   doc:http://project.4dage.com:8021/doc.html
+   web:http://project.4dage.com:8021/panorama/show.html?id=20
+   login:http://project.4dage.com:8021/panorama/material.html