自动化立体仓库 - WMS系统
13
zhang
1 天以前 5a8d3f9952ec4ff545ef0f5878d861692b0a39a3
src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
@@ -40,11 +40,6 @@
    @Value("${license.storePass}")
    private String storePass;
    /**
     * 证书生成路径
     */
    @Value("${license.licensePath}")
    private String licensePath;
    /**
     * 密钥库存储路径
@@ -65,53 +60,27 @@
    //加载证书
    public boolean loadLicense() {
        if(!Cools.isEmpty(licensePath)){
            logger.info("++++++++ 开始加载许可证 ++++++++");
            try {
//                String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath();
//                File publicKeysStoreFile = new File(publicKeysStoreFileName);
//
//                String licensePathFileName = this.getClass().getClassLoader().getResource(licensePath).getPath();
//                File licensePathFile = new File(licensePathFileName);
                LicenseVerifyParam param = new LicenseVerifyParam();
                param.setSubject(subject);
                param.setPublicAlias(publicAlias);
                param.setStorePass(storePass);
                param.setLicensePath(licensePath);
                param.setPublicKeysStorePath(publicKeysStorePath);
                LicenseVerify licenseVerify = new LicenseVerify();
                //安装证书
//                LicenseContent install = licenseVerify.install(param);
                licenseTimer.timer();
                logger.info("++++++++ 许可证加载结束 ++++++++");
                logger.info("++++++++ 许可证加载标记,搜索修改 ++++++++");
                licenseTimer.setSystemSupport(true);
                licenseTimer.setLicenseDays(9999);
//                licenseTimer.setSystemSupport(true);
//                licenseTimer.setLicenseDays(9999);
                return true;
//                licenseTimer.setSystemSupport(install!=null);
//
//                if (install != null) {
//                    Date start = new Date();
//                    Date end = install.getNotAfter();
//                    Long starTime = start.getTime();
//                    Long endTime = end.getTime();
//                    Long num = endTime - starTime;//时间戳相差的毫秒数
//                    int day = (int) (num / 24 / 60 / 60 / 1000);
//                    licenseTimer.setLicenseDays(day);
//                }
//
//
//                return install != null;
            } catch (Exception e) {
                return false;
            }
        }
        licenseTimer.setSystemSupport(false);
        return false;
    }
}