Browse Source

add offline queue3

xiewj 3 months ago
parent
commit
bf91d2896b

+ 4 - 1
720yun_fd_base/gis_oss/src/main/java/com/gis/oss/constant/CmdConstant.java

@@ -57,5 +57,8 @@ public class CmdConstant {
 
     public static final String FYUN_DELETE = "bash /mnt/shell/fyun/fyun-deled.sh %s /%s %s %s %s";
 
-    public final static String RM_Folder = "rm -rf @Folder";
+    public final static String RM_Folder = "rm -rf %s";
+
+    public static final String UNZIP_MESH_ZIP = "unzip -n %s 'wwwroot/*' -d %s";
+
 }

+ 15 - 3
720yun_fd_consumer/src/main/java/com/gis/listener/container/WorkOfflineListener.java

@@ -86,6 +86,7 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
                 String ossKey =baseOssKey+"/" + workEntity.getId();
                 OssShUtil.yunDownload(ossKey,basePath+File.separator+baseOssKey);
 
+                String meshBasePath=param.getPath()+ File.separator+"mesh";
 
                 //处理关联的作品和场景
                 List<WorkNavigationEntity> workNavigationEntities = workNavigationService.selectByWorkId(workEntity.getId());
@@ -97,7 +98,14 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
                             OssShUtil.yunDownload(PanoOssKey,basePath+File.separator+baseOssKey);
                         }else if (workNavigationEntity.getType().equalsIgnoreCase("4dkk")){
                             //整合离线包
-                            log.info("整合mesh场景");
+                            log.info("整合mesh场景,{}",workNavigationEntity.getSceneCode());
+                            //unzip -n KK-t-4Q9aHYKmDtf.zip 'wwwroot/*' -d /mnt/720yun_fd_manage_data/offlineData/WK1920049367641874432/
+                            String zipPath=meshBasePath+File.separator+workNavigationEntity.getSceneCode()+".zip";
+                            if (FileUtil.exist(zipPath)){
+                                String cmd = String.format(CmdConstant.UNZIP_MESH_ZIP,zipPath,param.getPath());
+                                CmdUtils.callLineSh(cmd);
+                            }
+                            log.info("整合mesh场景解压完成");
                         }
 
 
@@ -114,8 +122,12 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
 
                     }
                 }
-
-
+                if (FileUtil.exist(meshBasePath)){
+                    log.info("删除mesh场景文件夹:{}",meshBasePath);
+                    String cmd = String.format(CmdConstant.RM_Folder,meshBasePath);
+                    CmdUtils.callLineSh(cmd);
+                    log.info("删除mesh场景文件夹完成:{}",meshBasePath);
+                }
             }