Commit 74a3acd5 by 谢海旭

学习中心 等级考试定时生效 任务

1 parent 397e0f5f
package cn.com.glsx.dj.riskmanage.job.learningcenter;
import cn.com.glsx.dj.riskmanage.service.learningcenter.LearningCenterLevelExamService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Title:
* @Description: 等级考试定时生效 任务
* @Author xiehx
* @Date 2025/11/25
**/
@Service
@Slf4j
@ElasticJobConf(name = "LevelExamTakeEffectJob", cron = "0/5 * * * * ?", description = "等级考试-定时生效任务", overwrite = false)
public class LevelExamTakeEffectJob implements SimpleJob {
@Autowired
private LearningCenterLevelExamService levelExamService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("等级考试-定时生效任务开始");
try {
levelExamService.levelExamTakeEffect();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("等级考试-定时生效任务结束");
}
}
......@@ -6,4 +6,8 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface LearningCenterLevelExamLevelMapper extends OreMapper<LearningCenterLevelExamLevel> {
/**
* 等级考试定时生效
*/
void updateLevelExamTakeEffect();
}
\ No newline at end of file
......@@ -133,4 +133,9 @@ public class LearningCenterLevelExamService {
levelExamLevelMapper.insertList(examLevels);
return levelExamId;
}
@Transactional
public void levelExamTakeEffect() {
levelExamLevelMapper.updateLevelExamTakeEffect();
}
}
......@@ -24,4 +24,8 @@
id, exam_id, level_name, min_score, max_score, sort_order, created_by, created_date,
updated_by, updated_date, deleted_flag
</sql>
<update id="updateLevelExamTakeEffect">
update dj_car_life_learning_center_level_exam set `status` = 2, updated_by = 'system', updated_date = now()
where deleted_flag = 'N' and effective_type = 2 and `status` = 1 and effective_time &lt; now()
</update>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!