1.在系统监控---->定时任务中新增定时计划

Jeecg代码搬砖圣地第七篇(定时任务)

 

 2.后台java方法

@Service("smsSendTask")
public class SmsSendTask implements Job{
    
    @Autowired
    private TSSmsServiceI tSSmsService; 
    
    /*@Scheduled(cron="0 0/1 * * * ?")*/
    public void run() {
        long start = System.currentTimeMillis();
        org.jeecgframework.core.util.LogUtil.info("===================推送消息定时任务开始===================");
        try {            
            tSSmsService.send();
        } catch (Exception e) {
            e.printStackTrace();
        }
        org.jeecgframework.core.util.LogUtil.info("===================推送消息定时任务结束===================");
        long end = System.currentTimeMillis();
        long times = end - start;
        org.jeecgframework.core.util.LogUtil.info("总耗时"+times+"毫秒");
    }

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        run();
    }
}

3.多数据源

相关文章:

  • 2022-01-16
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
  • 2021-12-18
  • 2021-05-17
猜你喜欢
  • 2021-11-15
  • 2021-09-17
  • 2022-01-11
  • 2021-07-09
  • 2021-08-04
  • 2021-10-23
  • 2021-09-01
相关资源
相似解决方案