From d0226747665355acecd5b4f2b5c0beb020586729 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 17 一月 2025 15:37:32 +0800
Subject: [PATCH] # 23. PDA拣货单据,勾选或点击确认按钮后,完成当前单据 (已完成) 24. PDA出库成功后,界面数据重置,避免重复操作  (已修复) 25. PDA接口请求,添加一个Loading遮档  (已修复) 27. 非平库单据,在平库可做入库操作  (已修复) 28. 平库已组拖数据,组拖完成后依然可组拖  (已修复) 29. 平库入库后,订单明细没有添加(已修复) 30. 平库入库后,单据类型没有修改(已修复) 31. 没有绑定播种位,不能进行播种,前后端都需加判定(已修复) 33. 平库入库未修改入库已完成数量(已修复) 34. cacheSite缓存站点逻辑需重新梳理,入库生成波次时(已完成) 35. PDA添加发货确认,默认全选 (已修复) 36. 大屏获取任务时,是由容器到达的拖盘码确认通知 (已修复) 37. 拣货单序号不显示 问题修复 (已修复) 42. pda发货确认,添加不同颜色区分是否全部完成拣货,绿色全部拣货完成,红色完成部分拣货(已修复) 43. CTU入库完成后,订单明细没有删除,执行中数量清空(已修复) 44. 平库入库完成后,历史档明细完成数量没有更新 (已修复) 45. PDA料号不显示  (已修复) 46. 发货完成后,波次管理数据未加入历史档 (已修复)

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/CustomLicenseManager.java |  484 ++++++++++++++++++++++++++--------------------------
 1 files changed, 242 insertions(+), 242 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/CustomLicenseManager.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/CustomLicenseManager.java
index 4704e30..463c50f 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/CustomLicenseManager.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/CustomLicenseManager.java
@@ -1,243 +1,243 @@
-package com.zy.asrs.wms.system.license.entity.license;
-
-import com.alibaba.fastjson.JSON;
-import com.zy.asrs.framework.common.Cools;
-import de.schlichtherle.license.*;
-import de.schlichtherle.xml.GenericCertificate;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import java.beans.XMLDecoder;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Date;
-import java.util.List;
-
-/**
- * 鑷畾涔塋icenseManager锛岀敤浜庡鍔犻澶栫殑鏈嶅姟鍣ㄧ‖浠朵俊鎭牎楠�
- */
-public class CustomLicenseManager extends LicenseManager{
-    private static Logger logger = LogManager.getLogger(CustomLicenseManager.class);
-
-    //XML缂栫爜
-    private static final String XML_CHARSET = "UTF-8";
-    //榛樿BUFSIZE
-    private static final int DEFAULT_BUFSIZE = 8 * 1024;
-
-    public CustomLicenseManager() {
-
-    }
-
-    public CustomLicenseManager(LicenseParam param) {
-        super(param);
-    }
-
-    /**
-     * 澶嶅啓create鏂规硶
-     */
-    @Override
-    protected synchronized byte[] create(
-            LicenseContent content,
-            LicenseNotary notary)
-            throws Exception {
-        initialize(content);
-        this.validateCreate(content);
-        final GenericCertificate certificate = notary.sign(content);
-        return getPrivacyGuard().cert2key(certificate);
-    }
-
-    /**
-     * 澶嶅啓install鏂规硶锛屽叾涓璿alidate鏂规硶璋冪敤鏈被涓殑validate鏂规硶锛屾牎楠孖P鍦板潃銆丮ac鍦板潃绛夊叾浠栦俊鎭�
-     */
-    @Override
-    protected synchronized LicenseContent install(
-            final byte[] key,
-            final LicenseNotary notary)
-            throws Exception {
-        final GenericCertificate certificate = getPrivacyGuard().key2cert(key);
-
-        notary.verify(certificate);
-        final LicenseContent content = (LicenseContent)this.load(certificate.getEncoded());
-        this.validate(content);
-        setLicenseKey(key);
-        setCertificate(certificate);
-
-        return content;
-    }
-
-    /**
-     * 澶嶅啓verify鏂规硶锛岃皟鐢ㄦ湰绫讳腑鐨剉alidate鏂规硶锛屾牎楠孖P鍦板潃銆丮ac鍦板潃绛夊叾浠栦俊鎭�
-     */
-    @Override
-    protected synchronized LicenseContent verify(final LicenseNotary notary)
-            throws Exception {
-        GenericCertificate certificate = getCertificate();
-
-        // Load license key from preferences,
-        final byte[] key = getLicenseKey();
-        if (null == key){
-            throw new NoLicenseInstalledException(getLicenseParam().getSubject());
-        }
-
-        certificate = getPrivacyGuard().key2cert(key);
-        notary.verify(certificate);
-        final LicenseContent content = (LicenseContent)this.load(certificate.getEncoded());
-        this.validate(content);
-        setCertificate(certificate);
-
-        return content;
-    }
-
-    /**
-     * 鏍¢獙鐢熸垚璇佷功鐨勫弬鏁颁俊鎭�
-     */
-    protected synchronized void validateCreate(final LicenseContent content)
-            throws LicenseContentException {
-        final LicenseParam param = getLicenseParam();
-
-        final Date now = new Date();
-        final Date notBefore = content.getNotBefore();
-        final Date notAfter = content.getNotAfter();
-        if (null != notAfter && now.after(notAfter)){
-            throw new LicenseContentException("璇佷功澶辨晥鏃堕棿涓嶈兘鏃╀簬褰撳墠鏃堕棿");
-        }
-        if (null != notBefore && null != notAfter && notAfter.before(notBefore)){
-            throw new LicenseContentException("璇佷功鐢熸晥鏃堕棿涓嶈兘鏅氫簬璇佷功澶辨晥鏃堕棿");
-        }
-        final String consumerType = content.getConsumerType();
-        if (null == consumerType){
-            throw new LicenseContentException("鐢ㄦ埛绫诲瀷涓嶈兘涓虹┖");
-        }
-    }
-
-
-    /**
-     * 澶嶅啓validate鏂规硶锛屽鍔營P鍦板潃銆丮ac鍦板潃绛夊叾浠栦俊鎭牎楠�
-     */
-    @Override
-    protected synchronized void validate(final LicenseContent content)
-            throws LicenseContentException {
-        //1. 棣栧厛璋冪敤鐖剁被鐨剉alidate鏂规硶
-        super.validate(content);
-
-        //2. 鐒跺悗鏍¢獙鑷畾涔夌殑License鍙傛暟
-        //License涓彲琚厑璁哥殑鍙傛暟淇℃伅
-//        LicenseCheck expectedCheckModel = (LicenseCheck) content.getExtra();
-        LicenseCheck expectedCheckModel = JSON.parseObject(content.getExtra().toString(), LicenseCheck.class);
-        //褰撳墠鏈嶅姟鍣ㄧ湡瀹炵殑鍙傛暟淇℃伅
-        LicenseCheck serverCheckModel = getServerInfos();
-
-        if(expectedCheckModel != null && serverCheckModel != null){
-            //鏍¢獙IP鍦板潃
-            if(!checkIpAddress(expectedCheckModel.getIpAddress(),serverCheckModel.getIpAddress())){
-                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑IP娌″湪鎺堟潈鑼冨洿鍐�");
-            }
-
-            //鏍¢獙Mac鍦板潃
-            if(!checkIpAddress(expectedCheckModel.getMacAddress(),serverCheckModel.getMacAddress())){
-                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑Mac鍦板潃娌″湪鎺堟潈鑼冨洿鍐�");
-            }
-
-            //鏍¢獙涓绘澘搴忓垪鍙�
-            if(!checkSerial(expectedCheckModel.getMainBoardSerial(),serverCheckModel.getMainBoardSerial())){
-                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑涓绘澘搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴");
-            }
-
-            //鏍¢獙CPU搴忓垪鍙�
-            if(!checkSerial(expectedCheckModel.getCpuSerial(),serverCheckModel.getCpuSerial())){
-                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑CPU搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴");
-            }
-        }else{
-            throw new LicenseContentException("涓嶈兘鑾峰彇鏈嶅姟鍣ㄧ‖浠朵俊鎭�");
-        }
-    }
-
-
-    /**
-     * 閲嶅啓XMLDecoder瑙f瀽XML
-     */
-    private Object load(String encoded){
-        BufferedInputStream inputStream = null;
-        XMLDecoder decoder = null;
-        try {
-            inputStream = new BufferedInputStream(new ByteArrayInputStream(encoded.getBytes(XML_CHARSET)));
-
-            decoder = new XMLDecoder(new BufferedInputStream(inputStream, DEFAULT_BUFSIZE),null,null);
-
-            return decoder.readObject();
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if(decoder != null){
-                    decoder.close();
-                }
-                if(inputStream != null){
-                    inputStream.close();
-                }
-            } catch (Exception e) {
-                logger.error("XMLDecoder瑙f瀽XML澶辫触",e);
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * 鑾峰彇褰撳墠鏈嶅姟鍣ㄩ渶瑕侀澶栨牎楠岀殑License鍙傛暟
-     */
-    private LicenseCheck getServerInfos(){
-        //鎿嶄綔绯荤粺绫诲瀷
-        String osName = System.getProperty("os.name").toLowerCase();
-        AbstractServerInfos abstractServerInfos = null;
-
-        //鏍规嵁涓嶅悓鎿嶄綔绯荤粺绫诲瀷閫夋嫨涓嶅悓鐨勬暟鎹幏鍙栨柟娉�
-        if (osName.startsWith("windows")) {
-            abstractServerInfos = new WindowsServerInfos();
-        } else if (osName.startsWith("linux")) {
-            abstractServerInfos = new LinuxServerInfos();
-        }else{//鍏朵粬鏈嶅姟鍣ㄧ被鍨�
-            abstractServerInfos = new WindowsServerInfos();
-        }
-
-        return abstractServerInfos.getServerInfos();
-    }
-
-    /**
-     * 鏍¢獙褰撳墠鏈嶅姟鍣ㄧ殑IP/Mac鍦板潃鏄惁鍦ㄥ彲琚厑璁哥殑IP鑼冨洿鍐�<br/>
-     * 濡傛灉瀛樺湪IP鍦ㄥ彲琚厑璁哥殑IP/Mac鍦板潃鑼冨洿鍐咃紝鍒欒繑鍥瀟rue
-     */
-    private boolean checkIpAddress(List<String> expectedList,List<String> serverList){
-        if(expectedList != null && expectedList.size() > 0){
-            if(serverList != null && serverList.size() > 0){
-                for(String expected : expectedList){
-                    if(serverList.contains(expected.trim())){
-                        return true;
-                    }
-                }
-            }
-
-            return false;
-        }else {
-            return true;
-        }
-    }
-
-    /**
-     * 鏍¢獙褰撳墠鏈嶅姟鍣ㄧ‖浠讹紙涓绘澘銆丆PU绛夛級搴忓垪鍙锋槸鍚﹀湪鍙厑璁歌寖鍥村唴
-     */
-    private boolean checkSerial(String expectedSerial,String serverSerial){
-        if(!Cools.isEmpty(expectedSerial)){
-            if(!Cools.isEmpty(serverSerial)){
-                if(expectedSerial.equals(serverSerial)){
-                    return true;
-                }
-            }
-            return false;
-        }else{
-            return true;
-        }
-    }
-
+package com.zy.asrs.wms.system.license.entity.license;
+
+import com.alibaba.fastjson.JSON;
+import com.zy.asrs.framework.common.Cools;
+import de.schlichtherle.license.*;
+import de.schlichtherle.xml.GenericCertificate;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.beans.XMLDecoder;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 鑷畾涔塋icenseManager锛岀敤浜庡鍔犻澶栫殑鏈嶅姟鍣ㄧ‖浠朵俊鎭牎楠�
+ */
+public class CustomLicenseManager extends LicenseManager{
+    private static Logger logger = LogManager.getLogger(CustomLicenseManager.class);
+
+    //XML缂栫爜
+    private static final String XML_CHARSET = "UTF-8";
+    //榛樿BUFSIZE
+    private static final int DEFAULT_BUFSIZE = 8 * 1024;
+
+    public CustomLicenseManager() {
+
+    }
+
+    public CustomLicenseManager(LicenseParam param) {
+        super(param);
+    }
+
+    /**
+     * 澶嶅啓create鏂规硶
+     */
+    @Override
+    protected synchronized byte[] create(
+            LicenseContent content,
+            LicenseNotary notary)
+            throws Exception {
+        initialize(content);
+        this.validateCreate(content);
+        final GenericCertificate certificate = notary.sign(content);
+        return getPrivacyGuard().cert2key(certificate);
+    }
+
+    /**
+     * 澶嶅啓install鏂规硶锛屽叾涓璿alidate鏂规硶璋冪敤鏈被涓殑validate鏂规硶锛屾牎楠孖P鍦板潃銆丮ac鍦板潃绛夊叾浠栦俊鎭�
+     */
+    @Override
+    protected synchronized LicenseContent install(
+            final byte[] key,
+            final LicenseNotary notary)
+            throws Exception {
+        final GenericCertificate certificate = getPrivacyGuard().key2cert(key);
+
+        notary.verify(certificate);
+        final LicenseContent content = (LicenseContent)this.load(certificate.getEncoded());
+        this.validate(content);
+        setLicenseKey(key);
+        setCertificate(certificate);
+
+        return content;
+    }
+
+    /**
+     * 澶嶅啓verify鏂规硶锛岃皟鐢ㄦ湰绫讳腑鐨剉alidate鏂规硶锛屾牎楠孖P鍦板潃銆丮ac鍦板潃绛夊叾浠栦俊鎭�
+     */
+    @Override
+    protected synchronized LicenseContent verify(final LicenseNotary notary)
+            throws Exception {
+        GenericCertificate certificate = getCertificate();
+
+        // Load license key from preferences,
+        final byte[] key = getLicenseKey();
+        if (null == key){
+            throw new NoLicenseInstalledException(getLicenseParam().getSubject());
+        }
+
+        certificate = getPrivacyGuard().key2cert(key);
+        notary.verify(certificate);
+        final LicenseContent content = (LicenseContent)this.load(certificate.getEncoded());
+        this.validate(content);
+        setCertificate(certificate);
+
+        return content;
+    }
+
+    /**
+     * 鏍¢獙鐢熸垚璇佷功鐨勫弬鏁颁俊鎭�
+     */
+    protected synchronized void validateCreate(final LicenseContent content)
+            throws LicenseContentException {
+        final LicenseParam param = getLicenseParam();
+
+        final Date now = new Date();
+        final Date notBefore = content.getNotBefore();
+        final Date notAfter = content.getNotAfter();
+        if (null != notAfter && now.after(notAfter)){
+            throw new LicenseContentException("璇佷功澶辨晥鏃堕棿涓嶈兘鏃╀簬褰撳墠鏃堕棿");
+        }
+        if (null != notBefore && null != notAfter && notAfter.before(notBefore)){
+            throw new LicenseContentException("璇佷功鐢熸晥鏃堕棿涓嶈兘鏅氫簬璇佷功澶辨晥鏃堕棿");
+        }
+        final String consumerType = content.getConsumerType();
+        if (null == consumerType){
+            throw new LicenseContentException("鐢ㄦ埛绫诲瀷涓嶈兘涓虹┖");
+        }
+    }
+
+
+    /**
+     * 澶嶅啓validate鏂规硶锛屽鍔營P鍦板潃銆丮ac鍦板潃绛夊叾浠栦俊鎭牎楠�
+     */
+    @Override
+    protected synchronized void validate(final LicenseContent content)
+            throws LicenseContentException {
+        //1. 棣栧厛璋冪敤鐖剁被鐨剉alidate鏂规硶
+        super.validate(content);
+
+        //2. 鐒跺悗鏍¢獙鑷畾涔夌殑License鍙傛暟
+        //License涓彲琚厑璁哥殑鍙傛暟淇℃伅
+//        LicenseCheck expectedCheckModel = (LicenseCheck) content.getExtra();
+        LicenseCheck expectedCheckModel = JSON.parseObject(content.getExtra().toString(), LicenseCheck.class);
+        //褰撳墠鏈嶅姟鍣ㄧ湡瀹炵殑鍙傛暟淇℃伅
+        LicenseCheck serverCheckModel = getServerInfos();
+
+        if(expectedCheckModel != null && serverCheckModel != null){
+            //鏍¢獙IP鍦板潃
+            if(!checkIpAddress(expectedCheckModel.getIpAddress(),serverCheckModel.getIpAddress())){
+                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑IP娌″湪鎺堟潈鑼冨洿鍐�");
+            }
+
+            //鏍¢獙Mac鍦板潃
+            if(!checkIpAddress(expectedCheckModel.getMacAddress(),serverCheckModel.getMacAddress())){
+                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑Mac鍦板潃娌″湪鎺堟潈鑼冨洿鍐�");
+            }
+
+            //鏍¢獙涓绘澘搴忓垪鍙�
+            if(!checkSerial(expectedCheckModel.getMainBoardSerial(),serverCheckModel.getMainBoardSerial())){
+                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑涓绘澘搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴");
+            }
+
+            //鏍¢獙CPU搴忓垪鍙�
+            if(!checkSerial(expectedCheckModel.getCpuSerial(),serverCheckModel.getCpuSerial())){
+                throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑CPU搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴");
+            }
+        }else{
+            throw new LicenseContentException("涓嶈兘鑾峰彇鏈嶅姟鍣ㄧ‖浠朵俊鎭�");
+        }
+    }
+
+
+    /**
+     * 閲嶅啓XMLDecoder瑙f瀽XML
+     */
+    private Object load(String encoded){
+        BufferedInputStream inputStream = null;
+        XMLDecoder decoder = null;
+        try {
+            inputStream = new BufferedInputStream(new ByteArrayInputStream(encoded.getBytes(XML_CHARSET)));
+
+            decoder = new XMLDecoder(new BufferedInputStream(inputStream, DEFAULT_BUFSIZE),null,null);
+
+            return decoder.readObject();
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if(decoder != null){
+                    decoder.close();
+                }
+                if(inputStream != null){
+                    inputStream.close();
+                }
+            } catch (Exception e) {
+                logger.error("XMLDecoder瑙f瀽XML澶辫触",e);
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 鑾峰彇褰撳墠鏈嶅姟鍣ㄩ渶瑕侀澶栨牎楠岀殑License鍙傛暟
+     */
+    private LicenseCheck getServerInfos(){
+        //鎿嶄綔绯荤粺绫诲瀷
+        String osName = System.getProperty("os.name").toLowerCase();
+        AbstractServerInfos abstractServerInfos = null;
+
+        //鏍规嵁涓嶅悓鎿嶄綔绯荤粺绫诲瀷閫夋嫨涓嶅悓鐨勬暟鎹幏鍙栨柟娉�
+        if (osName.startsWith("windows")) {
+            abstractServerInfos = new WindowsServerInfos();
+        } else if (osName.startsWith("linux")) {
+            abstractServerInfos = new LinuxServerInfos();
+        }else{//鍏朵粬鏈嶅姟鍣ㄧ被鍨�
+            abstractServerInfos = new WindowsServerInfos();
+        }
+
+        return abstractServerInfos.getServerInfos();
+    }
+
+    /**
+     * 鏍¢獙褰撳墠鏈嶅姟鍣ㄧ殑IP/Mac鍦板潃鏄惁鍦ㄥ彲琚厑璁哥殑IP鑼冨洿鍐�<br/>
+     * 濡傛灉瀛樺湪IP鍦ㄥ彲琚厑璁哥殑IP/Mac鍦板潃鑼冨洿鍐咃紝鍒欒繑鍥瀟rue
+     */
+    private boolean checkIpAddress(List<String> expectedList,List<String> serverList){
+        if(expectedList != null && expectedList.size() > 0){
+            if(serverList != null && serverList.size() > 0){
+                for(String expected : expectedList){
+                    if(serverList.contains(expected.trim())){
+                        return true;
+                    }
+                }
+            }
+
+            return false;
+        }else {
+            return true;
+        }
+    }
+
+    /**
+     * 鏍¢獙褰撳墠鏈嶅姟鍣ㄧ‖浠讹紙涓绘澘銆丆PU绛夛級搴忓垪鍙锋槸鍚﹀湪鍙厑璁歌寖鍥村唴
+     */
+    private boolean checkSerial(String expectedSerial,String serverSerial){
+        if(!Cools.isEmpty(expectedSerial)){
+            if(!Cools.isEmpty(serverSerial)){
+                if(expectedSerial.equals(serverSerial)){
+                    return true;
+                }
+            }
+            return false;
+        }else{
+            return true;
+        }
+    }
+
 }
\ No newline at end of file

--
Gitblit v1.9.1