• jeecg定时


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

     

     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();
        }
    }
  • 相关阅读:
    mybatis入门
    windows环境下搭建RocketMQ
    主键-雪花算法
    Springboot杂七杂八
    springboot整合webSocket的使用
    sss
    sss
    sss
    sss
    sss
  • 原文地址:https://www.cnblogs.com/xueblvip/p/12611271.html
Copyright © 2020-2023  润新知