From 5413346a9ebdfc4ea884c2b63f6e36ec5e7acc18 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 18 Jul 2025 16:18:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0PDA=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebService/AppWebservice.asmx.cs | 16 ++++++++++------ WebService/Function.cs | 9 +++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs index 3517e03..3140d81 100644 --- a/WebService/AppWebservice.asmx.cs +++ b/WebService/AppWebservice.asmx.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Data; using System.Reflection; +using System.Runtime.Remoting.Contexts; +using System.Text; using System.Web.Script.Services; using System.Web.Services; using Tools; @@ -47,6 +49,7 @@ namespace Webservice model.DataList = null; LogHelper.WriteSysLogBase("箱码与总成码关系绑定,入参boxCode=" + boxCode + ",barCode=" + barCode, MethodBase.GetCurrentMethod().Name); + Context.Response.ContentType = "application/json; charset=utf-8"; #region 参数判断 //if (string.IsNullOrWhiteSpace(app_id)) @@ -55,12 +58,12 @@ namespace Webservice // Context.Response.Write(JSONTools.ScriptSerialize>(model)); // return; //} - //if (string.IsNullOrWhiteSpace(boxCode)) - //{ - // model.ErrReason = "缺少必要传入参数 boxCode"; - // Context.Response.Write(JSONTools.ScriptSerialize>(model)); - // return; - //} + if (string.IsNullOrWhiteSpace(boxCode)) + { + model.ErrReason = "缺少必要传入参数 boxCode"; + Context.Response.Write(JSONTools.ScriptSerialize>(model)); + return; + } //if (string.IsNullOrWhiteSpace(barCode)) //{ // model.ErrReason = "缺少必要传入参数 barCode"; @@ -133,6 +136,7 @@ namespace Webservice } } + Context.Response.Write(JSONTools.ScriptSerialize>(model)); } diff --git a/WebService/Function.cs b/WebService/Function.cs index d035741..1baa7cf 100644 --- a/WebService/Function.cs +++ b/WebService/Function.cs @@ -376,6 +376,15 @@ namespace Webservice } } + DataTable dtBoxNum = GetCodeRecords(boxCode, out errorReason); + if(dtBoxNum != null && dtBoxNum.Rows.Count.ToString() == qtyValue) + { + errorReason = "此箱码已满箱"; + return updateNum; + } + + + string sql = @" select top 1 * from tb_Punch_Code_Record where Flag=1 and ZcBarCode = '" + barCode + @"' order by CreateTime desc ";