Browse Source

下载导览

wuweihao 3 years ago
parent
commit
a23e8c6446

+ 9 - 6
gis_service/src/main/java/com/gis/service/impl/AliOssServiceImpl.java

@@ -64,7 +64,7 @@ public class AliOssServiceImpl implements AliOssService {
         HashMap<String, String> sceneData = getGuideThumbBySomeData(workId);
 
         // 5.下载导览图
-//        downloadGuideThumb(sceneData, workId);
+        downloadGuideThumb(sceneData, workId);
 
         // 3.下载场景
         downloadScenes(sceneData, workId, param.getEvn());
@@ -171,11 +171,14 @@ public class AliOssServiceImpl implements AliOssService {
         for (Map.Entry<String, String> m : iconMap.entrySet()) {
             String sceneCode = m.getKey();
             String ossUrl = m.getValue();
-            String fileName = StrUtil.subAfter(ossUrl, "/", true);
-            fileName = StrUtil.subBefore(fileName, "?d", true);
-            String filePath = savePath + fileName;
-            HttpUtil.downloadFile(ossUrl, filePath);
-            log.info("场景:{} 保存路径: {}", sceneCode, filePath);
+            if (!ossUrl.contains("preview.jpg")){
+                String fileName = StrUtil.subAfter(ossUrl, "/", true);
+                fileName = StrUtil.subBefore(fileName, "?d", true);
+                String filePath = savePath + fileName;
+                HttpUtil.downloadFile(ossUrl, filePath);
+                log.info("场景:{} 保存路径: {}", sceneCode, filePath);
+            }
+
         }
         log.info("下载导览图片完成: {}", savePath);
     }