diff --git a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs index dabca71d..177bad4d 100644 --- a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs @@ -45,6 +45,8 @@ namespace Aucma.Core.CodeBinding.ViewModels private readonly IBaseBomInfoServices? _baseBomInfoServices; private readonly IProductPlanInfoServices? _productPlanInfoServices; private readonly IPrintBarCodeServices? _printBarCodeServices; + // 过点数据表,物料完成记录MaterialCompletion + private readonly IMaterialCompletionServices? _iMaterialCompletionServices; // 静态变量存code1 private static string code1Str = string.Empty; // 定时检测数据库有没有pad绑定未放行的数据 @@ -58,7 +60,8 @@ namespace Aucma.Core.CodeBinding.ViewModels _baseMaterialInfoServices = App.ServiceProvider.GetService(); _productPlanInfoServices = App.ServiceProvider.GetService(); _printBarCodeServices = App.ServiceProvider.GetService(); - MvCodeHelper.ReceiveCode1Event += receiveCode1; + _iMaterialCompletionServices = App.ServiceProvider.GetService(); + MvCodeHelper.ReceiveCode1Event += receiveCode1; MvCodeHelper.ReceiveCode2Event += receiveCode2; // pda手持检测plc放行定时器 // StartPlcTimer(); @@ -383,20 +386,19 @@ namespace Aucma.Core.CodeBinding.ViewModels record.isPlcPass = 2; } await _codeBindingRecordServices.UpdateAsync(record); - // 更新过点数据 - #region 插入记录到MATERIAL_COMPLETION表 - //PrintBarCode print = await _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == code1); - //if (print != null) return; - //ProductPlanInfo planInfo = await _productPlanInfoServices.FirstAsync(x=>x.OrderCode==print.); - //MaterialCompletion completion = new MaterialCompletion(); - //completion.OrderCode = planInfo.OrderCode; - //completion.MaterialBarcode = code1; - //completion.MaterialCode = planInfo.MaterialCode; - //completion.MaterialName = planInfo.MaterialName; - //completion.StationName = "1008"; - //completion.CompleteDate = DateTime.Now; - //completion.planCode = planInfo.PlanCode; - //await _iMaterialCompletionServices.AddAsync(completion); + #region 更新过点数据,插入记录到MATERIAL_COMPLETION表 + PrintBarCode print = await _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == code1); + if (print != null) return; + ProductPlanInfo planInfo = await _productPlanInfoServices.FirstAsync(x => x.OrderCode == print.OrderCode); + MaterialCompletion completion = new MaterialCompletion(); + completion.OrderCode = planInfo.OrderCode; + completion.MaterialBarcode = code1; + completion.MaterialCode = planInfo.MaterialCode; + completion.MaterialName = planInfo.MaterialName; + completion.StationName = "1007"; + completion.CompleteDate = DateTime.Now; + completion.planCode = planInfo.PlanCode; + await _iMaterialCompletionServices.AddAsync(completion); #endregion // 2.刷新界面信息