package com.reptileclient.jlifeapp.schedule;


import com.reptileclient.jlifeapp.service.HmShopAndStationRelationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 1.定时同步盒马服务站和门店关系
 * 2.定时抓取盒马鲸选钟点工的服务单数据
 */
@Component
@Slf4j
@Async
public class HmShopAndStationRelationTask {


    @Autowired
    private HmShopAndStationRelationService hmShopAndStationRelationService;

    // 每日8晚8点半执行一次
    //@Scheduled(cron = "0  30 20 * * ?")
    public void runTask() {
        hmShopAndStationRelationService.syncHmShopAndStation();
    }

    // 每3小时执行一次
//    @Scheduled(cron = "0 0 0/3 * * ?")
    public void runTask2() {
        hmShopAndStationRelationService.synctagPayOrderInfo();
    }
}
