You've already forked FrameTour-BE
refactor(task): 优化重复任务处理逻辑
- 移除旧任务更新逻辑,简化重复任务处理流程 - 替换视频查询方法调用,使用新的存储库方法 - 保持任务缓存清除功能 - 简化日志输出信息
This commit is contained in:
@@ -440,19 +440,11 @@ 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());
|
||||||
// 更新旧任务:重置status为0,更新taskParams
|
|
||||||
TaskEntity taskUpdate = new TaskEntity();
|
|
||||||
taskUpdate.setId(existingTask.getId());
|
|
||||||
taskUpdate.setStatus(0);
|
|
||||||
taskUpdate.setTaskParams(JacksonUtil.toJSONString(sourcesMap));
|
|
||||||
taskMapper.update(taskUpdate);
|
|
||||||
// 显式清除workerId(update方法的动态SQL会跳过null值)
|
|
||||||
taskMapper.deassign(existingTask.getId());
|
|
||||||
videoTaskRepository.clearTaskCache(existingTask.getId());
|
videoTaskRepository.clearTaskCache(existingTask.getId());
|
||||||
|
|
||||||
memberVideoEntity.setTaskId(existingTask.getId());
|
memberVideoEntity.setTaskId(existingTask.getId());
|
||||||
VideoEntity video = videoMapper.findByTaskId(existingTask.getId());
|
VideoEntity video = videoRepository.getVideoByTaskId(existingTask.getId());
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
IsBuyRespVO isBuy = orderBiz.isBuy(existingTask.getScenicId(), face.getMemberId(), face.getId(), 0, video.getId());
|
IsBuyRespVO isBuy = orderBiz.isBuy(existingTask.getScenicId(), face.getMemberId(), face.getId(), 0, video.getId());
|
||||||
if (isBuy.isBuy()) {
|
if (isBuy.isBuy()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user