@ -13,6 +13,7 @@ using System.Reflection;
using System.Threading ;
using System.Windows.Forms ;
using MESClassLibrary.BLL.BasicInfo ;
using static System . Windows . Forms . AxHost ;
namespace PaintingPC
{
@ -395,6 +396,58 @@ namespace PaintingPC
MessageBox . Show ( "请先扫描数据,然后操作." ) ;
return ;
}
#region 返喷下线数据验证
if ( lableFP . Text . Contains ( "[返喷]" ) )
{
string barcode = txtBarCode . Text . Trim ( ) ;
DataTable dtInspect = Function . GetInspectInfoByBarCode2 ( barcode ) ;
if ( dtInspect ! = null & & dtInspect . Rows . Count > 0 )
{
string inspectResult = dtInspect . Rows [ 0 ] [ "inspectResult" ] . ToString ( ) ; //检测结果
string inspectColorInfo = dtInspect . Rows [ 0 ] [ "remark1" ] . ToString ( ) ; //颜色
if ( inspectResult . Contains ( "打磨" ) )
{
string createTime = dtInspect . Rows [ 0 ] [ "createTime" ] . ToString ( ) ; //创建时间
int count = 0 ;
string colorInfo = "" ;
if ( _l ineCode = = "2" )
{
count = Function . GetProducColorFromWms ( barcode , "TM_BJBMPT_MES_DATA" , createTime , ref colorInfo ) ;
}
else if ( _l ineCode = = "1" )
{
count = Function . GetProducColorFromWms ( barcode , "TM_BJBMPT_MES_DATA_OLD" , createTime , ref colorInfo ) ;
}
else
{
}
if ( count = = 0 )
{
MessageBox . Show ( "未发现返喷下线数据!,无法进行质量判定" ) ;
return ;
}
else
{
if ( inspectColorInfo ! = colorInfo )
{
btnOk . Enabled = false ;
btnRepair . Enabled = false ;
btnNok . Enabled = false ;
MessageBox . Show ( "当前产品返喷颜色与原颜色不符,需报废!" ) ;
return ;
}
}
}
}
}
#endregion
ShowHint ( "" ) ;
#region 判断产品是否有颜色
string colorName = string . Empty ;
@ -450,6 +503,58 @@ namespace PaintingPC
return ;
}
#region 返喷下线数据验证
if ( lableFP . Text . Contains ( "[返喷]" ) )
{
string barcode = txtBarCode . Text . Trim ( ) ;
DataTable dtInspect = Function . GetInspectInfoByBarCode2 ( barcode ) ;
if ( dtInspect ! = null & & dtInspect . Rows . Count > 0 )
{
string inspectResult = dtInspect . Rows [ 0 ] [ "inspectResult" ] . ToString ( ) ; //检测结果
string inspectColorInfo = dtInspect . Rows [ 0 ] [ "remark1" ] . ToString ( ) ; //颜色
if ( inspectResult . Contains ( "打磨" ) )
{
string createTime = dtInspect . Rows [ 0 ] [ "createTime" ] . ToString ( ) ; //创建时间
int count = 0 ;
string colorInfo = "" ;
if ( _l ineCode = = "2" )
{
count = Function . GetProducColorFromWms ( barcode , "TM_BJBMPT_MES_DATA" , createTime , ref colorInfo ) ;
}
else if ( _l ineCode = = "1" )
{
count = Function . GetProducColorFromWms ( barcode , "TM_BJBMPT_MES_DATA_OLD" , createTime , ref colorInfo ) ;
}
else
{
}
if ( count = = 0 )
{
MessageBox . Show ( "未发现返喷下线数据!,无法进行质量判定" ) ;
return ;
}
else
{
if ( inspectColorInfo ! = colorInfo )
{
btnOk . Enabled = false ;
btnRepair . Enabled = false ;
btnNok . Enabled = false ;
MessageBox . Show ( "当前产品返喷颜色与原颜色不符,需报废!" ) ;
return ;
}
}
}
}
}
#endregion
if ( MessageBox . Show ( $"确认对[{txtBarCode.Text}]进行[其它]判定?" , "操作确认" , MessageBoxButtons . OKCancel ) = = DialogResult . Cancel ) return ;
ShowHint ( "" ) ;
#region 必须选择缺陷位置与缺陷原因,否则无法保存
@ -582,6 +687,45 @@ namespace PaintingPC
return ;
}
#region 返喷下线数据验证
if ( lableFP . Text . Contains ( "[返喷]" ) )
{
string barcode = txtBarCode . Text . Trim ( ) ;
DataTable dtInspect = Function . GetInspectInfoByBarCode2 ( barcode ) ;
if ( dtInspect ! = null & & dtInspect . Rows . Count > 0 )
{
string inspectResult = dtInspect . Rows [ 0 ] [ "inspectResult" ] . ToString ( ) ; //检测结果
string inspectColorInfo = dtInspect . Rows [ 0 ] [ "remark1" ] . ToString ( ) ; //颜色
if ( inspectResult . Contains ( "打磨" ) )
{
string createTime = dtInspect . Rows [ 0 ] [ "createTime" ] . ToString ( ) ; //创建时间
int count = 0 ;
string colorInfo = "" ;
if ( _l ineCode = = "2" )
{
count = Function . GetProducColorFromWms ( barcode , "TM_BJBMPT_MES_DATA" , createTime , ref colorInfo ) ;
}
else if ( _l ineCode = = "1" )
{
count = Function . GetProducColorFromWms ( barcode , "TM_BJBMPT_MES_DATA_OLD" , createTime , ref colorInfo ) ;
}
else
{
}
if ( count = = 0 )
{
MessageBox . Show ( "未发现返喷下线数据!,无法进行质量判定" ) ;
return ;
}
}
}
}
#endregion
// if (MessageBox.Show($"确认对[{txtBarCode.Text}]进行报废操作?", "操作确认", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return;
//UserInput(userName => {
@ -984,6 +1128,10 @@ namespace PaintingPC
{
try
{
btnOk . Enabled = true ;
btnRepair . Enabled = true ;
btnNok . Enabled = true ;
_ colorHandChanged = false ;
lbForeig . Text = "" ;
ClearPage ( ) ;