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 ";