|
@@ -88,10 +88,10 @@ public class ScheduleTask {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
// ✅ 创建比赛
|
|
// ✅ 创建比赛
|
|
|
- autowiredTournamentData(config.getTemplateId(), triggerTime,config.getId());
|
|
|
|
|
|
|
+ autowiredTournamentData(exec.getId(),config.getTemplateId(), triggerTime,config.getId());
|
|
|
|
|
|
|
|
|
|
|
|
|
- scheduleExecutionMapper.updateSelective(exec.getId(), "SUCCESS");
|
|
|
|
|
|
|
+/* scheduleExecutionMapper.updateSelective(exec.getId(), "SUCCESS");*/
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("创建比赛失败: execId={}", exec.getId(), e);
|
|
log.error("创建比赛失败: execId={}", exec.getId(), e);
|
|
@@ -140,9 +140,9 @@ public class ScheduleTask {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 创建比赛
|
|
// 创建比赛
|
|
|
- autowiredTournamentData(config.getTemplateId(), triggerTime,config.getId());
|
|
|
|
|
|
|
+ autowiredTournamentData(exec.getId(),config.getTemplateId(), triggerTime,config.getId());
|
|
|
|
|
|
|
|
- scheduleExecutionMapper.updateSelective(exec.getId(), "SUCCESS");
|
|
|
|
|
|
|
+ /* scheduleExecutionMapper.updateSelective(exec.getId(), "SUCCESS");*/
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("创建比赛失败: execId={}", exec.getId(), e);
|
|
log.error("创建比赛失败: execId={}", exec.getId(), e);
|
|
@@ -187,9 +187,7 @@ public class ScheduleTask {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 创建比赛
|
|
// 创建比赛
|
|
|
- autowiredTournamentData(config.getTemplateId(), triggerTime,config.getId());
|
|
|
|
|
-
|
|
|
|
|
- scheduleExecutionMapper.updateSelective(exec.getId(), "SUCCESS");
|
|
|
|
|
|
|
+ autowiredTournamentData(exec.getId(),config.getTemplateId(), triggerTime,config.getId());
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("创建比赛失败: execId={}", exec.getId(), e);
|
|
log.error("创建比赛失败: execId={}", exec.getId(), e);
|
|
@@ -217,7 +215,7 @@ public class ScheduleTask {
|
|
|
* @param templateId
|
|
* @param templateId
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public Boolean autowiredTournamentData(Long templateId,LocalDateTime triggerTime,Long configId) {
|
|
|
|
|
|
|
+ public Boolean autowiredTournamentData(Long execId,Long templateId,LocalDateTime triggerTime,Long configId) {
|
|
|
try {
|
|
try {
|
|
|
TournamentsVo tournamentsVo = tournamentsTemplateMapper.selectVoByIdInfoTemplate(templateId);
|
|
TournamentsVo tournamentsVo = tournamentsTemplateMapper.selectVoByIdInfoTemplate(templateId);
|
|
|
// 模拟构造 TournamentsDto 数据
|
|
// 模拟构造 TournamentsDto 数据
|
|
@@ -285,6 +283,7 @@ public class ScheduleTask {
|
|
|
// 调用已有的插入方法
|
|
// 调用已有的插入方法
|
|
|
if (!iTournamentsService.insertByBo(bo)) {
|
|
if (!iTournamentsService.insertByBo(bo)) {
|
|
|
log.error("赛事插入失败");
|
|
log.error("赛事插入失败");
|
|
|
|
|
+ scheduleExecutionMapper.updateSelective(execId, "FAILED");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -300,10 +299,11 @@ public class ScheduleTask {
|
|
|
scheduleConfig.setId(configId);
|
|
scheduleConfig.setId(configId);
|
|
|
scheduleConfig.setEnabled(true);
|
|
scheduleConfig.setEnabled(true);
|
|
|
baseMapper.updateScheduleConfig(scheduleConfig);
|
|
baseMapper.updateScheduleConfig(scheduleConfig);
|
|
|
-
|
|
|
|
|
|
|
+ scheduleExecutionMapper.updateSelective(execId, "SUCCESS");
|
|
|
return true;
|
|
return true;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("批量插入赛事过程中发生异常", e);
|
|
log.error("批量插入赛事过程中发生异常", e);
|
|
|
|
|
+ scheduleExecutionMapper.updateSelective(execId, "FAILED");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|