Fancy
2024-11-01 4a35dea2b0976e7fdb0e2b1a0d7d9b8ac2af0fe4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.dy.pmsStation.task;
 
import com.dy.common.schedulerTask.TaskJob;
import com.dy.common.springUtil.SpringContextUtil;
import com.dy.pmsGlobal.daoSta.StaDeviceProductionLogPastMapper;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.transaction.annotation.Transactional;
 
@Slf4j
public class LogMoveTask extends TaskJob {
 
    @Override
    @Transactional
    public void execute(JobExecutionContext ctx) throws JobExecutionException {
        log.info("生产日志移动任务开始");
        StaDeviceProductionLogPastMapper pastMapper = SpringContextUtil.getBean(StaDeviceProductionLogPastMapper.class);
        Long count = pastMapper.countLastDayLogs();
        if(count>0){
            pastMapper.insertIntoPastLogs();
            pastMapper.deleteFromLogTable();
        }
        log.info("生产日志移动任务结束");
    }
}