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/SerialNumberUtil.java |  526 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 263 insertions(+), 263 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/SerialNumberUtil.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/SerialNumberUtil.java
index f9bc951..afd0f47 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/SerialNumberUtil.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/SerialNumberUtil.java
@@ -1,263 +1,263 @@
-package com.zy.asrs.wms.system.license.entity.license;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-public class SerialNumberUtil {
-
-
-    /**
-     * 鑾峰彇涓绘澘搴忓垪鍙�
-     *
-     * @return
-     */
-    public static String getMotherboardSN() {
-        String result = "";
-        try {
-            File file = File.createTempFile("realhowto", ".vbs");
-            file.deleteOnExit();
-            FileWriter fw = new FileWriter(file);
-
-            String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" + "Set colItems = objWMIService.ExecQuery _ \n" + "   (\"Select * from Win32_BaseBoard\") \n" + "For Each objItem in colItems \n" + "    Wscript.Echo objItem.SerialNumber \n" + "    exit for  ' do the first cpu only! \n" + "Next \n";
-
-            fw.write(vbs);
-            fw.close();
-            String path = file.getPath().replace("%20", " ");
-            Process p = Runtime.getRuntime().exec("cscript //NoLogo " + path);
-            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
-            String line;
-            while ((line = input.readLine()) != null) {
-                result += line;
-            }
-            input.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result.trim();
-    }
-
-    /**
-     * 鑾峰彇纭洏搴忓垪鍙�(璇ユ柟娉曡幏鍙栫殑鏄� 鐩樼鐨勯�昏緫搴忓垪鍙�,骞朵笉鏄‖鐩樻湰韬殑搴忓垪鍙�)
-     * 纭洏搴忓垪鍙疯繕鍦ㄧ爺绌朵腑
-     *
-     * @param drive 鐩樼
-     * @return
-     */
-    public static String getHardDiskSN(String drive) {
-        String result = "";
-        try {
-            File file = File.createTempFile("realhowto", ".vbs");
-            file.deleteOnExit();
-            FileWriter fw = new FileWriter(file);
-
-            String vbs = "Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n" + "Set colDrives = objFSO.Drives\n" + "Set objDrive = colDrives.item(\"" + drive + "\")\n" + "Wscript.Echo objDrive.SerialNumber"; // see note
-            fw.write(vbs);
-            fw.close();
-            String path = file.getPath().replace("%20", " ");
-            Process p = Runtime.getRuntime().exec("cscript //NoLogo " + path);
-            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
-            String line;
-            while ((line = input.readLine()) != null) {
-                result += line;
-            }
-            input.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result.trim();
-    }
-
-    /**
-     * 鑾峰彇CPU搴忓垪鍙�
-     *
-     * @return
-     */
-    public static String getCPUSerial() {
-        String result = "";
-        try {
-            File file = File.createTempFile("tmp", ".vbs");
-            file.deleteOnExit();
-            FileWriter fw = new FileWriter(file);
-            String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" + "Set colItems = objWMIService.ExecQuery _ \n" + "   (\"Select * from Win32_Processor\") \n" + "For Each objItem in colItems \n" + "    Wscript.Echo objItem.ProcessorId \n" + "    exit for  ' do the first cpu only! \n" + "Next \n";
-
-            // + "    exit for  \r\n" + "Next";
-            fw.write(vbs);
-            fw.close();
-            String path = file.getPath().replace("%20", " ");
-            Process p = Runtime.getRuntime().exec("cscript //NoLogo " + path);
-            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
-            String line;
-            while ((line = input.readLine()) != null) {
-                result += line;
-            }
-            input.close();
-            file.delete();
-        } catch (Exception e) {
-            e.fillInStackTrace();
-        }
-        if (result.trim().length() < 1 || result == null) {
-            result = "鏃燙PU_ID琚鍙�";
-        }
-        return result.trim();
-    }
-
-    private static List<String> getLocalHostLANAddress() throws UnknownHostException, SocketException {
-        List<String> ips = new ArrayList<String>();
-        Enumeration<NetworkInterface> interfs = NetworkInterface.getNetworkInterfaces();
-        while (interfs.hasMoreElements()) {
-            NetworkInterface interf = interfs.nextElement();
-            Enumeration<InetAddress> addres = interf.getInetAddresses();
-            while (addres.hasMoreElements()) {
-                InetAddress in = addres.nextElement();
-                if (in instanceof Inet4Address) {
-                    System.out.println("v4:" + in.getHostAddress());
-                    if (!"127.0.0.1".equals(in.getHostAddress())) {
-                        ips.add(in.getHostAddress());
-                    }
-                }
-            }
-        }
-        return ips;
-    }
-
-    /**
-     * MAC
-     * 閫氳繃jdk鑷甫鐨勬柟娉�,鍏堣幏鍙栨湰鏈烘墍鏈夌殑ip,鐒跺悗閫氳繃NetworkInterface鑾峰彇mac鍦板潃
-     *
-     * @return
-     */
-    public static String getMac() {
-        try {
-            String resultStr = "";
-            List<String> ls = getLocalHostLANAddress();
-            for (String str : ls) {
-                InetAddress ia = InetAddress.getByName(str);// 鑾峰彇鏈湴IP瀵硅薄
-                // 鑾峰緱缃戠粶鎺ュ彛瀵硅薄锛堝嵆缃戝崱锛夛紝骞跺緱鍒癿ac鍦板潃锛宮ac鍦板潃瀛樺湪浜庝竴涓猙yte鏁扮粍涓��
-                byte[] mac = NetworkInterface.getByInetAddress(ia).getHardwareAddress();
-                // 涓嬮潰浠g爜鏄妸mac鍦板潃鎷艰鎴怱tring
-                StringBuilder sb = new StringBuilder();
-                for (int i = 0; i < mac.length; i++) {
-                    if (i != 0) {
-                        sb.append("-");
-                    }
-                    // mac[i] & 0xFF 鏄负浜嗘妸byte杞寲涓烘鏁存暟
-                    String s = Integer.toHexString(mac[i] & 0xFF);
-                    sb.append(s.length() == 1 ? 0 + s : s);
-                }
-                // 鎶婂瓧绗︿覆鎵�鏈夊皬鍐欏瓧姣嶆敼涓哄ぇ鍐欐垚涓烘瑙勭殑mac鍦板潃骞惰繑鍥�
-                resultStr += sb.toString().toUpperCase() + ",";
-            }
-            return resultStr;
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-        return null;
-    }
-
-    /***************************linux*********************************/
-
-    public static String executeLinuxCmd(String cmd) {
-        try {
-            //System.out.println("got cmd job : " + cmd);
-            Runtime run = Runtime.getRuntime();
-            Process process;
-            process = run.exec(cmd);
-            InputStream in = process.getInputStream();
-            BufferedReader bs = new BufferedReader(new InputStreamReader(in));
-            StringBuffer out = new StringBuffer();
-            byte[] b = new byte[8192];
-            for (int n; (n = in.read(b)) != -1; ) {
-                out.append(new String(b, 0, n));
-            }
-            in.close();
-            process.destroy();
-            return out.toString();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    /**
-     * @param cmd    鍛戒护璇彞
-     * @param record 瑕佹煡鐪嬬殑瀛楁
-     * @param symbol 鍒嗛殧绗�
-     * @return
-     */
-    public static String getSerialNumber(String cmd, String record, String symbol) {
-        String execResult = executeLinuxCmd(cmd);
-        String[] infos = execResult.split("\n");
-
-        for (String info : infos) {
-            info = info.trim();
-            if (info.indexOf(record) != -1) {
-                info.replace(" ", "");
-                String[] sn = info.split(symbol);
-                return sn[1];
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * 鑾峰彇CPUID銆佺‖鐩樺簭鍒楀彿銆丮AC鍦板潃銆佷富鏉垮簭鍒楀彿
-     *
-     * @return
-     */
-    public static Map<String, String> getAllSn() {
-        String os = System.getProperty("os.name");
-        os = os.toUpperCase();
-        System.out.println(os);
-
-        Map<String, String> snVo = new HashMap<String, String>();
-
-        if (os.contains("LINUX")) {
-            System.out.println("=============>for linux");
-            String cpuid = getSerialNumber("dmidecode -t processor | grep 'ID'", "ID", ":");
-            System.out.println("cpuid : " + cpuid);
-            String mainboardNumber = getSerialNumber("dmidecode |grep 'Serial Number'", "Serial Number", ":");
-            System.out.println("mainboardNumber : " + mainboardNumber);
-            String diskNumber = getSerialNumber("fdisk -l", "Disk identifier", ":");
-            System.out.println("diskNumber : " + diskNumber);
-            String mac = getSerialNumber("ifconfig -a", "ether", " ");
-
-            snVo.put("cpuid", cpuid.toUpperCase().replace(" ", ""));
-            snVo.put("diskid", diskNumber.toUpperCase().replace(" ", ""));
-            snVo.put("mac", mac.toUpperCase().replace(" ", ""));
-            snVo.put("mainboard", mainboardNumber.toUpperCase().replace(" ", ""));
-        } else {
-            System.out.println("=============>for windows");
-            String cpuid = SerialNumberUtil.getCPUSerial();
-            String mainboard = SerialNumberUtil.getMotherboardSN();
-            String disk = SerialNumberUtil.getHardDiskSN("c");
-            String mac = SerialNumberUtil.getMac();
-
-            System.out.println("CPU  SN:" + cpuid);
-            System.out.println("涓绘澘  SN:" + mainboard);
-            System.out.println("C鐩�   SN:" + disk);
-            System.out.println("MAC  SN:" + mac);
-
-            snVo.put("cpuid", cpuid.toUpperCase().replace(" ", ""));
-            snVo.put("diskid", disk.toUpperCase().replace(" ", ""));
-            snVo.put("mac", mac.toUpperCase().replace(" ", ""));
-            snVo.put("mainboard", mainboard.toUpperCase().replace(" ", ""));
-        }
-
-        return snVo;
-    }
-
-    /**
-     * linux
-     * cpuid : dmidecode -t processor | grep 'ID'
-     * mainboard : dmidecode |grep 'Serial Number'
-     * disk : fdisk -l
-     * mac : ifconfig -a
-     *
-     * @param args
-     */
-    public static void main(String[] args) {
-        getAllSn();
-    }
-}
+package com.zy.asrs.wms.system.license.entity.license;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+public class SerialNumberUtil {
+
+
+    /**
+     * 鑾峰彇涓绘澘搴忓垪鍙�
+     *
+     * @return
+     */
+    public static String getMotherboardSN() {
+        String result = "";
+        try {
+            File file = File.createTempFile("realhowto", ".vbs");
+            file.deleteOnExit();
+            FileWriter fw = new FileWriter(file);
+
+            String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" + "Set colItems = objWMIService.ExecQuery _ \n" + "   (\"Select * from Win32_BaseBoard\") \n" + "For Each objItem in colItems \n" + "    Wscript.Echo objItem.SerialNumber \n" + "    exit for  ' do the first cpu only! \n" + "Next \n";
+
+            fw.write(vbs);
+            fw.close();
+            String path = file.getPath().replace("%20", " ");
+            Process p = Runtime.getRuntime().exec("cscript //NoLogo " + path);
+            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            String line;
+            while ((line = input.readLine()) != null) {
+                result += line;
+            }
+            input.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result.trim();
+    }
+
+    /**
+     * 鑾峰彇纭洏搴忓垪鍙�(璇ユ柟娉曡幏鍙栫殑鏄� 鐩樼鐨勯�昏緫搴忓垪鍙�,骞朵笉鏄‖鐩樻湰韬殑搴忓垪鍙�)
+     * 纭洏搴忓垪鍙疯繕鍦ㄧ爺绌朵腑
+     *
+     * @param drive 鐩樼
+     * @return
+     */
+    public static String getHardDiskSN(String drive) {
+        String result = "";
+        try {
+            File file = File.createTempFile("realhowto", ".vbs");
+            file.deleteOnExit();
+            FileWriter fw = new FileWriter(file);
+
+            String vbs = "Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n" + "Set colDrives = objFSO.Drives\n" + "Set objDrive = colDrives.item(\"" + drive + "\")\n" + "Wscript.Echo objDrive.SerialNumber"; // see note
+            fw.write(vbs);
+            fw.close();
+            String path = file.getPath().replace("%20", " ");
+            Process p = Runtime.getRuntime().exec("cscript //NoLogo " + path);
+            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            String line;
+            while ((line = input.readLine()) != null) {
+                result += line;
+            }
+            input.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result.trim();
+    }
+
+    /**
+     * 鑾峰彇CPU搴忓垪鍙�
+     *
+     * @return
+     */
+    public static String getCPUSerial() {
+        String result = "";
+        try {
+            File file = File.createTempFile("tmp", ".vbs");
+            file.deleteOnExit();
+            FileWriter fw = new FileWriter(file);
+            String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" + "Set colItems = objWMIService.ExecQuery _ \n" + "   (\"Select * from Win32_Processor\") \n" + "For Each objItem in colItems \n" + "    Wscript.Echo objItem.ProcessorId \n" + "    exit for  ' do the first cpu only! \n" + "Next \n";
+
+            // + "    exit for  \r\n" + "Next";
+            fw.write(vbs);
+            fw.close();
+            String path = file.getPath().replace("%20", " ");
+            Process p = Runtime.getRuntime().exec("cscript //NoLogo " + path);
+            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            String line;
+            while ((line = input.readLine()) != null) {
+                result += line;
+            }
+            input.close();
+            file.delete();
+        } catch (Exception e) {
+            e.fillInStackTrace();
+        }
+        if (result.trim().length() < 1 || result == null) {
+            result = "鏃燙PU_ID琚鍙�";
+        }
+        return result.trim();
+    }
+
+    private static List<String> getLocalHostLANAddress() throws UnknownHostException, SocketException {
+        List<String> ips = new ArrayList<String>();
+        Enumeration<NetworkInterface> interfs = NetworkInterface.getNetworkInterfaces();
+        while (interfs.hasMoreElements()) {
+            NetworkInterface interf = interfs.nextElement();
+            Enumeration<InetAddress> addres = interf.getInetAddresses();
+            while (addres.hasMoreElements()) {
+                InetAddress in = addres.nextElement();
+                if (in instanceof Inet4Address) {
+                    System.out.println("v4:" + in.getHostAddress());
+                    if (!"127.0.0.1".equals(in.getHostAddress())) {
+                        ips.add(in.getHostAddress());
+                    }
+                }
+            }
+        }
+        return ips;
+    }
+
+    /**
+     * MAC
+     * 閫氳繃jdk鑷甫鐨勬柟娉�,鍏堣幏鍙栨湰鏈烘墍鏈夌殑ip,鐒跺悗閫氳繃NetworkInterface鑾峰彇mac鍦板潃
+     *
+     * @return
+     */
+    public static String getMac() {
+        try {
+            String resultStr = "";
+            List<String> ls = getLocalHostLANAddress();
+            for (String str : ls) {
+                InetAddress ia = InetAddress.getByName(str);// 鑾峰彇鏈湴IP瀵硅薄
+                // 鑾峰緱缃戠粶鎺ュ彛瀵硅薄锛堝嵆缃戝崱锛夛紝骞跺緱鍒癿ac鍦板潃锛宮ac鍦板潃瀛樺湪浜庝竴涓猙yte鏁扮粍涓��
+                byte[] mac = NetworkInterface.getByInetAddress(ia).getHardwareAddress();
+                // 涓嬮潰浠g爜鏄妸mac鍦板潃鎷艰鎴怱tring
+                StringBuilder sb = new StringBuilder();
+                for (int i = 0; i < mac.length; i++) {
+                    if (i != 0) {
+                        sb.append("-");
+                    }
+                    // mac[i] & 0xFF 鏄负浜嗘妸byte杞寲涓烘鏁存暟
+                    String s = Integer.toHexString(mac[i] & 0xFF);
+                    sb.append(s.length() == 1 ? 0 + s : s);
+                }
+                // 鎶婂瓧绗︿覆鎵�鏈夊皬鍐欏瓧姣嶆敼涓哄ぇ鍐欐垚涓烘瑙勭殑mac鍦板潃骞惰繑鍥�
+                resultStr += sb.toString().toUpperCase() + ",";
+            }
+            return resultStr;
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return null;
+    }
+
+    /***************************linux*********************************/
+
+    public static String executeLinuxCmd(String cmd) {
+        try {
+            //System.out.println("got cmd job : " + cmd);
+            Runtime run = Runtime.getRuntime();
+            Process process;
+            process = run.exec(cmd);
+            InputStream in = process.getInputStream();
+            BufferedReader bs = new BufferedReader(new InputStreamReader(in));
+            StringBuffer out = new StringBuffer();
+            byte[] b = new byte[8192];
+            for (int n; (n = in.read(b)) != -1; ) {
+                out.append(new String(b, 0, n));
+            }
+            in.close();
+            process.destroy();
+            return out.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * @param cmd    鍛戒护璇彞
+     * @param record 瑕佹煡鐪嬬殑瀛楁
+     * @param symbol 鍒嗛殧绗�
+     * @return
+     */
+    public static String getSerialNumber(String cmd, String record, String symbol) {
+        String execResult = executeLinuxCmd(cmd);
+        String[] infos = execResult.split("\n");
+
+        for (String info : infos) {
+            info = info.trim();
+            if (info.indexOf(record) != -1) {
+                info.replace(" ", "");
+                String[] sn = info.split(symbol);
+                return sn[1];
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 鑾峰彇CPUID銆佺‖鐩樺簭鍒楀彿銆丮AC鍦板潃銆佷富鏉垮簭鍒楀彿
+     *
+     * @return
+     */
+    public static Map<String, String> getAllSn() {
+        String os = System.getProperty("os.name");
+        os = os.toUpperCase();
+        System.out.println(os);
+
+        Map<String, String> snVo = new HashMap<String, String>();
+
+        if (os.contains("LINUX")) {
+            System.out.println("=============>for linux");
+            String cpuid = getSerialNumber("dmidecode -t processor | grep 'ID'", "ID", ":");
+            System.out.println("cpuid : " + cpuid);
+            String mainboardNumber = getSerialNumber("dmidecode |grep 'Serial Number'", "Serial Number", ":");
+            System.out.println("mainboardNumber : " + mainboardNumber);
+            String diskNumber = getSerialNumber("fdisk -l", "Disk identifier", ":");
+            System.out.println("diskNumber : " + diskNumber);
+            String mac = getSerialNumber("ifconfig -a", "ether", " ");
+
+            snVo.put("cpuid", cpuid.toUpperCase().replace(" ", ""));
+            snVo.put("diskid", diskNumber.toUpperCase().replace(" ", ""));
+            snVo.put("mac", mac.toUpperCase().replace(" ", ""));
+            snVo.put("mainboard", mainboardNumber.toUpperCase().replace(" ", ""));
+        } else {
+            System.out.println("=============>for windows");
+            String cpuid = SerialNumberUtil.getCPUSerial();
+            String mainboard = SerialNumberUtil.getMotherboardSN();
+            String disk = SerialNumberUtil.getHardDiskSN("c");
+            String mac = SerialNumberUtil.getMac();
+
+            System.out.println("CPU  SN:" + cpuid);
+            System.out.println("涓绘澘  SN:" + mainboard);
+            System.out.println("C鐩�   SN:" + disk);
+            System.out.println("MAC  SN:" + mac);
+
+            snVo.put("cpuid", cpuid.toUpperCase().replace(" ", ""));
+            snVo.put("diskid", disk.toUpperCase().replace(" ", ""));
+            snVo.put("mac", mac.toUpperCase().replace(" ", ""));
+            snVo.put("mainboard", mainboard.toUpperCase().replace(" ", ""));
+        }
+
+        return snVo;
+    }
+
+    /**
+     * linux
+     * cpuid : dmidecode -t processor | grep 'ID'
+     * mainboard : dmidecode |grep 'Serial Number'
+     * disk : fdisk -l
+     * mac : ifconfig -a
+     *
+     * @param args
+     */
+    public static void main(String[] args) {
+        getAllSn();
+    }
+}

--
Gitblit v1.9.1