diff --git a/PaintingPC/FrmQuality.cs b/PaintingPC/FrmQuality.cs index b27b865..c42e7fd 100644 --- a/PaintingPC/FrmQuality.cs +++ b/PaintingPC/FrmQuality.cs @@ -1275,13 +1275,17 @@ namespace PaintingPC string foreignVal = string.Empty; if(_lineCode == "2") { - foreignVal = Function.GetProductInfoFrWms(barcode, ref paintError); + foreignVal = Function.GetProductInfoFrWms(barcode, "TM_BJBMPT_MES_DATA", ref paintError); } - else + else if (_lineCode == "1") { - foreignVal = Function.GetProductInfo2(barcode, ref paintError); + foreignVal = Function.GetProductInfoFrWms(barcode, "TM_BJBMPT_MES_DATA_OLD", ref paintError); } + else + { + foreignVal = Function.GetProductInfo2(barcode, ref paintError); + } if (!string.IsNullOrEmpty(paintError)) { lbForeig.Text = paintError; diff --git a/PaintingPC/Function.cs b/PaintingPC/Function.cs index 7ef9239..5588719 100644 --- a/PaintingPC/Function.cs +++ b/PaintingPC/Function.cs @@ -1997,7 +1997,7 @@ namespace PaintingPC return false; } } - public static string GetProductInfoFrWms(string barcode, ref string errorMsg) + public static string GetProductInfoFrWms(string barcode,string tableName, ref string errorMsg) { string res = ""; //string colorNo = ""; @@ -2018,8 +2018,8 @@ namespace PaintingPC else { - #region 从老外系统获得颜色信息 - string wmsSql = $"select TypeCode,WMSColor as paintcode from TM_BJBMPT_MES_DATA where ProductBarcode='{barcode}'"; + #region 从WMS系统获得喷涂上件的颜色信息 + string wmsSql = $"select TypeCode,WMSColor as paintcode from {tableName} where ProductBarcode='{barcode}'"; string wmsSqlConnString = ConfigurationManager.ConnectionStrings["WmsSqlConnString"].ToString(); DataTable dtColor = SqlHelper.GetDataDateTable(wmsSqlConnString, CommandType.Text, wmsSql, null);