|
@@ -2,14 +2,19 @@ package com.fdkankan.download.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.ConcurrentHashSet;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.date.TimeInterval;
|
|
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.SceneDownloadProgressStatus;
|
|
|
import com.fdkankan.common.constant.SceneFrom;
|
|
|
import com.fdkankan.common.constant.SceneResolution;
|
|
|
+import com.fdkankan.common.constant.ServerCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.download.bean.CurrentDownloadNumUtil;
|
|
@@ -19,13 +24,16 @@ import com.fdkankan.download.bean.ImageType;
|
|
|
import com.fdkankan.download.bean.ImageTypeDetail;
|
|
|
import com.fdkankan.download.entity.ScenePlus;
|
|
|
import com.fdkankan.download.entity.ScenePlusExt;
|
|
|
+import com.fdkankan.download.entity.ScenePro;
|
|
|
import com.fdkankan.download.service.IScenePlusExtService;
|
|
|
import com.fdkankan.download.service.IScenePlusService;
|
|
|
+import com.fdkankan.download.service.ISceneProService;
|
|
|
import com.fdkankan.fyun.constant.FYunTypeEnum;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import com.fdkankan.web.response.ResultData;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
@@ -75,6 +83,10 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
UploadFilePath.USER_VIEW_PATH,
|
|
|
};
|
|
|
|
|
|
+ private static final String[] prefixArr4v3 = new String[]{
|
|
|
+ "data/data%s/", "images/images%s/", "voice/voice%s/", "video/video%s/"
|
|
|
+ };
|
|
|
+
|
|
|
private static final List<ImageType> imageTypes = Lists.newArrayList();
|
|
|
static{
|
|
|
imageTypes.add(ImageType.builder().name("2k_face").size("2048").ranges(new String[]{"0", "511", "1023", "1535"}).build());
|
|
@@ -82,8 +94,12 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
imageTypes.add(ImageType.builder().name("512_face").size("512").ranges(new String[]{"0"}).build());
|
|
|
}
|
|
|
|
|
|
+ @Value("url.v3.getInfo")
|
|
|
+ private String v3GetInfoUrl;
|
|
|
@Value("${path.v4school}")
|
|
|
private String v4localPath;
|
|
|
+ @Value("${path.v3school}")
|
|
|
+ private String v3localPath;
|
|
|
@Value("${path.zip-local}")
|
|
|
private String zipLocalFormat;
|
|
|
@Value("${path.zip-oss}")
|
|
@@ -94,7 +110,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
private int zipNthreads;
|
|
|
@Value("${oss.bucket:4dkankan}")
|
|
|
private String bucket;
|
|
|
- @Value("${upload.type:oss}")
|
|
|
+ @Value("${fyun.type}")
|
|
|
private String uploadType;
|
|
|
@Value("${download.config.resource-url}")
|
|
|
private String resourceUrl;
|
|
@@ -104,6 +120,8 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
private String exeName;
|
|
|
@Value("${download.config.exe-content}")
|
|
|
private String exeContent;
|
|
|
+ @Value("${download.config.exe-content-v3}")
|
|
|
+ private String exeContentV3;
|
|
|
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
@@ -113,6 +131,8 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
private IScenePlusService scenePlusService;
|
|
|
@Autowired
|
|
|
private IScenePlusExtService scenePlusExtService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneProService sceneProService;
|
|
|
|
|
|
@Async("sceneDownLoadExecutror")
|
|
|
public void download(DownLoadTaskBean downLoadTaskBean){
|
|
@@ -139,7 +159,39 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
}finally {
|
|
|
if(StrUtil.isNotEmpty(num)){
|
|
|
//本地正在下载任务出队
|
|
|
- CurrentDownloadNumUtil.removeSceneNum(num);
|
|
|
+ CurrentDownloadNumUtil.removeSceneNum(num, "v4");
|
|
|
+ //删除正在下载任务
|
|
|
+ redisUtil.lRemove(RedisKey.SCENE_DOWNLOAD_ING, 1, num);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Async("sceneDownLoadExecutror")
|
|
|
+ public void downloadV3(DownLoadTaskBean downLoadTaskBean){
|
|
|
+ //场景码
|
|
|
+ String num = null;
|
|
|
+
|
|
|
+ try {
|
|
|
+ num = downLoadTaskBean.getNum();
|
|
|
+
|
|
|
+ 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_DOWNLOAD_ING, 1, num);
|
|
|
}
|
|
@@ -164,10 +216,10 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
|
|
|
Map<String, List<String>> allFiles = this.getAllFiles(num, v4localPath, bucket);
|
|
|
List<String> ossFilePaths = allFiles.get("ossFilePaths");
|
|
|
- List<String> v3localFilePaths = allFiles.get("v3localFilePaths");
|
|
|
+ List<String> v4localFilePaths = allFiles.get("v3localFilePaths");
|
|
|
|
|
|
//key总个数
|
|
|
- int total = ossFilePaths.size() + v3localFilePaths.size();
|
|
|
+ int total = ossFilePaths.size() + v4localFilePaths.size();
|
|
|
AtomicInteger count = new AtomicInteger(0);
|
|
|
//定义压缩包
|
|
|
zipPath = String.format(this.zipLocalFormat, num);
|
|
@@ -200,12 +252,12 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
long start = Calendar.getInstance().getTimeInMillis();
|
|
|
|
|
|
//固定文件写入
|
|
|
- this.zipLocalFiles(out, v3localFilePaths, v4localPath, num, count, total);
|
|
|
+ this.zipLocalFiles(out, v4localFilePaths, v4localPath, num, count, total, "v4");
|
|
|
long end1 = Calendar.getInstance().getTimeInMillis();
|
|
|
log.info("打包固定文件耗时, num:{}, time:{}", num, end1 - start);
|
|
|
|
|
|
//oss文件写入
|
|
|
- this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys);
|
|
|
+ this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v4");
|
|
|
long end2 = Calendar.getInstance().getTimeInMillis();
|
|
|
log.info("打包oss文件耗时, num:{}, time:{}", num, end2 - end1);
|
|
|
|
|
@@ -213,7 +265,86 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
this.zipSceneJson(out, this.wwwroot, num, sceneJson);
|
|
|
|
|
|
//写入启动命令
|
|
|
- this.zipBat(out, num);
|
|
|
+ this.zipBat(out, num, "v4");
|
|
|
+
|
|
|
+ out.close();
|
|
|
+
|
|
|
+ //上传压缩包
|
|
|
+ String uploadPath = String.format(this.zipOssFormat, num);
|
|
|
+ fYunFileService.uploadFileByCommand(bucket, zipPath, uploadPath);
|
|
|
+
|
|
|
+ //更新进度100
|
|
|
+ String url = this.publicUrl + uploadPath + "?t=" + Calendar.getInstance().getTimeInMillis();
|
|
|
+ this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url, "v4");
|
|
|
+
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ //更新进度为下载失败
|
|
|
+ this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v4");
|
|
|
+ throw e;
|
|
|
+ }finally {
|
|
|
+ if(StrUtil.isNotBlank(zipPath)){
|
|
|
+ //删除本地zip包
|
|
|
+ FileUtils.deleteFile(zipPath);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void downloadHandlerV3(DownLoadTaskBean downLoadTaskBean) throws Exception{
|
|
|
+
|
|
|
+ String num = downLoadTaskBean.getNum();
|
|
|
+ //zip包路径
|
|
|
+ String zipPath = null;
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ TimeInterval timer = DateUtil.timer();
|
|
|
+
|
|
|
+ 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("v3localFilePaths");
|
|
|
+
|
|
|
+ //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();
|
|
|
+ }
|
|
|
+ ZipOutputStream out = new ZipOutputStream(zipFile);
|
|
|
+
|
|
|
+ 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(out, v3localFilePaths, v3localPath, num, count, total, "v3");
|
|
|
+ log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
+
|
|
|
+ //oss文件写入
|
|
|
+ this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v3");
|
|
|
+ long end2 = Calendar.getInstance().getTimeInMillis();
|
|
|
+ log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
|
|
|
+
|
|
|
+ //重新写入scene.json(去掉密码访问设置)
|
|
|
+ this.zipGetInfoJson(out, this.wwwroot, num, getInfoJson);
|
|
|
+
|
|
|
+ //写入启动命令
|
|
|
+ this.zipBat(out, num, "v3");
|
|
|
|
|
|
out.close();
|
|
|
|
|
@@ -223,12 +354,12 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
|
|
|
//更新进度100
|
|
|
String url = this.publicUrl + uploadPath + "?t=" + Calendar.getInstance().getTimeInMillis();
|
|
|
- this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url);
|
|
|
+ this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url, "v3");
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
//更新进度为下载失败
|
|
|
- this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null);
|
|
|
+ this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v3");
|
|
|
throw e;
|
|
|
}finally {
|
|
|
if(StrUtil.isNotBlank(zipPath)){
|
|
@@ -238,20 +369,43 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private JSONObject getInfo(String num){
|
|
|
+ String url = String.format(v3GetInfoUrl, num);
|
|
|
+ String getInfoResult = HttpUtil.get(url);
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(getInfoResult);
|
|
|
+ if(Objects.isNull(jsonObject)
|
|
|
+ || !ServerCode.SUCCESS.code().equals(jsonObject.getInt("code"))
|
|
|
+ || Objects.isNull(jsonObject.getJSONObject("data"))){
|
|
|
+ throw new RuntimeException("获取getInfo信息失败,url=" + url);
|
|
|
+ }
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ if (data.getInt("sceneSource") != 2)
|
|
|
+ {
|
|
|
+ data.set("sceneScheme", 3);
|
|
|
+ }
|
|
|
+ data.set("needKey", 0);
|
|
|
+ data.set("sceneKey", "");
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
private void zipOssFiles(ZipOutputStream out, List<String> ossFilePaths, String num, AtomicInteger count,
|
|
|
- int total, String resolution, int imagesVersion, Set<String> cacheKeys) throws Exception{
|
|
|
+ int total, String resolution, int imagesVersion, Set<String> cacheKeys, String version) throws Exception{
|
|
|
if(CollUtil.isEmpty(ossFilePaths)){
|
|
|
return;
|
|
|
}
|
|
|
String imageNumPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
+ if("v3".equals(version)){
|
|
|
+ imageNumPath = String.format("images/images%s/", num);
|
|
|
+ }
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(this.zipNthreads);
|
|
|
List<Future> futureList = new ArrayList<>();
|
|
|
for (String filePath : ossFilePaths) {
|
|
|
+ String finalImageNumPath = imageNumPath;
|
|
|
Callable<Boolean> call = new Callable() {
|
|
|
@Override
|
|
|
public Boolean call() throws Exception {
|
|
|
zipOssFilesHandler(out, num, count, total, resolution,
|
|
|
- imagesVersion, cacheKeys,filePath, imageNumPath);
|
|
|
+ imagesVersion, cacheKeys,filePath, finalImageNumPath, version);
|
|
|
return true;
|
|
|
}
|
|
|
};
|
|
@@ -275,11 +429,11 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
private void zipOssFilesHandler(ZipOutputStream out, String num,
|
|
|
AtomicInteger count, int total, String resolution,
|
|
|
int imagesVersion, Set<String> cacheKeys,
|
|
|
- String filePath, String imageNumPath) throws Exception{
|
|
|
+ String filePath, String imageNumPath, String version) throws Exception{
|
|
|
|
|
|
//更新进度
|
|
|
this.updateProgress(new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
|
- num, SceneDownloadProgressStatus.DOWNLOADING.code(), null);
|
|
|
+ num, SceneDownloadProgressStatus.DOWNLOADING.code(), null, version);
|
|
|
|
|
|
//某个目录不需要打包
|
|
|
if(filePath.contains(imageNumPath + "panorama/panorama_edit/"))
|
|
@@ -298,32 +452,35 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
this.ProcessFiles(num, filePath, out, this.wwwroot, cacheKeys);
|
|
|
}
|
|
|
|
|
|
- private void zipLocalFiles(ZipOutputStream out, List<String> v3localFilePaths, String v3localPath, String num, AtomicInteger count, int total) throws Exception{
|
|
|
- for (String v3localFilePath : v3localFilePaths) {
|
|
|
- try (FileInputStream in = new FileInputStream(new File(v3localFilePath));){
|
|
|
- this.zipInputStream(out, v3localFilePath.replace(v3localPath, ""), in);
|
|
|
+ private void zipLocalFiles(ZipOutputStream out, List<String> localFilePaths, String v3localPath, String num, AtomicInteger count, int total, String version) throws Exception{
|
|
|
+ for (String localFilePath : localFilePaths) {
|
|
|
+ try (FileInputStream in = new FileInputStream(new File(localFilePath));){
|
|
|
+ this.zipInputStream(out, localFilePath.replace(v3localPath, ""), in);
|
|
|
}catch (Exception e){
|
|
|
throw e;
|
|
|
}
|
|
|
//更新进度
|
|
|
this.updateProgress(
|
|
|
new BigDecimal(count.incrementAndGet()).divide(new BigDecimal(total), 6, BigDecimal.ROUND_HALF_UP),
|
|
|
- num, SceneDownloadProgressStatus.DOWNLOAD_COMPRESSING.code(), null);
|
|
|
+ num, SceneDownloadProgressStatus.DOWNLOAD_COMPRESSING.code(), null, version);
|
|
|
}
|
|
|
//写入code.txt
|
|
|
this.zipBytes(out, "code.txt", num.getBytes());
|
|
|
}
|
|
|
|
|
|
- private void zipBat(ZipOutputStream out, String num) throws Exception{
|
|
|
+ private void zipBat(ZipOutputStream out, String num, String version) throws Exception{
|
|
|
String batContent = String.format(this.exeContent, num);
|
|
|
+ if("v3".equals(version)){
|
|
|
+ batContent = String.format(this.exeContentV3, num);
|
|
|
+ }
|
|
|
this.zipBytes(out, exeName, batContent.getBytes());
|
|
|
|
|
|
//更新进度为90%
|
|
|
this.updateProgress(new BigDecimal("0.9").divide(new BigDecimal("0.8"), 6, BigDecimal.ROUND_HALF_UP), num,
|
|
|
- SceneDownloadProgressStatus.DOWNLOAD_COMPRESSING.code(), null);
|
|
|
+ SceneDownloadProgressStatus.DOWNLOAD_COMPRESSING.code(), null, version);
|
|
|
}
|
|
|
|
|
|
- private Map<String, List<String>> getAllFiles(String num, String v3localPath, String bucket) throws Exception{
|
|
|
+ private Map<String, List<String>> getAllFiles(String num, String v4localPath, String bucket) throws Exception{
|
|
|
//列出oss所有文件路径
|
|
|
List<String> ossFilePaths = new ArrayList<>();
|
|
|
for (String prefix : prefixArr) {
|
|
@@ -344,6 +501,37 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
}
|
|
|
|
|
|
//列出v3local所有文件路径
|
|
|
+ File file = new File(v4localPath);
|
|
|
+ List<String> v3localFilePaths = FileUtils.list(file);
|
|
|
+
|
|
|
+ HashMap<String, List<String>> map = new HashMap<>();
|
|
|
+ map.put("ossFilePaths", ossFilePaths);
|
|
|
+ map.put("v4localFilePaths", v3localFilePaths);
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, List<String>> getAllFilesV3(String num, String v3localPath, String bucket) throws Exception{
|
|
|
+ //列出oss所有文件路径
|
|
|
+ List<String> ossFilePaths = new ArrayList<>();
|
|
|
+ for (String prefix : prefixArr4v3) {
|
|
|
+ prefix = String.format(prefix, num);
|
|
|
+ List<String> keys = fYunFileService.listRemoteFiles(bucket, prefix);
|
|
|
+ if(CollUtil.isEmpty(keys)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(FYunTypeEnum.AWS.code().equals(this.uploadType)){
|
|
|
+ keys = keys.stream().filter(key->{
|
|
|
+ if(key.contains("x-oss-process")){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ ossFilePaths.addAll(keys);
|
|
|
+ }
|
|
|
+
|
|
|
+ //列出v3local所有文件路径
|
|
|
File file = new File(v3localPath);
|
|
|
List<String> v3localFilePaths = FileUtils.list(file);
|
|
|
|
|
@@ -364,6 +552,13 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
this.zipBytes(out, sceneJsonPath, sceneJson.toString().getBytes());
|
|
|
}
|
|
|
|
|
|
+ private void zipGetInfoJson(ZipOutputStream out, String root, String num, JSONObject getInfo) throws Exception{
|
|
|
+
|
|
|
+ //访问密码置0
|
|
|
+ String getInfoKey = root + String.format("data/data%s/", num) + "getInfo.json";
|
|
|
+ this.zipBytes(out, getInfoKey, getInfo.toString().getBytes());
|
|
|
+ }
|
|
|
+
|
|
|
private void processImage(String key, ZipOutputStream out, String resolution, int imagesVersion, Set<String> imgKeys) throws Exception{
|
|
|
|
|
|
if(key.contains("x-oss-process") || key.endsWith("/")){
|
|
@@ -454,7 +649,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void updateProgress(BigDecimal precent, String num, Integer status, String url){
|
|
|
+ public void updateProgress(BigDecimal precent, String num, Integer status, String url, String version){
|
|
|
|
|
|
SceneDownloadProgressStatus progressStatus = SceneDownloadProgressStatus.get(status);
|
|
|
switch (progressStatus){
|
|
@@ -470,6 +665,9 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
|
|
|
DownLoadProgressBean progress = null;
|
|
|
String key = String.format(RedisKey.PREFIX_DOWNLOAD_PROGRESS_V4, num);
|
|
|
+ if("v3".equals(version)){
|
|
|
+ key = RedisKey.PREFIX_DOWNLOAD_PROGRESS;
|
|
|
+ }
|
|
|
String progressStr = redisUtil.get(key);
|
|
|
if(StrUtil.isEmpty(progressStr)){
|
|
|
progress = DownLoadProgressBean.builder().percent(precent.intValue()).status(status).url(url).build();
|