From a1e94379b115721b2e604070dc48063b8016f72f Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 21 十月 2025 19:32:59 +0800
Subject: [PATCH] 侧面输送线出库码盘信息对接
---
src/main/java/com/zy/system/entity/license/LicenseVerify.java | 42 +++++++++++++++++++++---------------------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/zy/system/entity/license/LicenseVerify.java b/src/main/java/com/zy/system/entity/license/LicenseVerify.java
index 2175930..df818ed 100644
--- a/src/main/java/com/zy/system/entity/license/LicenseVerify.java
+++ b/src/main/java/com/zy/system/entity/license/LicenseVerify.java
@@ -19,19 +19,19 @@
/**
* 瀹夎License璇佷功
*/
- public synchronized LicenseContent install(LicenseVerifyParam param){
+ public synchronized LicenseContent install(LicenseVerifyParam param) {
LicenseContent result = null;
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//1. 瀹夎璇佷功
- try{
+ try {
LicenseManager licenseManager = LicenseManagerHolder.getInstance(initLicenseParam(param));
licenseManager.uninstall();
result = licenseManager.install(new File(param.getLicensePath()));
- logger.info(MessageFormat.format("璁稿彲璇佸姞杞芥垚鍔燂紝璁稿彲璇佹湁鏁堟湡锛歿0} - {1}",format.format(result.getNotBefore()),format.format(result.getNotAfter())));
- }catch (Exception e){
- logger.error("璁稿彲璇佸姞杞藉け璐ワ紒",e);
+ logger.info(MessageFormat.format("璁稿彲璇佸姞杞芥垚鍔燂紝璁稿彲璇佹湁鏁堟湡锛歿0} - {1}", format.format(result.getNotBefore()), format.format(result.getNotAfter())));
+ } catch (Exception e) {
+ logger.error("璁稿彲璇佸姞杞藉け璐ワ紒", e);
}
return result;
@@ -40,7 +40,7 @@
/**
* 鏍¢獙License璇佷功
*/
- public boolean verify(){
+ public boolean verify() {
try {
LicenseManager licenseManager = LicenseManagerHolder.getInstance(null);
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -51,10 +51,10 @@
}
LicenseContent licenseContent = licenseManager.verify();
- logger.info(MessageFormat.format("璁稿彲璇佹牎楠岄�氳繃锛岃鍙瘉鏈夋晥鏈燂細{0} - {1}",format.format(licenseContent.getNotBefore()),format.format(licenseContent.getNotAfter())));
+ logger.info(MessageFormat.format("璁稿彲璇佹牎楠岄�氳繃锛岃鍙瘉鏈夋晥鏈燂細{0} - {1}", format.format(licenseContent.getNotBefore()), format.format(licenseContent.getNotAfter())));
return true;
- }catch (Exception e){
- logger.error("璁稿彲璇佹牎楠屽け璐ワ紒",e);
+ } catch (Exception e) {
+ logger.error("璁稿彲璇佹牎楠屽け璐ワ紒", e);
return false;
}
}
@@ -62,7 +62,7 @@
/**
* 鏍¢獙License璇佷功骞惰幏鍙栬瘉涔︿俊鎭�
*/
- public LicenseContent getVerifyInfo(){
+ public LicenseContent getVerifyInfo() {
LicenseManager licenseManager = LicenseManagerHolder.getInstance(null);
if (!updateSystemTime()) {
@@ -74,8 +74,8 @@
try {
LicenseContent licenseContent = licenseManager.verify();
return licenseContent;
- }catch (Exception e){
- logger.error("璁稿彲璇佹牎楠屽け璐ワ紒",e);
+ } catch (Exception e) {
+ logger.error("璁稿彲璇佹牎楠屽け璐ワ紒", e);
return null;
}
}
@@ -85,21 +85,21 @@
* @param param License鏍¢獙绫婚渶瑕佺殑鍙傛暟
* @return de.schlichtherle.license.LicenseParam
*/
- private LicenseParam initLicenseParam(LicenseVerifyParam param){
+ private LicenseParam initLicenseParam(LicenseVerifyParam param) {
Preferences preferences = Preferences.userNodeForPackage(LicenseVerify.class);
CipherParam cipherParam = new DefaultCipherParam(param.getStorePass());
KeyStoreParam publicStoreParam = new CustomKeyStoreParam(LicenseVerify.class
- ,param.getPublicKeysStorePath()
- ,param.getPublicAlias()
- ,param.getStorePass()
- ,null);
+ , param.getPublicKeysStorePath()
+ , param.getPublicAlias()
+ , param.getStorePass()
+ , null);
return new DefaultLicenseParam(param.getSubject()
- ,preferences
- ,publicStoreParam
- ,cipherParam);
+ , preferences
+ , publicStoreParam
+ , cipherParam);
}
/**
@@ -122,7 +122,7 @@
node.put(key, String.valueOf(System.currentTimeMillis()));
return true;
}
- }else {
+ } else {
// 鍐欏叆娉ㄥ唽琛�
node.put(key, String.valueOf(System.currentTimeMillis()));
return true;
--
Gitblit v1.9.1