|
@@ -89,6 +89,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
|
|
|
private static final List<ImageType> imageTypes = Lists.newArrayList();
|
|
|
static{
|
|
|
+ imageTypes.add(ImageType.builder().name("4k_face").size("4096").ranges(new String[]{"0", "511", "1023", "1535", "2047","2559","3071","3583"}).build());
|
|
|
imageTypes.add(ImageType.builder().name("2k_face").size("2048").ranges(new String[]{"0", "511", "1023", "1535"}).build());
|
|
|
imageTypes.add(ImageType.builder().name("1k_face").size("1024").ranges(new String[]{"0", "511"}).build());
|
|
|
imageTypes.add(ImageType.builder().name("512_face").size("512").ranges(new String[]{"0"}).build());
|
|
@@ -110,7 +111,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
private String wwwroot;
|
|
|
@Value("${zip.nThreads}")
|
|
|
private int zipNthreads;
|
|
|
- @Value("${oss.bucket:4dkankan}")
|
|
|
+ @Value("${fyun.bucket:4dkankan}")
|
|
|
private String bucket;
|
|
|
@Value("${fyun.type}")
|
|
|
private String uploadType;
|
|
@@ -278,8 +279,8 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v4");
|
|
|
throw e;
|
|
|
}finally {
|
|
|
-// FileUtil.del(zipPath);
|
|
|
-// FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
+ FileUtil.del(zipPath);
|
|
|
+ FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -438,6 +439,9 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
if((filePath.contains(imageNumPath + "panorama/") && filePath.contains("tiles/" + resolution))
|
|
|
|| filePath.contains(imageNumPath + "tiles/" + resolution + "/")) {
|
|
|
this.processImage(num, filePath, resolution, imagesVersion, cacheKeys);
|
|
|
+ //更新进度
|
|
|
+ this.updateProgress(new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
|
+ num, SceneDownloadProgressStatus.DOWNLOADING.code(), null, version);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -554,16 +558,16 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
sceneJson.replace("videos", videos);
|
|
|
log.info("videos:{}",videos);
|
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
|
- log.info("sceneJson.toString():{}",sceneJson.toString());
|
|
|
- FileUtil.writeUtf8String(sceneJson.toString().replaceAll(File.separator.concat("oss").concat(File.separator), "")
|
|
|
- , String.format(this.sourceLocal, num, this.wwwroot + sceneJsonPath));
|
|
|
+ String sceneJsonStr = sceneJson.toString().replace(this.publicUrl, "");
|
|
|
+ FileUtil.writeUtf8String(sceneJsonStr.replaceAll(File.separator.concat("oss").concat(File.separator), ""), String.format(this.sourceLocal, num, this.wwwroot + sceneJsonPath));
|
|
|
}
|
|
|
|
|
|
private void zipGetInfoJson(String num, JSONObject getInfo) throws Exception{
|
|
|
|
|
|
//访问密码置0
|
|
|
String getInfoKey = String.format("data/data%s/", num) + "getInfo.json";
|
|
|
- FileUtil.writeUtf8String(getInfo.toString(), String.format(this.sourceLocal, num, this.wwwroot + getInfoKey));
|
|
|
+ String getInfoStr = getInfo.toString().replace(this.publicUrl, "");
|
|
|
+ FileUtil.writeUtf8String(getInfoStr, String.format(this.sourceLocal, num, this.wwwroot + getInfoKey));
|
|
|
}
|
|
|
|
|
|
private void processImage(String sceneNum, String key, String resolution, int imagesVersion, Set<String> imgKeys) throws Exception{
|
|
@@ -586,6 +590,10 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
}
|
|
|
for (ImageType imageType : imageTypes) {
|
|
|
|
|
|
+ if(imageType.getName().equals("4k_face") && !"4k".equals(resolution)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
List<ImageTypeDetail> items = Lists.newArrayList();
|
|
|
String[] ranges = imageType.getRanges();
|
|
|
for(int i = 0; i < ranges.length; i++){
|
|
@@ -652,6 +660,9 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
if(key.contains("hot.json") || key.contains("link-scene.json")){
|
|
|
// String content = FileUtils.getStringFromUrl(url);
|
|
|
String content = fYunFileService.getFileContent(key);
|
|
|
+ if(StrUtil.isEmpty(content)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
content.replace(publicUrl, "")
|
|
|
// .replace(publicUrl+"v3/", "")
|
|
|
.replace("https://spc.html","spc.html")
|