feat(task): 添加自动替换vlog配置控制功能

- 实现scenicConfig管理器获取景区配置
- 添加auto_replace_vlog配置项,默认值为true
- 当auto_replace_vlog为false时跳过自动创建任务
- 添加视频存在检查避免重复处理
- 记录跳过任务的详细日志信息
This commit is contained in:
2026-01-23 20:57:29 +08:00
parent c40c6a0966
commit d25d09cb66

View File

@@ -438,6 +438,18 @@ public class TaskTaskServiceImpl implements TaskService {
if (!templateTaskList.isEmpty()) { if (!templateTaskList.isEmpty()) {
taskEntity = templateTaskList.getFirst(); taskEntity = templateTaskList.getFirst();
isReuseOldTask = true; isReuseOldTask = true;
if (automatic && !forceCreate) {
boolean autoReplaceVlog = scenicConfig.getBoolean("auto_replace_vlog", true);
if (!autoReplaceVlog) {
VideoEntity video = videoRepository.getVideoByTaskId(taskEntity.getId());
if (video != null) {
log.info("自动创建任务:跳过(auto_replace_vlog=false), faceId:{}, templateId:{}, existingTaskId:{}, videoId:{}",
faceId, templateId, taskEntity.getId(), video.getId());
return;
}
}
}
log.info("已有旧生成的视频:{}", taskEntity); log.info("已有旧生成的视频:{}", taskEntity);
MemberVideoEntity taskVideoRelation = videoMapper.queryRelationByMemberTask(face.getMemberId(), taskEntity.getId()); MemberVideoEntity taskVideoRelation = videoMapper.queryRelationByMemberTask(face.getMemberId(), taskEntity.getId());
if (taskVideoRelation != null) { if (taskVideoRelation != null) {
@@ -469,6 +481,8 @@ public class TaskTaskServiceImpl implements TaskService {
memberVideoEntity.setTaskId(taskEntity.getId()); memberVideoEntity.setTaskId(taskEntity.getId());
} else { } else {
TaskRespVO existingTask = list.getFirst(); TaskRespVO existingTask = list.getFirst();
log.info("重复task! faceId:{},templateId:{},taskId:{}", faceId, templateId, existingTask.getId()); log.info("重复task! faceId:{},templateId:{},taskId:{}", faceId, templateId, existingTask.getId());
videoTaskRepository.clearTaskCache(existingTask.getId()); videoTaskRepository.clearTaskCache(existingTask.getId());