自动化立体仓库 - WMS系统
chen.llin
2 天以前 73e42333948a8143c54218cd26435c2233daf279
src/main/java/com/zy/system/timer/LicenseTimer.java
@@ -2,7 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.core.common.Cools;
import com.zy.common.properties.SchedulerProperties;
import com.zy.common.utils.HttpHandler;
import com.zy.system.entity.LicenseInfos;
import com.zy.system.entity.license.*;
@@ -13,6 +13,7 @@
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
@@ -51,9 +52,15 @@
    @Autowired
    private LicenseInfosService licenseInfosService;
    @Resource
    private SchedulerProperties schedulerProperties;
    //每天晚上11点更新系统激活状态
    @Scheduled(cron = "0 0 23 * * ? ")
    public void timer() {
        if (!schedulerProperties.isEnabled()) {
            return;
        }
        try {
            getRemoteLicense();
        } catch (Exception e) {
@@ -76,7 +83,7 @@
                abstractServerInfos = new WindowsServerInfos();
            } else if (osName.startsWith("linux")) {
                abstractServerInfos = new LinuxServerInfos();
            }else{//其他服务器类型
            } else {//其他服务器类型
                abstractServerInfos = new WindowsServerInfos();
            }
            LicenseCheck serverInfos = abstractServerInfos.getServerInfos();
@@ -132,7 +139,7 @@
            int day = (int) (num / 24 / 60 / 60 / 1000);
            setLicenseDays(day);
            setSystemSupport(true);
        }else {
        } else {
            setLicenseDays(0);
            setSystemSupport(false);
        }