From 97ec72a7003d0c4100bff97bcb35bab64f80b436 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 11 Aug 2025 16:01:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AE=B1=E7=A0=81=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebService/AppWebservice.asmx.cs | 44 ++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs index bf7b04b..2a696a5 100644 --- a/WebService/AppWebservice.asmx.cs +++ b/WebService/AppWebservice.asmx.cs @@ -255,24 +255,27 @@ namespace Webservice return; } - if (string.IsNullOrWhiteSpace(changeBoxCode)) - { - model.ErrReason = "缺少必要传入参数 changeBoxCode"; - Context.Response.Write(JSONTools.ScriptSerialize>(model)); - return; - } + //if (string.IsNullOrWhiteSpace(changeBoxCode)) + //{ + // model.ErrReason = "缺少必要传入参数 changeBoxCode"; + // Context.Response.Write(JSONTools.ScriptSerialize>(model)); + // return; + //} var boxCodeList = boxCode.Split(';'); var changeBoxCodeList = changeBoxCode.Split(';'); //小米箱码格式验证 - if (!changeBoxCode.Contains("PN") || !changeBoxCode.Contains("PKG") || !changeBoxCode.Contains("QTY") || changeBoxCodeList.Length != 7 || changeBoxCodeList[0].Length != 16 || changeBoxCodeList[1].Length != 12 || changeBoxCodeList[5].Length != 16) + if(!string.IsNullOrWhiteSpace(changeBoxCode)) { - model.ErrReason = "小米箱码标签格式不对"; - Context.Response.Write(JSONTools.ScriptSerialize>(model)); - return; - } + if (!changeBoxCode.Contains("PN") || !changeBoxCode.Contains("PKG") || !changeBoxCode.Contains("QTY") || changeBoxCodeList.Length != 7 || changeBoxCodeList[0].Length != 16 || changeBoxCodeList[1].Length != 12 || changeBoxCodeList[5].Length != 16) + { + model.ErrReason = "小米箱码标签格式不对"; + Context.Response.Write(JSONTools.ScriptSerialize>(model)); + return; + } + } //Wms箱码格式验证 if (!boxCode.Contains(".0") || !boxCode.Contains("/") || boxCodeList.Length != 7 || boxCodeList[5].Length != 10) @@ -283,15 +286,18 @@ namespace Webservice } string boxPartNo = boxCodeList[0].Substring(0, 10); - string changeBoxPartNo = changeBoxCodeList[0].Substring(3,10); - //Wms箱码和小米箱码零件号验证 - if (boxPartNo != changeBoxPartNo) + if(!string.IsNullOrEmpty(changeBoxCode)) { - model.Result = "0"; - model.ErrReason = "Wms箱码和小米箱码零件号不符"; - Context.Response.Write(JSONTools.ScriptSerialize>(model)); - return; - } + string changeBoxPartNo = changeBoxCodeList[0].Substring(3, 10); + //Wms箱码和小米箱码零件号验证 + if (boxPartNo != changeBoxPartNo) + { + model.Result = "0"; + model.ErrReason = "Wms箱码和小米箱码零件号不符"; + Context.Response.Write(JSONTools.ScriptSerialize>(model)); + return; + } + } List listInfo = new List(); string errorReasonBoxData = ""; DataTable dtBoxNum = Function.GetCodeRecords(boxCode, out errorReasonBoxData);