|
@@ -160,38 +160,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
//删除正在下载任务
|
|
|
redisUtil.lRemove(RedisKey.SCENE_DOWNLOAD_ING, 1, num);
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Async("sceneDownLoadExecutror")
|
|
|
- public void downloadV3(DownLoadTaskBean downLoadTaskBean){
|
|
|
- //场景码
|
|
|
- String num = null;
|
|
|
-
|
|
|
- try {
|
|
|
- num = downLoadTaskBean.getSceneNum();
|
|
|
-
|
|
|
- log.info("v3场景下载开始 - num[{}] - threadName[{}]", num, Thread.currentThread().getName());
|
|
|
-
|
|
|
- long startTime = Calendar.getInstance().getTimeInMillis();
|
|
|
-
|
|
|
- //执行场景下载逻辑
|
|
|
-// this.downloadHandlerV3(downLoadTaskBean);
|
|
|
-
|
|
|
- //耗时
|
|
|
- long consumeTime = Calendar.getInstance().getTimeInMillis() - startTime;
|
|
|
-
|
|
|
- log.info("v3场景下载结束 - num[{}] - threadName[{}] - consumeTime[{}]", num, Thread.currentThread().getName(), consumeTime);
|
|
|
-
|
|
|
- }catch (Exception e){
|
|
|
- log.error(ExceptionUtil.stacktraceToString(e));
|
|
|
- }finally {
|
|
|
- if(StrUtil.isNotEmpty(num)){
|
|
|
- //本地正在下载任务出队
|
|
|
- CurrentDownloadNumUtil.removeSceneNum(num, "v3");
|
|
|
- //删除正在下载任务
|
|
|
- redisUtil.lRemove(RedisKey.SCENE_V3_DOWNLOAD_ING, 1, num);
|
|
|
- }
|
|
|
+ sceneDownloadLogService.setBuildSceneOffline();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -313,84 +282,6 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
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, ""));
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
private JSONObject getInfo(String num){
|
|
|
String url = String.format(v3GetInfoUrl, num);
|
|
|
String getInfoResult = HttpUtil.get(url);
|