jiangqs
2023-08-06 431dde90aa20f7652092fc0bfa9e6a1a28b06b9f
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.ruoyi.shop.scheduler;
 
 
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.shop.domain.pojo.shop.ShopAuthentication;
import com.ruoyi.shop.service.shop.ShopService;
import com.ruoyi.shop.service.task.ShopTaskService;
import com.ruoyi.system.api.domain.poji.shop.Shop;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
 
@Component
@Slf4j
public class ShopScheduler {
 
 
    @Autowired
    private SchedulerUtils schedulerUtils;
 
    @Resource
    private ShopTaskService shopTaskService;
 
    @Resource
    private ShopService shopService;
 
 
    /**
     * 定时检查跟进任务状态
     */
    @Scheduled(cron="5 0 * * * ?")
    private void timingCheckMemberCoupon(){
        if(schedulerUtils.getSchedulerRun()) {
            log.info("定时检查跟进任务状态任务开始执行");
            shopTaskService.checkTaskDateStatus();
        }
    }
 
    /**
     * 0 0/1 * * * ?
     * 定时检查 每分钟检查一次 微信二级商户进件状态
     */
    @Scheduled(cron="0 0/1 * * * ?")
    private void queryEcommerceApplyMentsStatus(){
        if(schedulerUtils.getSchedulerRun()) {
            log.info("--------------------定时检查微信二级商户进件状态任务开始执行--------------------");
            shopService.queryEcommerceApplyMentsStatus();
            log.info("--------------------定时检查微信二级商户进件状态任务结束执行--------------------");
        }
    }
}