From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期三, 09 七月 2025 22:55:27 +0800 Subject: [PATCH] 增加质检出入库逻辑 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" index ae82614..d9c8538 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json; +锘縰sing NetTaste; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; @@ -78,6 +79,10 @@ { int reval = 0; if (thisValue == null) return 0; + if (thisValue is Enum && thisValue != DBNull.Value && Enum.TryParse(thisValue.GetType(), thisValue.ToString(), out var val)) + { + return Convert.ToInt32(val.ChangeType(typeof(int))); + } if (thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval)) { return reval; @@ -126,7 +131,7 @@ return reval; } - + /// <summary> /// /// </summary> @@ -361,6 +366,14 @@ return JsonConvert.SerializeObject(value); } + public static bool IsNumeric(this object value) + { + if (value == null) + return false; + bool reslut = decimal.TryParse(value.ToString(), out decimal _number); + return reslut; + } + public static bool IsInt(this object obj) { if (obj == null) @@ -440,7 +453,7 @@ return Math.Round(ObjToDecimal(data), digits); } - + /// <summary> /// 鏋氫妇杞琇ist qy 2024-7-15 -- Gitblit v1.9.3