|
@@ -87,16 +87,20 @@ public class SceneCleanOrigServiceImpl extends ServiceImpl<ISceneCleanOrigMapper
|
|
|
String homePath = dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, ConstantFilePath.OSS_PREFIX);
|
|
|
//由于国内测试和生产用的bucket是同一个,这里需要做一个安全校验,保证不会删错
|
|
|
String fileContent = fYunFileService.getFileContent(homePath.concat("/").concat("data.fdage"));
|
|
|
- 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;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ fYunFileService.deleteFolder(homePath);
|
|
|
+ this.saveLog(scene.getNum(), CommonSuccessStatus.SUCCESS.code(), null);
|
|
|
+ }else {
|
|
|
+ this.saveLog(scene.getNum(), CommonSuccessStatus.FAIL.code(), "oss资源不存在");
|
|
|
}
|
|
|
- fYunFileService.deleteFolder(homePath);
|
|
|
}
|
|
|
- this.saveLog(scene.getNum(), CommonSuccessStatus.SUCCESS.code(), null);
|
|
|
}catch (Exception e){
|
|
|
log.error("删除原始资源失败,num : " + scene.getNum(), e);
|
|
|
this.saveLog(scene.getNum(), CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000));
|