提交代码

This commit is contained in:
lilin 2025-05-23 18:08:58 +08:00
parent a2019b093b
commit 6cff241b69

View File

@ -564,6 +564,36 @@ public class TsFilesController {
return ResponseResult.success("任务已由其他请求启动");
}
}
/**********************************
* 用途说明: 获取异步信息
* 参数说明 taskId 所属项目ID
* 参数说明 nodeId 所属节点ID
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
***********************************/
@Log(module = "根据项目和节点获取异步信息", value = "根据项目和节点获取异步信息!")
@PostMapping("/automaticFileBackupData")
@ApiOperation("获取异步信息")
public ResponseResult automaticFileBackupData(String taskId, String nodeId) throws Exception {
if (StrUtil.isEmpty(taskId) || StrUtil.isEmpty(nodeId)) {
return ResponseResult.error("参数为空");
}
// 生成唯一Key
String asyncKey = taskStatusHolder.generateKey(taskId, nodeId);
// 检查任务是否已存在
String existingStatus = taskStatusHolder.getStatus(asyncKey);
if ("TASK_NOT_FOUND".equals(existingStatus)) {
return ResponseResult.success("1");
}
if ("IN_PROGRESS".equals(existingStatus)) {
return ResponseResult.success("0");
} else if ("COMPLETED".equals(existingStatus)) {
return ResponseResult.success("自动备份任务已完成!");
}
return null;
}
/**********************************
* 用途说明: 文件自动备份通过ID
@ -600,36 +630,7 @@ public class TsFilesController {
}
}
/**********************************
* 用途说明: 获取异步信息
* 参数说明 id 所属项目ID
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
***********************************/
@Log(module = "获取异步信息", value = "获取异步信息!")
@PostMapping("/automaticFileBackupData")
@ApiOperation("获取异步信息")
public ResponseResult automaticFileBackupData(String id) throws Exception {
if (StrUtil.isEmpty(id) ) {
return ResponseResult.error("参数为空");
}
List<String> dataset = StrUtil.split(id, ",");
// 生成唯一Key
String asyncKey = taskStatusHolder.generateKeybyId(dataset);
// 检查任务是否已存在
String existingStatus = taskStatusHolder.getStatus(asyncKey);
if ("TASK_NOT_FOUND".equals(existingStatus)) {
return ResponseResult.success("1");
}
if ("IN_PROGRESS".equals(existingStatus)) {
return ResponseResult.success("0");
} else if ("COMPLETED".equals(existingStatus)) {
return ResponseResult.success("自动备份任务已完成!");
}
return null;
}
/**********************************
* 用途说明: 实时获取轨迹数据