From ed4d2a10702e49c669f8a64e5508223dc5d4ab77 Mon Sep 17 00:00:00 2001 From: 杨张扬 <634643841@qq.com> Date: 星期四, 05 六月 2025 17:39:45 +0800 Subject: [PATCH] 修改还剩几天过期字段为字符串 --- wms/WMSHelper.cs | 45 ++++++++++++++++++++++++++++++++++++--------- 1 files changed, 36 insertions(+), 9 deletions(-) diff --git a/wms/WMSHelper.cs b/wms/WMSHelper.cs index 3fc5bde..a067039 100644 --- a/wms/WMSHelper.cs +++ b/wms/WMSHelper.cs @@ -1,15 +1,8 @@ -锘縰sing HH.WCS.Mobox3.DoubleCoin.api; -using HH.WCS.Mobox3.DoubleCoin.dispatch; +锘縰sing HH.WCS.Mobox3.DoubleCoin.dispatch; using HH.WCS.Mobox3.DoubleCoin.models; using HH.WCS.Mobox3.DoubleCoin.util; using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.Remoting.Messaging; using System.Text; -using System.Threading.Tasks; using static HH.WCS.Mobox3.DoubleCoin.api.ApiModel; namespace HH.WCS.Mobox3.DoubleCoin.wms @@ -89,7 +82,13 @@ } } - + /// <summary> + /// 鎻掑叆鎿嶄綔鍛樹俊鎭�+ /// </summary> + /// <param name="staff"></param> + /// <param name="type"></param> + /// <param name="cntrCode"></param> + /// <param name="qty"></param> public static void InsertOpInfo(string staff, string type , string cntrCode ="",int qty = 0) { try @@ -123,5 +122,33 @@ LogHelper.Error($"鎻掑叆鎿嶄綔鍛樹俊鎭紝鍙戠敓浜嗗紓甯革紝{ex.Message}",ex); } } + + /// <summary> + /// 灏�6杩涘埗瀛楃涓茶浆鎹负ASCII瀛楃涓�+ /// </summary> + /// <param name="hexString"></param> + /// <returns></returns> + public static string ConvertHexToAscii(string hexString) + { + LogHelper.Info($"灏�6杩涘埗瀛楃涓茶浆鎹负ASCII瀛楃涓诧紝杞崲鍓嶏細{hexString}"); + + // 楠岃瘉杈撳叆鏄惁涓�6浣�6杩涘埗瀛楃涓�+ if (hexString.Length != 16 || !System.Text.RegularExpressions.Regex.IsMatch(hexString, @"^[0-9A-Fa-f]+$")) + { + throw new ArgumentException("杈撳叆蹇呴』鏄�6浣嶇殑16杩涘埗瀛楃涓�); + } + + // 姣忎袱浣嶈浆鎹竴涓狝SCII瀛楃 + StringBuilder asciiString = new StringBuilder(); + for (int i = 0; i < 16; i += 2) + { + string hexPair = hexString.Substring(i, 2); + byte asciiChar = Convert.ToByte(hexPair, 16); + asciiString.Append((char)asciiChar); + } + + LogHelper.Info($"灏�6杩涘埗瀛楃涓茶浆鎹负ASCII瀛楃涓诧紝杞崲鍚庯細{asciiString.ToString()}"); + return asciiString.ToString(); + } } } -- Gitblit v1.9.1