| | |
| | | package com.ruoyi.system.scheduler; |
| | | |
| | | |
| | | import com.ruoyi.system.service.staff.SysWxCpService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.ruoyi.system.service.staff.SysStaffService; |
| | | import com.ruoyi.system.service.sys.ISysDeptService; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | @Component |
| | | @Slf4j |
| | | @Log4j2 |
| | | public class SystemScheduler { |
| | | |
| | | |
| | |
| | | private SchedulerUtils schedulerUtils; |
| | | |
| | | @Autowired |
| | | private SysWxCpService sysWxCpService; |
| | | private SysStaffService sysStaffService; |
| | | |
| | | |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | |
| | | /** |
| | | * 定时同步企业微信部门 |
| | | * 每天凌晨2点定时同步企业微信部门 |
| | | */ |
| | | @Scheduled(cron="0 0 2 * * ?") |
| | | private void timingCheckMemberCoupon(){ |
| | | if(schedulerUtils.getSchedulerRun()) { |
| | | log.info("定时同步企业微信部门任务开始执行"); |
| | | sysWxCpService.syncDepartment(); |
| | | sysDeptService.syncDepartment(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每天8点35分发送员工通知今日跟进任务 |
| | | */ |
| | | @Scheduled(cron="0 35 8 * * ?") |
| | | private void timingSendTaskMessage(){ |
| | | if(schedulerUtils.getSchedulerRun()) { |
| | | log.info("定时发送通知任务任务开始执行"); |
| | | sysStaffService.sendTaskMessage(); |
| | | } |
| | | } |
| | | } |