Selaa lähdekoodia

不下载预览图

wuweihao 3 vuotta sitten
vanhempi
commit
e5581e48e0

+ 7 - 4
gis_service/src/main/java/com/gis/service/impl/AliOssServiceImpl.java

@@ -61,16 +61,17 @@ public class AliOssServiceImpl implements AliOssService {
         downloadSomeDataJson(workId);
 
         // 4. 获取导览图集合, key:场景码
-        HashMap<String, String> guideThumbs = getGuideThumbBySomeData(workId);
+        HashMap<String, String> sceneData = getGuideThumbBySomeData(workId);
 
         // 5.下载导览图
-        downloadGuideThumb(guideThumbs, workId);
+//        downloadGuideThumb(sceneData, workId);
 
         // 3.下载场景
-        downloadScenes(guideThumbs, workId, param.getEvn());
+        downloadScenes(sceneData, workId, param.getEvn());
 
         // 6.压缩zip
         zipWork(workId);
+
         String outPath = configConstant.serverBasePath + "/download/" + workId +".zip";
 
         DateUtils.expendTime(startTime);
@@ -149,6 +150,7 @@ public class AliOssServiceImpl implements AliOssService {
         for (Object scene : scenes) {
             // 场景对象
             JSONObject row = JSONObject.parseObject(scene.toString());
+            log.info("预览图: {}, {}", row.getString("sceneCode"), row.getString("icon"));
             // key:场景码
             resMap.put(row.getString("sceneCode"), row.getString("icon"));
         }
@@ -170,9 +172,10 @@ public class AliOssServiceImpl implements AliOssService {
             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);
+            log.info("场景:{} 保存路径: {}", sceneCode, filePath);
         }
         log.info("下载导览图片完成: {}", savePath);
     }