tj
2025-04-02 e2c56f53fcfeb638c35464e9da18b78334daad0f
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
package com.mzl.flower.schedule;
 
import com.mzl.flower.service.customer.CustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
@Component
@Slf4j
public class ScheduleService {
 
    @Autowired
    private CustomerService customerService;
 
    @Scheduled(cron = "0 15 17 * * ?")
    @Profile("prod")
    public void DealSendMessageInfoBySupplier() {
        log.info("供应商下单供货提示开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        log.info("供应商下单供货提示结束:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
 
    // vip过期时间校验,每隔1个小时执行一次
    @Scheduled(cron = "0 0 1 * * ?")
    public void checkVipExpireTime() {
        customerService.checkVipExpireTime();
    }
 
}