From 83b51a5a0774ea8ecb9a06304af3b956a21307c8 Mon Sep 17 00:00:00 2001 From: pjb <123456> Date: 星期六, 08 三月 2025 09:06:55 +0800 Subject: [PATCH] CUT库条码T开头,截取后10位 --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/LinuxServerInfos.java | 92 +++++++++++++++++++++++----------------------- 1 files changed, 46 insertions(+), 46 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/LinuxServerInfos.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/LinuxServerInfos.java index 4959be1..172033a 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/LinuxServerInfos.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/license/entity/license/LinuxServerInfos.java @@ -1,47 +1,47 @@ -package com.zy.asrs.wms.system.license.entity.license; - -import java.net.InetAddress; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 鐢ㄤ簬鑾峰彇瀹㈡埛Windows鏈嶅姟鍣ㄧ殑鍩烘湰淇℃伅 - */ -public class LinuxServerInfos extends AbstractServerInfos { - - @Override - protected List<String> getIpAddress() throws Exception { - List<String> result = null; - //鑾峰彇鎵�鏈夌綉缁滄帴鍙� - List<InetAddress> inetAddresses = getLocalAllInetAddress(); - if(inetAddresses != null && inetAddresses.size() > 0){ - result = inetAddresses.stream().map(InetAddress::getHostAddress).distinct().map(String::toLowerCase).collect(Collectors.toList()); - } - return result; - } - - @Override - protected List<String> getMacAddress() throws Exception { - List<String> result = null; - - //1. 鑾峰彇鎵�鏈夌綉缁滄帴鍙� - List<InetAddress> inetAddresses = getLocalAllInetAddress(); - - if (inetAddresses != null && inetAddresses.size() > 0) { - //2. 鑾峰彇鎵�鏈夌綉缁滄帴鍙g殑Mac鍦板潃 - result = inetAddresses.stream().map(this::getMacByInetAddress).distinct().collect(Collectors.toList()); - } - - return result; - } - - @Override - protected String getCPUSerial() throws Exception { - return SerialNumberUtil.getSerialNumber("dmidecode -t processor | grep 'ID'", "ID", ":"); - } - - @Override - protected String getMainBoardSerial() throws Exception { - return SerialNumberUtil.getSerialNumber("dmidecode |grep 'Serial Number'", "Serial Number", ":"); - } +package com.zy.asrs.wms.system.license.entity.license; + +import java.net.InetAddress; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 鐢ㄤ簬鑾峰彇瀹㈡埛Windows鏈嶅姟鍣ㄧ殑鍩烘湰淇℃伅 + */ +public class LinuxServerInfos extends AbstractServerInfos { + + @Override + protected List<String> getIpAddress() throws Exception { + List<String> result = null; + //鑾峰彇鎵�鏈夌綉缁滄帴鍙� + List<InetAddress> inetAddresses = getLocalAllInetAddress(); + if(inetAddresses != null && inetAddresses.size() > 0){ + result = inetAddresses.stream().map(InetAddress::getHostAddress).distinct().map(String::toLowerCase).collect(Collectors.toList()); + } + return result; + } + + @Override + protected List<String> getMacAddress() throws Exception { + List<String> result = null; + + //1. 鑾峰彇鎵�鏈夌綉缁滄帴鍙� + List<InetAddress> inetAddresses = getLocalAllInetAddress(); + + if (inetAddresses != null && inetAddresses.size() > 0) { + //2. 鑾峰彇鎵�鏈夌綉缁滄帴鍙g殑Mac鍦板潃 + result = inetAddresses.stream().map(this::getMacByInetAddress).distinct().collect(Collectors.toList()); + } + + return result; + } + + @Override + protected String getCPUSerial() throws Exception { + return SerialNumberUtil.getSerialNumber("dmidecode -t processor | grep 'ID'", "ID", ":"); + } + + @Override + protected String getMainBoardSerial() throws Exception { + return SerialNumberUtil.getSerialNumber("dmidecode |grep 'Serial Number'", "Serial Number", ":"); + } } \ No newline at end of file -- Gitblit v1.9.1