KKSU
2024-12-31 fc4c27c84e84aa61a6e7a35fd90d4a52299190de
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
57
58
59
60
61
62
63
package cc.mrbird.febs.mall.quartz;
 
import cc.mrbird.febs.mall.service.IMemberProfitService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
@Slf4j
@Component
@ConditionalOnProperty(prefix = "system", name = "runStep", havingValue = "true")
public class ProfitJob {
 
    @Autowired
    private IMemberProfitService memberProfitService;
 
//    /**
//     * 每12小时更新一次会员等级
//     * 套餐过期后,更新用户为游客等级
//     */
//    @Scheduled(cron = "0 0 0/12 * * ?")
//    public void updateMemberLevel() {
//        memberProfitService.updateMemberLevel();
//    }
//
//    /**
//     * 每天凌晨
//     * 清空用户的碳积分
//     */
//    @Scheduled(cron = "0 0 0 * * ?")
//    public void updateMemberScore() {
//        memberProfitService.updateMemberScore();
//    }
 
    /**
     * 每1小时执行一次
     * 分发碳积分
     *      根据会员等级分发
     */
    @Scheduled(cron = "0 0 0/1 * * ?")
    public void updateRunScore() {
        memberProfitService.updateRunScore();
    }
 
    /**
     * 每天凌晨
     * 释放每一个用户的助力碳币
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void updateMemberCoin() {
        memberProfitService.updateMemberCoin();
    }
 
    /**
     * 每个月一号
     *      节点奖励分发
     */
    @Scheduled(cron = "0 0 0 1 * *")
    public void updateNodeScore() {
        memberProfitService.updateNodeScore();
    }
}