|
@@ -92,8 +92,8 @@ public class SceneDownloadHandlerServiceImpl {
|
|
private String v3localPath;
|
|
private String v3localPath;
|
|
@Value("${path.zip-local}")
|
|
@Value("${path.zip-local}")
|
|
private String zipLocalFormat;
|
|
private String zipLocalFormat;
|
|
- @Value("${path.source-local}")
|
|
|
|
- private String sourceLocal;
|
|
|
|
|
|
+// @Value("${path.source-local}")
|
|
|
|
+// private String sourceLocal;
|
|
@Value("${path.zip-oss}")
|
|
@Value("${path.zip-oss}")
|
|
private String zipOssFormat;
|
|
private String zipOssFormat;
|
|
@Value("${path.zip-root}")
|
|
@Value("${path.zip-root}")
|
|
@@ -176,7 +176,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
long startTime = Calendar.getInstance().getTimeInMillis();
|
|
long startTime = Calendar.getInstance().getTimeInMillis();
|
|
|
|
|
|
//执行场景下载逻辑
|
|
//执行场景下载逻辑
|
|
- this.downloadHandlerV3(downLoadTaskBean);
|
|
|
|
|
|
+// this.downloadHandlerV3(downLoadTaskBean);
|
|
|
|
|
|
//耗时
|
|
//耗时
|
|
long consumeTime = Calendar.getInstance().getTimeInMillis() - startTime;
|
|
long consumeTime = Calendar.getInstance().getTimeInMillis() - startTime;
|
|
@@ -197,6 +197,12 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
|
|
|
public void downloadHandler(DownLoadTaskBean downLoadTaskBean) throws Exception{
|
|
public void downloadHandler(DownLoadTaskBean downLoadTaskBean) throws Exception{
|
|
|
|
|
|
|
|
+ String resultPath = downLoadTaskBean.getResultPath();
|
|
|
|
+ if(!resultPath.endsWith(File.separator)){
|
|
|
|
+ resultPath = resultPath.concat(File.separator);
|
|
|
|
+ }
|
|
|
|
+ String sourceLocalPath = resultPath + "%s" + File.separator + "%s";
|
|
|
|
+
|
|
String num = downLoadTaskBean.getNum();
|
|
String num = downLoadTaskBean.getNum();
|
|
//zip包路径
|
|
//zip包路径
|
|
String zipPath = null;
|
|
String zipPath = null;
|
|
@@ -204,7 +210,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
TimeInterval timer = DateUtil.timer();
|
|
TimeInterval timer = DateUtil.timer();
|
|
|
|
|
|
//删除资源目录
|
|
//删除资源目录
|
|
- FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
|
|
+ FileUtil.del(String.format(sourceLocalPath, num, ""));
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
if(Objects.isNull(scenePlus))
|
|
if(Objects.isNull(scenePlus))
|
|
@@ -243,21 +249,21 @@ public class SceneDownloadHandlerServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
//固定文件写入
|
|
//固定文件写入
|
|
- this.zipLocalFiles(v4localFilePaths, v4localPath, num, count, total, "v4");
|
|
|
|
|
|
+ this.zipLocalFiles(v4localFilePaths, num, count, total, "v4", sourceLocalPath);
|
|
log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
|
|
|
//oss文件写入
|
|
//oss文件写入
|
|
- this.zipOssFiles(bucket, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v4");
|
|
|
|
|
|
+ this.zipOssFiles(bucket, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v4", sourceLocalPath);
|
|
log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
|
|
|
//重新写入scene.json(去掉密码访问设置)
|
|
//重新写入scene.json(去掉密码访问设置)
|
|
- this.zipSceneJson(num, sceneViewInfo);
|
|
|
|
|
|
+ this.zipSceneJson(num, sceneViewInfo,sourceLocalPath);
|
|
|
|
|
|
//写入启动命令
|
|
//写入启动命令
|
|
- this.zipBat(num, "v4", downLoadTaskBean.getLang());
|
|
|
|
|
|
+ this.zipBat(num, "v4", downLoadTaskBean.getLang(), sourceLocalPath);
|
|
|
|
|
|
//打压缩包
|
|
//打压缩包
|
|
- ZipUtil.zip(String.format(this.sourceLocal, num, ""), zipPath, Charset.forName("GBK"), true);
|
|
|
|
|
|
+// ZipUtil.zip(String.format(this.sourceLocal, num, ""), zipPath, Charset.forName("GBK"), true);
|
|
|
|
|
|
//上传压缩包
|
|
//上传压缩包
|
|
String uploadPath = String.format(this.zipOssFormat, num);
|
|
String uploadPath = String.format(this.zipOssFormat, num);
|
|
@@ -272,10 +278,11 @@ public class SceneDownloadHandlerServiceImpl {
|
|
//更新进度为下载失败
|
|
//更新进度为下载失败
|
|
this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v4");
|
|
this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v4");
|
|
throw e;
|
|
throw e;
|
|
- }finally {
|
|
|
|
- FileUtil.del(zipPath);
|
|
|
|
- FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
}
|
|
}
|
|
|
|
+// finally {
|
|
|
|
+// FileUtil.del(zipPath);
|
|
|
|
+// FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|
|
private SceneViewInfo getSceneJson(String num, String bucket){
|
|
private SceneViewInfo getSceneJson(String num, String bucket){
|
|
@@ -306,83 +313,83 @@ public class SceneDownloadHandlerServiceImpl {
|
|
return sceneInfoVO;
|
|
return sceneInfoVO;
|
|
}
|
|
}
|
|
|
|
|
|
- public void downloadHandlerV3(DownLoadTaskBean downLoadTaskBean) throws Exception{
|
|
|
|
-
|
|
|
|
- String num = downLoadTaskBean.getSceneNum();
|
|
|
|
- //zip包路径
|
|
|
|
- String zipPath = null;
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- TimeInterval timer = DateUtil.timer();
|
|
|
|
-
|
|
|
|
- //删除资源目录
|
|
|
|
- FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
-
|
|
|
|
- ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
|
- if(Objects.isNull(scenePro))
|
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
-
|
|
|
|
- Set<String> cacheKeys = new ConcurrentHashSet<>();
|
|
|
|
-
|
|
|
|
- Map<String, List<String>> allFiles = this.getAllFilesV3(num, v3localPath, bucket);
|
|
|
|
- List<String> ossFilePaths = allFiles.get("ossFilePaths");
|
|
|
|
- List<String> v3localFilePaths = allFiles.get("localFilePaths");
|
|
|
|
-
|
|
|
|
- //key总个数
|
|
|
|
- int total = ossFilePaths.size() + v3localFilePaths.size();
|
|
|
|
- AtomicInteger count = new AtomicInteger(0);
|
|
|
|
- //定义压缩包
|
|
|
|
- zipPath = String.format(this.zipLocalFormat, num);
|
|
|
|
- File zipFile = new File(zipPath);
|
|
|
|
- if(!zipFile.getParentFile().exists()){
|
|
|
|
- zipFile.getParentFile().mkdirs();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int imagesVersion =0;
|
|
|
|
- String resolution = "2k";
|
|
|
|
- JSONObject getInfoJson = this.getInfo(num);
|
|
|
|
- imagesVersion = getInfoJson.getInt("imagesVersion");
|
|
|
|
- // 转台、激光显示4k图片
|
|
|
|
- if(getInfoJson.getInt("sceneSource") == 3 || getInfoJson.getInt("sceneSource") == 4){
|
|
|
|
- resolution = "4k";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //固定文件写入
|
|
|
|
- timer.intervalRestart();
|
|
|
|
- this.zipLocalFiles(v3localFilePaths, v3localPath, num, count, total, "v3");
|
|
|
|
- log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
|
-
|
|
|
|
- //oss文件写入
|
|
|
|
- this.zipOssFiles(null, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v3");
|
|
|
|
- log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
|
-
|
|
|
|
- //重新写入scene.json(去掉密码访问设置)
|
|
|
|
- this.zipGetInfoJson(num, getInfoJson);
|
|
|
|
-
|
|
|
|
- //写入启动命令
|
|
|
|
- this.zipBat(num, "v3", downLoadTaskBean.getLang());
|
|
|
|
-
|
|
|
|
- //打压缩包
|
|
|
|
- ZipUtil.zip(String.format(this.sourceLocal, num, ""), zipPath);
|
|
|
|
-
|
|
|
|
- //上传压缩包
|
|
|
|
- String uploadPath = String.format(this.zipOssFormat, num);
|
|
|
|
- ossUtil.uploadFile(bucket, uploadPath, zipPath, false);
|
|
|
|
- ServiceConfig serviceConfig = SpringUtil.getBean(ServiceConfig.class);
|
|
|
|
-
|
|
|
|
- //更新进度100
|
|
|
|
- String url = "/" + uploadPath + "?t=" + Calendar.getInstance().getTimeInMillis();
|
|
|
|
- this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url, "v3");
|
|
|
|
-
|
|
|
|
- }catch (Exception e){
|
|
|
|
- //更新进度为下载失败
|
|
|
|
- this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v3");
|
|
|
|
- throw e;
|
|
|
|
- }finally {
|
|
|
|
- FileUtil.del(zipPath);
|
|
|
|
- FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// public void downloadHandlerV3(DownLoadTaskBean downLoadTaskBean) throws Exception{
|
|
|
|
+//
|
|
|
|
+// String num = downLoadTaskBean.getSceneNum();
|
|
|
|
+// //zip包路径
|
|
|
|
+// String zipPath = null;
|
|
|
|
+//
|
|
|
|
+// try {
|
|
|
|
+// TimeInterval timer = DateUtil.timer();
|
|
|
|
+//
|
|
|
|
+// //删除资源目录
|
|
|
|
+// FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
+//
|
|
|
|
+// ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
|
+// if(Objects.isNull(scenePro))
|
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
+//
|
|
|
|
+// Set<String> cacheKeys = new ConcurrentHashSet<>();
|
|
|
|
+//
|
|
|
|
+// Map<String, List<String>> allFiles = this.getAllFilesV3(num, v3localPath, bucket);
|
|
|
|
+// List<String> ossFilePaths = allFiles.get("ossFilePaths");
|
|
|
|
+// List<String> v3localFilePaths = allFiles.get("localFilePaths");
|
|
|
|
+//
|
|
|
|
+// //key总个数
|
|
|
|
+// int total = ossFilePaths.size() + v3localFilePaths.size();
|
|
|
|
+// AtomicInteger count = new AtomicInteger(0);
|
|
|
|
+// //定义压缩包
|
|
|
|
+// zipPath = String.format(this.zipLocalFormat, num);
|
|
|
|
+// File zipFile = new File(zipPath);
|
|
|
|
+// if(!zipFile.getParentFile().exists()){
|
|
|
|
+// zipFile.getParentFile().mkdirs();
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// int imagesVersion =0;
|
|
|
|
+// String resolution = "2k";
|
|
|
|
+// JSONObject getInfoJson = this.getInfo(num);
|
|
|
|
+// imagesVersion = getInfoJson.getInt("imagesVersion");
|
|
|
|
+// // 转台、激光显示4k图片
|
|
|
|
+// if(getInfoJson.getInt("sceneSource") == 3 || getInfoJson.getInt("sceneSource") == 4){
|
|
|
|
+// resolution = "4k";
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //固定文件写入
|
|
|
|
+// timer.intervalRestart();
|
|
|
|
+// this.zipLocalFiles(v3localFilePaths, v3localPath, num, count, total, "v3");
|
|
|
|
+// log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
|
+//
|
|
|
|
+// //oss文件写入
|
|
|
|
+// this.zipOssFiles(null, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v3");
|
|
|
|
+// log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
|
+//
|
|
|
|
+// //重新写入scene.json(去掉密码访问设置)
|
|
|
|
+// this.zipGetInfoJson(num, getInfoJson);
|
|
|
|
+//
|
|
|
|
+// //写入启动命令
|
|
|
|
+// this.zipBat(num, "v3", downLoadTaskBean.getLang());
|
|
|
|
+//
|
|
|
|
+// //打压缩包
|
|
|
|
+// ZipUtil.zip(String.format(this.sourceLocal, num, ""), zipPath);
|
|
|
|
+//
|
|
|
|
+// //上传压缩包
|
|
|
|
+// String uploadPath = String.format(this.zipOssFormat, num);
|
|
|
|
+// ossUtil.uploadFile(bucket, uploadPath, zipPath, false);
|
|
|
|
+// ServiceConfig serviceConfig = SpringUtil.getBean(ServiceConfig.class);
|
|
|
|
+//
|
|
|
|
+// //更新进度100
|
|
|
|
+// String url = "/" + uploadPath + "?t=" + Calendar.getInstance().getTimeInMillis();
|
|
|
|
+// this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url, "v3");
|
|
|
|
+//
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// //更新进度为下载失败
|
|
|
|
+// this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v3");
|
|
|
|
+// throw e;
|
|
|
|
+// }finally {
|
|
|
|
+// FileUtil.del(zipPath);
|
|
|
|
+// FileUtil.del(String.format(this.sourceLocal, num, ""));
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
private JSONObject getInfo(String num){
|
|
private JSONObject getInfo(String num){
|
|
String url = String.format(v3GetInfoUrl, num);
|
|
String url = String.format(v3GetInfoUrl, num);
|
|
@@ -404,7 +411,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
private void zipOssFiles(String bucket, List<String> ossFilePaths, String num, AtomicInteger count,
|
|
private void zipOssFiles(String bucket, List<String> ossFilePaths, String num, AtomicInteger count,
|
|
- int total, String resolution, int imagesVersion, Set<String> cacheKeys, String version) throws Exception{
|
|
|
|
|
|
+ int total, String resolution, int imagesVersion, Set<String> cacheKeys, String version, String sourceLocal) throws Exception{
|
|
if(CollUtil.isEmpty(ossFilePaths)){
|
|
if(CollUtil.isEmpty(ossFilePaths)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -420,7 +427,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
@Override
|
|
@Override
|
|
public Boolean call() throws Exception {
|
|
public Boolean call() throws Exception {
|
|
zipOssFilesHandler(bucket, num, count, total, resolution,
|
|
zipOssFilesHandler(bucket, num, count, total, resolution,
|
|
- imagesVersion, cacheKeys,filePath, finalImageNumPath, version);
|
|
|
|
|
|
+ imagesVersion, cacheKeys,filePath, finalImageNumPath, version, sourceLocal);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -444,7 +451,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
private void zipOssFilesHandler(String bucket, String num,
|
|
private void zipOssFilesHandler(String bucket, String num,
|
|
AtomicInteger count, int total, String resolution,
|
|
AtomicInteger count, int total, String resolution,
|
|
int imagesVersion, Set<String> cacheKeys,
|
|
int imagesVersion, Set<String> cacheKeys,
|
|
- String filePath, String imageNumPath, String version) throws Exception{
|
|
|
|
|
|
+ String filePath, String imageNumPath, String version, String sourceLocal) throws Exception{
|
|
|
|
|
|
if(filePath.endsWith("/")){
|
|
if(filePath.endsWith("/")){
|
|
//更新进度
|
|
//更新进度
|
|
@@ -461,7 +468,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
if(!"notNeadCut".equals(resolution)){
|
|
if(!"notNeadCut".equals(resolution)){
|
|
if((filePath.contains(imageNumPath + "panorama/") && filePath.contains("tiles/" + resolution))
|
|
if((filePath.contains(imageNumPath + "panorama/") && filePath.contains("tiles/" + resolution))
|
|
|| filePath.contains(imageNumPath + "tiles/" + resolution + "/")) {
|
|
|| filePath.contains(imageNumPath + "tiles/" + resolution + "/")) {
|
|
- this.processImage(num, filePath, resolution, imagesVersion, cacheKeys);
|
|
|
|
|
|
+ this.processImage(num, filePath, resolution, imagesVersion, cacheKeys, sourceLocal);
|
|
//更新进度
|
|
//更新进度
|
|
this.updateProgress(new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
this.updateProgress(new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
num, SceneDownloadProgressStatus.DOWNLOADING.code(), null, version);
|
|
num, SceneDownloadProgressStatus.DOWNLOADING.code(), null, version);
|
|
@@ -470,18 +477,17 @@ public class SceneDownloadHandlerServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
//其他文件打包
|
|
//其他文件打包
|
|
- this.ProcessFiles(bucket, num, filePath, this.wwwroot, cacheKeys);
|
|
|
|
|
|
+ this.ProcessFiles(bucket, num, filePath, this.wwwroot, cacheKeys, sourceLocal);
|
|
|
|
|
|
//更新进度
|
|
//更新进度
|
|
this.updateProgress(new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
this.updateProgress(new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
num, SceneDownloadProgressStatus.DOWNLOADING.code(), null, version);
|
|
num, SceneDownloadProgressStatus.DOWNLOADING.code(), null, version);
|
|
}
|
|
}
|
|
|
|
|
|
- private void zipLocalFiles(List<String> localFilePaths, String v3localPath, String num, AtomicInteger count, int total, String version) throws Exception{
|
|
|
|
- String sourcePath = String.format(this.sourceLocal, num, "");
|
|
|
|
|
|
+ private void zipLocalFiles(List<String> localFilePaths, String num, AtomicInteger count, int total, String version, String sourcePath) throws Exception{
|
|
String localPath = "v4".equals(version) ? this.v4localPath : this.v3localPath;
|
|
String localPath = "v4".equals(version) ? this.v4localPath : this.v3localPath;
|
|
for (String localFilePath : localFilePaths) {
|
|
for (String localFilePath : localFilePaths) {
|
|
- try (FileInputStream in = new FileInputStream(new File(localFilePath));){
|
|
|
|
|
|
+ try (FileInputStream in = new FileInputStream(localFilePath)){
|
|
// this.zipInputStream(out, localFilePath.replace(v3localPath, ""), in);
|
|
// this.zipInputStream(out, localFilePath.replace(v3localPath, ""), in);
|
|
FileUtil.copy(localFilePath, localFilePath.replace(localPath, sourcePath), true);
|
|
FileUtil.copy(localFilePath, localFilePath.replace(localPath, sourcePath), true);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -494,16 +500,16 @@ public class SceneDownloadHandlerServiceImpl {
|
|
}
|
|
}
|
|
//写入code.txt
|
|
//写入code.txt
|
|
// this.zipBytes(out, "code.txt", num.getBytes());
|
|
// this.zipBytes(out, "code.txt", num.getBytes());
|
|
- FileUtil.writeUtf8String(num, String.format(sourceLocal, num, "code.txt"));
|
|
|
|
|
|
+ FileUtil.writeUtf8String(num, String.format(sourcePath, num, "code.txt"));
|
|
}
|
|
}
|
|
|
|
|
|
- private void zipBat(String num, String version, String lang) throws Exception{
|
|
|
|
|
|
+ private void zipBat(String num, String version, String lang, String sourceLocal) throws Exception{
|
|
String batContent = String.format(this.exeContent, num, lang);
|
|
String batContent = String.format(this.exeContent, num, lang);
|
|
if("v3".equals(version)){
|
|
if("v3".equals(version)){
|
|
batContent = String.format(this.exeContentV3, num, lang);
|
|
batContent = String.format(this.exeContentV3, num, lang);
|
|
}
|
|
}
|
|
// this.zipBytes(out, exeName, batContent.getBytes());
|
|
// this.zipBytes(out, exeName, batContent.getBytes());
|
|
- FileUtil.writeUtf8String(batContent, String.format(this.sourceLocal, num, exeName));
|
|
|
|
|
|
+ FileUtil.writeUtf8String(batContent, String.format(sourceLocal, num, exeName));
|
|
|
|
|
|
//更新进度为90%
|
|
//更新进度为90%
|
|
this.updateProgress(new BigDecimal("0.9").divide(new BigDecimal("0.8"), 6, BigDecimal.ROUND_HALF_UP), num,
|
|
this.updateProgress(new BigDecimal("0.9").divide(new BigDecimal("0.8"), 6, BigDecimal.ROUND_HALF_UP), num,
|
|
@@ -568,24 +574,15 @@ public class SceneDownloadHandlerServiceImpl {
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
- private void zipSceneJson(String num, SceneViewInfo sceneViewInfo) throws Exception{
|
|
|
|
|
|
+ private void zipSceneJson(String num, SceneViewInfo sceneViewInfo, String sourceLocal) throws Exception{
|
|
//访问密码置0
|
|
//访问密码置0
|
|
SceneEditControlsVO controls = sceneViewInfo.getControls();
|
|
SceneEditControlsVO controls = sceneViewInfo.getControls();
|
|
controls.setShowLock(CommonStatus.NO.code().intValue());
|
|
controls.setShowLock(CommonStatus.NO.code().intValue());
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
- FileUtil.writeUtf8String(JSON.toJSONString(sceneViewInfo, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero), 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";
|
|
|
|
-
|
|
|
|
- String getInfoStr = getInfo.toString().replace(this.publicUrl , "");
|
|
|
|
- FileUtil.writeUtf8String(getInfoStr, String.format(this.sourceLocal, num, this.wwwroot + getInfoKey));
|
|
|
|
|
|
+ FileUtil.writeUtf8String(JSON.toJSONString(sceneViewInfo, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero), String.format(sourceLocal, num, this.wwwroot + sceneJsonPath));
|
|
}
|
|
}
|
|
|
|
|
|
- private void processImage(String sceneNum, String key, String resolution, int imagesVersion, Set<String> imgKeys) throws Exception{
|
|
|
|
|
|
+ private void processImage(String sceneNum, String key, String resolution, int imagesVersion, Set<String> imgKeys, String sourceLocal) throws Exception{
|
|
|
|
|
|
if(key.contains("x-oss-process") || key.endsWith("/")){
|
|
if(key.contains("x-oss-process") || key.endsWith("/")){
|
|
return;
|
|
return;
|
|
@@ -650,7 +647,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
HttpUtil.downloadFile(url, path);
|
|
HttpUtil.downloadFile(url, path);
|
|
}
|
|
}
|
|
|
|
|
|
- public void ProcessFiles(String bucket, String num, String key, String prefix, Set<String> cacheKeys) throws Exception{
|
|
|
|
|
|
+ public void ProcessFiles(String bucket, String num, String key, String prefix, Set<String> cacheKeys, String sourceLocal) throws Exception{
|
|
if(cacheKeys.contains(key)){
|
|
if(cacheKeys.contains(key)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|