|
@@ -82,6 +82,8 @@ public class SceneCleanOrigServiceImpl extends ServiceImpl<ISceneCleanOrigMapper
|
|
|
|
|
|
private void cleanOrigHandler(SceneBean scene){
|
|
|
try {
|
|
|
+ int successStatus = CommonSuccessStatus.SUCCESS.code();
|
|
|
+ String reason = null;
|
|
|
String dataSource = scene.getDataSource();
|
|
|
if(StrUtil.isNotEmpty(dataSource)){
|
|
|
String homePath = dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, ConstantFilePath.OSS_PREFIX);
|
|
@@ -90,17 +92,19 @@ public class SceneCleanOrigServiceImpl extends ServiceImpl<ISceneCleanOrigMapper
|
|
|
if(StrUtil.isNotBlank(fileContent)){
|
|
|
JSONObject jsonObject = JSON.parseObject(fileContent);
|
|
|
String snCode = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
- String uuidTime = jsonObject.getString("jsonObject");
|
|
|
- if(!homePath.contains(snCode) || !homePath.contains(snCode.concat("_").concat(uuidTime))){
|
|
|
- this.saveLog(scene.getNum(), CommonSuccessStatus.FAIL.code(), "原始资源路径不正确");
|
|
|
- return;
|
|
|
+ String uuidTime = jsonObject.getString("uuidtime");
|
|
|
+ if(StrUtil.isEmpty(snCode)
|
|
|
+ || StrUtil.isEmpty(uuidTime)
|
|
|
+ || !homePath.contains(snCode)
|
|
|
+ || !homePath.contains(snCode.concat("_").concat(uuidTime))){
|
|
|
+ successStatus = CommonSuccessStatus.FAIL.code();
|
|
|
+ reason = "dataSource与data.fdage文件不匹配";
|
|
|
+ }else{
|
|
|
+ fYunFileService.deleteFolder(homePath);
|
|
|
}
|
|
|
- fYunFileService.deleteFolder(homePath);
|
|
|
- this.saveLog(scene.getNum(), CommonSuccessStatus.SUCCESS.code(), null);
|
|
|
- }else {
|
|
|
- this.saveLog(scene.getNum(), CommonSuccessStatus.FAIL.code(), "oss资源不存在");
|
|
|
}
|
|
|
}
|
|
|
+ this.saveLog(scene.getNum(), successStatus, reason);
|
|
|
}catch (Exception e){
|
|
|
log.error("删除原始资源失败,num : " + scene.getNum(), e);
|
|
|
this.saveLog(scene.getNum(), CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000));
|