@ -611,6 +611,8 @@ namespace Webservice
}
}
private static readonly object _ obj = new object ( ) ;
private static string _ scanCode2 = string . Empty ;
public static string WMSSpraying ( string barcode , int isPass , string stcokNo , string partNo , string batchNo )
{
JsonModel < NoModel > model = new JsonModel < NoModel > ( ) ;
@ -619,9 +621,17 @@ namespace Webservice
model . ResultRowsCount = "0" ;
model . ErrReason = "" ;
model . DataList = null ;
string sql33 = "" ;
try
{
lock ( _ obj )
{
if ( _ scanCode2 = = barcode )
{
LogHelper . WriteLog ( "a扫码[" + barcode + "]重复了,连续两次扫码相同,第一次还未执行完成,进行第二次扫码." ) ;
}
_ scanCode2 = barcode ;
#region 目前全部存储一维码,将二维码转换为一维码
if ( barcode . Contains ( "." ) )
@ -664,7 +674,7 @@ namespace Webservice
#region 转换零件号
string lu_code = "" , colorCode = "" ;
string lu_code = "" , colorCode = "" ;
LogHelper . WriteSysLogBase ( "【转换零件号】:barcode:" + barcode , MethodBase . GetCurrentMethod ( ) . Name ) ;
@ -768,6 +778,7 @@ namespace Webservice
order by TimeStamp desc
";
string sqlConnString = ConfigurationManager . ConnectionStrings [ "SqlConnStringForeign" ] . ConnectionString ;
sql33 = sql_color ;
DataTable dtColor = SqlHelper . GetDataDateTable ( sqlConnString , CommandType . Text , sql_color , null ) ;
if ( dtColor ! = null & & dtColor . Rows . Count > 0 )
{
@ -775,6 +786,7 @@ namespace Webservice
if ( ! string . IsNullOrWhiteSpace ( color ) )
{
string sql_colorCode = @" SELECT ColorNo FROM tb_Color WHERE ColorCode = '" + color + @"' " ;
sql33 = sql_colorCode ;
DataTable dtColorCode = SqlHelper . GetDataDateTable ( SqlHelper . SqlConnString , CommandType . Text , sql_colorCode , null ) ;
if ( dtColorCode ! = null & & dtColorCode . Rows . Count > 0 )
{
@ -858,6 +870,7 @@ namespace Webservice
OR LTrim ( RTrim ( Side_2_BC12 ) ) = @barcode
";
string sqlConnString = ConfigurationManager . ConnectionStrings [ "SqlConnStringForeign" ] . ConnectionString ;
sql33 = sql_color ;
DataTable dtColor = SqlHelper . GetDataDateTable ( sqlConnString , CommandType . Text , sql_color , null ) ;
if ( dtColor ! = null & & dtColor . Rows . Count > 0 )
{
@ -867,6 +880,7 @@ namespace Webservice
if ( ! string . IsNullOrWhiteSpace ( bc_color ) )
{
string sql_colorCode = @" SELECT ColorNo FROM tb_Color WHERE ColorCode = '" + bc_color + @"' and ColorQQCode='" + cc_color + @"' and ColorDQCode='" + pr_color + @"'" ;
sql33 = sql_colorCode ;
DataTable dtColorCode = SqlHelper . GetDataDateTable ( SqlHelper . SqlConnString , CommandType . Text , sql_colorCode , null ) ;
if ( dtColorCode ! = null & & dtColorCode . Rows . Count > 0 )
{
@ -877,6 +891,7 @@ namespace Webservice
}
string sql = @"select PaintNo from tb_StockToPaintNo where StockNo='" + barcode . Substring ( 0 , 1 0 ) + @"' and PaintCode='" + colorCode + @"'" ;
sql33 = sql ;
DataTable dt = SqlHelper . GetDataDateTable ( SqlHelper . SqlConnString , CommandType . Text , sql , null ) ;
if ( dt ! = null & & dt . Rows . Count > 0 )
{
@ -935,7 +950,7 @@ namespace Webservice
// }
//}
LogHelper . WriteSysLogBase ( "【添加产线ID】barcode:" + barcode , MethodBase . GetCurrentMethod ( ) . Name ) ;
LogHelper . WriteSysLogBase ( "【添加产线ID】barcode:" + barcode , MethodBase . GetCurrentMethod ( ) . Name ) ;
string lineid = ConfigurationManager . AppSettings [ "LineID" ] . ToString ( ) . Trim ( ) ;
int lineId = 0 ;
@ -972,10 +987,10 @@ namespace Webservice
string jsonParam = " [{\"ServiceType\":\"AddMesData\",\"OperName\":\"ADMIN\"}]" ;
IsoDateTimeConverter timeConverter = new IsoDateTimeConverter ( ) ;
//这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式
timeConverter . DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss" ;
//timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd";
IsoDateTimeConverter timeConverter = new IsoDateTimeConverter ( ) ;
//这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式
timeConverter . DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss" ;
//timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd";
string strJson = "[25," + JsonConvert . SerializeObject ( list , Formatting . Indented , timeConverter ) + "]" ;
//string strJson = "[25," + JsonHelper.<List<WMS03Model>>(list) + "]";
@ -1024,16 +1039,30 @@ namespace Webservice
return JSONTools . ScriptSerialize < JsonModel < NoModel > > ( model ) ;
#endregion
}
}
catch ( Exception ex )
{
LogHelper . WriteLogManager ( ex ) ;
if ( ex . Message . Contains ( "syntax" ) )
{
LogHelper . WriteLog ( "查询语句错误,执行语句为:" + sql33 ) ;
}
LogHelper . WriteErrLogBase ( ex . ToString ( ) , MethodBase . GetCurrentMethod ( ) . Name ) ;
model . ErrReason = ex . Message ;
return JSONTools . ScriptSerialize < JsonModel < NoModel > > ( model ) ;
}
finally
{
_ scanCode2 = string . Empty ;
}
}
private static readonly object _ obj2 = new object ( ) ;
private static string _ scanCode = string . Empty ;
public static string WMSSprayingReturnNo ( string barcode , int isPass , string stcokNo , string partNo , string batchNo , string userName )
{
JsonModel < PartInfoModel > model = new JsonModel < PartInfoModel > ( ) ;
@ -1045,6 +1074,15 @@ namespace Webservice
try
{
lock ( _ obj2 )
{
if ( _ scanCode = = barcode )
{
LogHelper . WriteLog ( "扫码[" + barcode + "]重复了,连续两次扫码相同,第一次还未执行完成,进行第二次扫码." ) ;
}
_ scanCode = barcode ;
#region 目前全部存储一维码,将二维码转换为一维码
LogHelper . WriteSysLogBase ( "WMS接口:条码:" + barcode + ",转换一维码开始调入时间:" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) , MethodBase . GetCurrentMethod ( ) . Name ) ;
@ -1503,6 +1541,12 @@ namespace Webservice
return JSONTools . ScriptSerialize < JsonModel < PartInfoModel > > ( model ) ;
#endregion
}
}
catch ( Exception ex )
{
@ -1511,6 +1555,10 @@ namespace Webservice
model . ErrReason = ex . Message ;
return JSONTools . ScriptSerialize < JsonModel < PartInfoModel > > ( model ) ;
}
finally
{
_ scanCode = string . Empty ;
}
}
/// <summary>