自动化立体仓库 - WMS系统
lty
6 天以前 6c554723b1dfbd50412e963206032ed7dd50bab9
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
package com.zy.system.timer;
 
import com.zy.system.entity.license.LicenseVerify;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
@Component
public class LicenseTimer {
 
    private static boolean SYSTEM_SUPPORT = false;//系统激活状态,默认关闭
 
    private static int LICENSE_DAYS = 0;//许可证天数
 
    //每天晚上11点更新系统激活状态
    @Scheduled(cron = "0 0 23 * * ? ")
    public void timer() {
//        System.out.println(SYSTEM_SUPPORT);
        //验证许可证是否有效
        LicenseVerify licenseVerify = new LicenseVerify();
        boolean verify = licenseVerify.verify();
        setSystemSupport(verify);//更新系统激活状态
    }
 
    public boolean getSystemSupport() {
        return SYSTEM_SUPPORT;
    }
 
    public void setSystemSupport(boolean systemSupport) {
        SYSTEM_SUPPORT = systemSupport;
    }
 
    public int getLicenseDays() {
        return LICENSE_DAYS;
    }
 
    public void setLicenseDays(int licenseDays) {
        LICENSE_DAYS = licenseDays;
    }
 
}