@ -1,5 +1,6 @@
using CommonFunc ;
using CommonFunc.Tools ;
using DevExpress.Charts.Native ;
using HandyControl.Tools.Extension ;
using Newtonsoft.Json ;
using System ;
@ -11,6 +12,7 @@ using System.Threading.Tasks;
using System.Timers ;
using System.Windows ;
using System.Windows.Controls ;
using Xceed.Wpf.Toolkit.Primitives ;
using XGL.Data.DBService ;
using XGL.Dats.DBServiceFinishProd ;
using XGL.Models.Model ;
@ -110,7 +112,7 @@ namespace XGLFinishPro.Views
string plantime ;
private void TimerDeciveState_Elapsed ( object sender , ElapsedEventArgs e )
{
//if (Utils.isAnyBodyPerating) return ;
if ( Utils . isAnyBodyPerating ) return ;
try
{
List < FoamingMacModel > orderList = new List < FoamingMacModel > ( ) ;
@ -797,11 +799,11 @@ namespace XGLFinishPro.Views
return ;
}
}
CustomMessageBoxResult result = CustomMessageBox . Show ( $"你确定要为批次号:{ (dgWorkOrderInfo.SelectedItem as DataRowView)["batch_code "] }进行首检么?", CustomMessageBoxButton . OKCancel , CustomMessageBoxIcon . Warning ) ;
string batchCode = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "batch_code" ] . ToString ( ) ;
CustomMessageBoxResult result = CustomMessageBox . Show ( $"你确定要为批次号:{ batchCode }进行首检么?", CustomMessageBoxButton . OKCancel , CustomMessageBoxIcon . Warning ) ;
if ( result = = CustomMessageBoxResult . Cancel )
return ;
LogHelper . instance . log . Info ( $"首检检验按钮被点击工单号为:{(dgWorkOrderInfo.SelectedItem as DataRowView)[" workorder_code "]},批次号为:{ (dgWorkOrderInfo.SelectedItem as DataRowView)["batch_code "] }") ;
LogHelper . instance . log . Info ( $"首检检验按钮被点击工单号为:{(dgWorkOrderInfo.SelectedItem as DataRowView)[" workorder_code "]},批次号为:{ batchCode }") ;
//2024-04-16添加不限制首检确认的功能;
//string qcStatus = (dgWorkOrderInfo.SelectedItem as DataRowView)["qc_status"].ToString();
@ -813,8 +815,9 @@ namespace XGLFinishPro.Views
// return;
// }
//}
//首件检验
await CallCheckApi ( "checkTypeSC" );
await CallCheckApi ( "checkTypeSC" , batchCode );
}
catch ( Exception ex )
{
@ -829,13 +832,17 @@ namespace XGLFinishPro.Views
/// </summary>
/// <param name="checkType"></param>
/// <returns></returns>
private async Task CallCheckApi ( string checkType )
private async Task CallCheckApi ( string checkType ,string batchCode )
{
try
{
string workorderCode = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "workorder_code" ] . ToString ( ) ;
string workorderID = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "workorder_id" ] . ToString ( ) ;
string batchCode = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "batch_code" ] . ToString ( ) ;
string productCode = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "product_code" ] . ToString ( ) ;
string productName = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "product_name" ] . ToString ( ) ;
string quality = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "quantity_split" ] . ToString ( ) ;
string unit = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "unit" ] . ToString ( ) ;
string plan_time = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "plan_time" ] . ToString ( ) ;
//调用首件检验接口
string apiUrl = formingMachineService . GetInterfaceUrl ( "createCheckProduceTask" ) ;
FirstCheckModel firstCheck = new FirstCheckModel ( ) ;
@ -851,15 +858,15 @@ namespace XGLFinishPro.Views
{
taskName = "首件检验任务" ;
LogHelper . instance . log . Info ( $"准备触发首件检验任务{workorderCode}>>批次号为:{batchCode}" ) ;
firstCheck . incomeBatchNo = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "batch_code" ] . ToString ( ) ;
firstCheck . incomeBatchNo = batchCode ;
}
firstCheck . orderNo = workorderCode ;
firstCheck . materialName = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "product_name" ] . ToString ( ) ;
firstCheck . materialCode = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "product_code" ] . ToString ( ) ;
firstCheck . materialName = productName ;
firstCheck . materialCode = productCode ;
firstCheck . checkType = checkType ; //"checkTypeSC";
firstCheck . quality = ( dgWorkOrderInfo . SelectedItem as DataRowView ) [ "quantity_split" ] . ToString ( ) ;
firstCheck . unit = ( dgWorkOrderInfo . SelectedItem as DataRowView) [ " unit"] . ToString ( ) ;
firstCheck . quality = quality ;
firstCheck . unit = unit;
//根据线体编码获取车间编码
DataTable dtCar = userDbWareHouse . GetCarInfo ( deviceCode ) ;
string carCode = dtCar . Rows [ 0 ] [ 0 ] . ToString ( ) ;
@ -867,7 +874,7 @@ namespace XGLFinishPro.Views
firstCheck . carName = carName ;
firstCheck . carCode = carCode ;
firstCheck . produceDate = ( dgWorkOrderInfo . SelectedItem as DataRowView) [ " plan_time"] . ToString ( ) ;
firstCheck . produceDate = plan_time;
firstCheck . checkManName = LoginUser . UserName ;
firstCheck . checkManCode = LoginUser . UserCode ;
firstCheck . checkLoc = deviceCode ;