@ -65,9 +65,17 @@ namespace Webservice
Context . Response . Write ( JSONTools . ScriptSerialize < JsonModel < MKModel > > ( model ) ) ;
Context . Response . Write ( JSONTools . ScriptSerialize < JsonModel < MKModel > > ( model ) ) ;
return ;
return ;
}
}
//箱码格式验证
//小米箱码格式验证
//var boxCodeList = boxCode.Split(';');
//if (!boxCode.Contains("PN") || !boxCode.Contains("PKG") || !boxCode.Contains("QTY") || boxCodeList.Length != 7 || boxCodeList[0].Length != 16 || boxCodeList[1].Length != 12 || boxCodeList[5].Length != 16)
//{
// model.ErrReason = "箱码标签格式不对";
// Context.Response.Write(JSONTools.ScriptSerialize<JsonModel<MKModel>>(model));
// return;
//}
//Wms箱码格式验证
var boxCodeList = boxCode . Split ( ';' ) ;
var boxCodeList = boxCode . Split ( ';' ) ;
if ( ! boxCode . Contains ( "PN" ) | | ! boxCode . Contains ( "PKG" ) | | ! boxCode . Contains ( "QTY" ) | | boxCodeList . Length ! = 7 | | boxCodeList [ 0 ] . Length ! = 1 6 | | boxCodeList [ 1 ] . Length ! = 1 2 | | boxCodeList [ 5 ] . Length ! = 1 6 )
if ( ! boxCode . Contains ( ".0 " ) | | ! boxCode . Contains ( "/ " ) | | boxCodeList . Length ! = 7 | | boxCodeList [ 5 ] . Length ! = 1 0 )
{
{
model . ErrReason = "箱码标签格式不对" ;
model . ErrReason = "箱码标签格式不对" ;
Context . Response . Write ( JSONTools . ScriptSerialize < JsonModel < MKModel > > ( model ) ) ;
Context . Response . Write ( JSONTools . ScriptSerialize < JsonModel < MKModel > > ( model ) ) ;
@ -141,8 +149,9 @@ namespace Webservice
return ;
return ;
}
}
//箱码和总成码零件验证
//箱码和总成码零件号验证 分Wms箱码和小米箱码
string boxPartNo = boxCodeList [ 0 ] . Substring ( 3 , 1 0 ) ;
//string boxPartNo = boxCodeList[0].Substring(3,10);
string boxPartNo = boxCodeList [ 0 ] . Substring ( 0 , 1 0 ) ;
string barCodePartNo = barCodeList [ 0 ] . Substring ( 0 , 1 0 ) ;
string barCodePartNo = barCodeList [ 0 ] . Substring ( 0 , 1 0 ) ;
if ( boxPartNo ! = barCodePartNo )
if ( boxPartNo ! = barCodePartNo )
{
{
@ -192,19 +201,19 @@ namespace Webservice
else
else
{
{
model . Result = "1" ;
model . Result = "1" ;
string qtyValue = "0" ;
//string qtyValue = "0";
var boxCodeSplit = boxCode . Split ( ';' ) ;
//var boxCodeSplit = boxCode.Split(';');
foreach ( string part in boxCodeSplit )
//foreach (string part in boxCodeSplit)
{
//{
if ( part . StartsWith ( "QTY:" ) )
// if (part.StartsWith("QTY:"))
{
// {
qtyValue = part . Substring ( 4 ) ; // 从"QTY:"后的字符开始截取
// qtyValue = part.Substring(4); // 从"QTY:"后的字符开始截取
}
// }
}
//}
if ( listInfo . Count . ToString ( ) = = qtyValue )
//if (listInfo.Count.ToString() == qtyValue)
{
//{
}
//}
}
}
}
}
Context . Response . Write ( JSONTools . ScriptSerialize < JsonModel < MKModel > > ( model ) ) ;
Context . Response . Write ( JSONTools . ScriptSerialize < JsonModel < MKModel > > ( model ) ) ;