diff --git a/Admin.Core.Model/Model_New/OffLineInfo.cs b/Admin.Core.Model/Model_New/OffLineInfo.cs index 99faa707..5b56b809 100644 --- a/Admin.Core.Model/Model_New/OffLineInfo.cs +++ b/Admin.Core.Model/Model_New/OffLineInfo.cs @@ -55,6 +55,8 @@ namespace Admin.Core.Model public string ProductCreateDate { get; set; }//生成日期 [SugarColumn(ColumnName = "PRODUCT_SCANTIME")] public DateTime ProductScanTime { get; set; } //扫描时间 + [SugarColumn(ColumnName = "BOX_CODE")] + public string boxCode { get; set; } //扫描时间 } } diff --git a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs index 177bad4d..f74c5ed9 100644 --- a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs @@ -43,7 +43,7 @@ namespace Aucma.Core.CodeBinding.ViewModels private readonly ICodeBindingRecordServices? _codeBindingRecordServices; private readonly IBaseMaterialInfoServices? _baseMaterialInfoServices; private readonly IBaseBomInfoServices? _baseBomInfoServices; - private readonly IProductPlanInfoServices? _productPlanInfoServices; + private readonly IPrintBarCodeServices? _printBarCodeServices; // 过点数据表,物料完成记录MaterialCompletion private readonly IMaterialCompletionServices? _iMaterialCompletionServices; @@ -58,7 +58,7 @@ namespace Aucma.Core.CodeBinding.ViewModels _codeBindingRecordServices = App.ServiceProvider.GetService(); _baseBomInfoServices = App.ServiceProvider.GetService(); _baseMaterialInfoServices = App.ServiceProvider.GetService(); - _productPlanInfoServices = App.ServiceProvider.GetService(); + _printBarCodeServices = App.ServiceProvider.GetService(); _iMaterialCompletionServices = App.ServiceProvider.GetService(); MvCodeHelper.ReceiveCode1Event += receiveCode1; @@ -389,15 +389,13 @@ namespace Aucma.Core.CodeBinding.ViewModels #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.OrderCode = print.OrderCode; completion.MaterialBarcode = code1; - completion.MaterialCode = planInfo.MaterialCode; - completion.MaterialName = planInfo.MaterialName; + completion.MaterialCode = print.MaterialCode; + completion.MaterialName = print.MaterialName; completion.StationName = "1007"; completion.CompleteDate = DateTime.Now; - completion.planCode = planInfo.PlanCode; await _iMaterialCompletionServices.AddAsync(completion); #endregion diff --git a/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs b/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs index 9c9d18b2..869c2618 100644 --- a/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs +++ b/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs @@ -58,7 +58,7 @@ namespace Aucma.Core.ProductOffLine.Business private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OffLineBusiness)); private readonly IBaseOrderInfoServices _baseOrderInfoServices = App.ServiceProvider.GetService(); - private readonly IProductPlanInfoServices? _productPlanInfoServices = App.ServiceProvider.GetService(); + private readonly IPrintBarCodeServices? _printBarCodeServices = App.ServiceProvider.GetService(); // 成品下线操作条码系统接口 private readonly IProductOffLineServices? _productOffLineServices = App.ServiceProvider.GetService(); // 成品下线操作mes数据 @@ -176,9 +176,12 @@ namespace Aucma.Core.ProductOffLine.Business { OffLineInfo info11 = MapperTwo(TempOffLineInfo); // 添加成品下线表 + CodeBindingRecord bindingRecord1 = await _codeBindingServices.FirstAsync(x=>x.ProductCode == info11.ProductCode); + if (bindingRecord1 == null) return false; + info11.boxCode = bindingRecord1.BoxCode; await _offLineInfoServices.AddAsync(info11); - // 添加订单表 - ////6.更新mes 数据库完成数量和时间(BASE_ORDERINFO,PRODUCT_PLANINFO) 注意:查询的字段可能需要修改,确保数据一致 + // 修改订单表 + ////6.更新mes 数据库完成数量和时间(BASE_ORDERINFO) 注意:查询的字段可能需要修改,确保数据一致 ////6.1截取订单号去查询更新BASE_ORDERINFO,全放到service处理 BaseOrderInfo order = await _baseOrderInfoServices.FirstAsync(x => x.OrderCode == TempOffLineInfo.ProductOrderNo); @@ -193,30 +196,17 @@ namespace Aucma.Core.ProductOffLine.Business //} //order.UpdatedTime = DateTime.Now; //await _baseOrderInfoServices.UpdateAsync(order); - ////6.2根据订单号去更新PRODUCT_PLANINFO - ProductPlanInfo planInfo = await _productPlanInfoServices.FirstAsync(x => x.OrderCode == TempOffLineInfo.ProductOrderNo); - //if (planInfo.CompleteAmount == 0) - //{ - // planInfo.BeginTime = DateTime.Now; - //} - // planInfo.CompleteAmount++; - //if (planInfo.CompleteAmount == productInfo.PlanAmount) - //{ - // planInfo.EndTime = DateTime.Now; - //} - //planInfo.UpdatedTime = DateTime.Now; - //await _productPlanInfoServices.UpdateAsync(planInfo); + #region 更新过点数据 - CodeBindingRecord bindingRecord = await _codeBindingServices.FirstAsync(x => x.ProductCode == TempOffLineInfo.ProductCode); + PrintBarCode print = await _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == bindingRecord1.BoxCode); MaterialCompletion completion = new MaterialCompletion(); - completion.OrderCode = planInfo.OrderCode; - completion.MaterialBarcode = bindingRecord.BoxCode; - completion.MaterialCode = planInfo.MaterialCode; - completion.MaterialName = planInfo.MaterialName; + completion.OrderCode = print.OrderCode; + completion.MaterialBarcode = bindingRecord1.BoxCode; + completion.MaterialCode = print.MaterialCode; + completion.MaterialName = print.MaterialName; completion.StationName = "1008" ; completion.CompleteDate = DateTime.Now; - completion.planCode = planInfo.PlanCode; - await _iMaterialCompletionServices.AddAsync(completion); + await _iMaterialCompletionServices.AddAsync(completion); #endregion return true; } diff --git a/Aucma.Core.ProductOffLine/Models/TempInfo.cs b/Aucma.Core.ProductOffLine/Models/TempInfo.cs index 1a97945b..2024a09e 100644 --- a/Aucma.Core.ProductOffLine/Models/TempInfo.cs +++ b/Aucma.Core.ProductOffLine/Models/TempInfo.cs @@ -89,8 +89,8 @@ namespace Aucma.Core.ProductOffLine.Models /// /// //扫描时间 /// - public DateTime ProductScanTime { get; set; } - + public DateTime ProductScanTime { get; set; } + /// /// 刷新标志,定时器检测true刷新 /// @@ -134,5 +134,6 @@ namespace Aucma.Core.ProductOffLine.Models /// /// public string QualityResult { get; set; } + } }