|
@@ -125,6 +125,9 @@ public class CaseDownService {
|
|
|
}
|
|
|
@Async
|
|
|
public void downOffline(Integer caseId){
|
|
|
+ String path = "/mnt/fusion/offline";
|
|
|
+ String name = "offline_"+ caseId;
|
|
|
+ String zipName = path+File.separator+name+".zip";
|
|
|
try {
|
|
|
String redisKey = String.format(downProcessKey, caseId);
|
|
|
if( redisUtil.hasKey(redisKey)){
|
|
@@ -143,23 +146,22 @@ public class CaseDownService {
|
|
|
createDataJson(caseId);
|
|
|
setRedisProcess(caseId,50);
|
|
|
//打包zip
|
|
|
- String path = "/mnt/fusion/offline";
|
|
|
- String name = "offline_"+ caseId;
|
|
|
- String zipName = path+File.separator+name+".zip";
|
|
|
ShellUtil.zipOffline(zipName,name);
|
|
|
setRedisProcess(caseId,70);
|
|
|
//上传oss
|
|
|
String ossUrl = zipName.replace("/mnt/", "");
|
|
|
ShellUtil.yunUpload(zipName,ossUrl);
|
|
|
Thread.sleep(2000L);
|
|
|
- FileUtil.del(zipName);
|
|
|
- FileUtil.del(path+File.separator+name);
|
|
|
+
|
|
|
ossUrl = queryPath + ossUrl;
|
|
|
caseOfflineService.saveByCase(caseId,ossUrl);
|
|
|
setRedisProcess(caseId,100,ossUrl);
|
|
|
}catch (Exception e){
|
|
|
log.info("down-offline-error:{}",caseId,e);
|
|
|
setRedisProcess(caseId,0,null,1003);
|
|
|
+ }finally {
|
|
|
+ FileUtil.del(zipName);
|
|
|
+ FileUtil.del(path+File.separator+name);
|
|
|
}
|
|
|
|
|
|
}
|