自动化立体仓库 - WMS系统
pang.jiabao
6 天以前 11b91a53371953c684c1f966c8cb5834fb46a4ef
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
package com.zy.asrs.task;
 
import com.zy.asrs.task.handler.ErpAccessTokenHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.PostConstruct;
 
@Component
public class ErpAccessTokenScheduler {
 
    public static String accessToken = "";
 
    @Autowired
    private ErpAccessTokenHandler erpAccessTokenHandler;
 
    @Value("${erp.enable}")
    private Boolean erpEnable;
 
    @PostConstruct
    @Scheduled(cron = "10 15,30,45,59 * * * ?")
    private void accessToken(){
        if (!erpEnable) return;
        erpAccessTokenHandler.getAccessToken();
    }
}