diff --git a/Admin.Core.Api/Admin.Core.Model.xml b/Admin.Core.Api/Admin.Core.Model.xml
index 1263bf24..441f7753 100644
--- a/Admin.Core.Api/Admin.Core.Model.xml
+++ b/Admin.Core.Api/Admin.Core.Model.xml
@@ -1631,6 +1631,11 @@
SAP订单编码
+
+
+ MES计划编号
+
+
计划数量
diff --git a/Admin.Core.Model/Model_New/BoxFoamplan.cs b/Admin.Core.Model/Model_New/BoxFoamplan.cs
index 979d7d81..036b6484 100644
--- a/Admin.Core.Model/Model_New/BoxFoamplan.cs
+++ b/Admin.Core.Model/Model_New/BoxFoamplan.cs
@@ -30,6 +30,13 @@ namespace Admin.Core.Model
///
[SugarColumn(ColumnName = "ORDER_CODE")]
public string OrderCode { get; set; }
+
+ ///
+ /// MES计划编号
+ ///
+ [SugarColumn(ColumnName = "PLAN_CODE")]
+ public string PlanCode { get; set; }
+
///
/// 计划数量
///
diff --git a/Admin.Core.Service/Service_New/RecordBoxFoamFixtureComplateServices.cs b/Admin.Core.Service/Service_New/RecordBoxFoamFixtureComplateServices.cs
index 77f3c8d9..0123f412 100644
--- a/Admin.Core.Service/Service_New/RecordBoxFoamFixtureComplateServices.cs
+++ b/Admin.Core.Service/Service_New/RecordBoxFoamFixtureComplateServices.cs
@@ -28,7 +28,10 @@ namespace Admin.Core.Service.Service_New
private readonly ISysUserInfoServices _sysUserInfoServices;
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
- public RecordBoxFoamFixtureComplateServices(IBaseRepository dal, IOldBoxFoamTypeServices boxFoamTypeServices, IBoxFoamPlanServices boxFoamPlanServices, IBoxFoamDataServices oldBoxFoamDataServices, ISysUserInfoServices sysUserInfoServices, IBaseSpaceInfoServices baseSpaceInfoServices)
+
+ private readonly IProductPlanInfoServices _productPlanInfoServices;
+
+ public RecordBoxFoamFixtureComplateServices(IBaseRepository dal, IOldBoxFoamTypeServices boxFoamTypeServices, IBoxFoamPlanServices boxFoamPlanServices, IBoxFoamDataServices oldBoxFoamDataServices, ISysUserInfoServices sysUserInfoServices, IBaseSpaceInfoServices baseSpaceInfoServices, IProductPlanInfoServices productPlanInfoServices)
{
this._dal = dal;
base.BaseDal = dal;
@@ -37,6 +40,7 @@ namespace Admin.Core.Service.Service_New
_oldBoxFoamDataServices = oldBoxFoamDataServices;
_sysUserInfoServices = sysUserInfoServices;
_baseSpaceInfoServices = baseSpaceInfoServices;
+ _productPlanInfoServices = productPlanInfoServices;
}
///
@@ -133,6 +137,9 @@ namespace Admin.Core.Service.Service_New
if (planResult)
{
Console.WriteLine($"生产计划更新成功:{boxPlan.CompleteAmount}");
+
+ //更新MES计划
+ UpdateMesPlanInfo(boxPlan.PlanCode, item.RealOutPut);
}
else
{
@@ -308,5 +315,31 @@ namespace Admin.Core.Service.Service_New
return result;
}
+
+ ///
+ /// 更新MES计划信息
+ ///
+ private void UpdateMesPlanInfo(string planCode,int complateAmount)
+ {
+ if (string.IsNullOrEmpty(planCode))
+ {
+ return;
+ }
+ var planInfo = _productPlanInfoServices.GetProductPlanByPlanCode(planCode).Result;
+ if(planInfo != null)
+ {
+ if(planInfo.PlanAmount > planInfo.CompleteAmount)
+ {
+ planInfo.CompleteAmount = planInfo.CompleteAmount + complateAmount;
+ if(planInfo.PlanAmount >= planInfo.CompleteAmount)
+ {
+ planInfo.EndTime = DateTime.Now;
+ }
+
+ _productPlanInfoServices.UpdateProductPlanInfo(planInfo);
+ }
+ }
+
+ }
}
}
diff --git a/Aucma.Core.OldBoxFoam/ViewModels/QuantityIssuedViewModel.cs b/Aucma.Core.OldBoxFoam/ViewModels/QuantityIssuedViewModel.cs
index d494bb7c..b9fed985 100644
--- a/Aucma.Core.OldBoxFoam/ViewModels/QuantityIssuedViewModel.cs
+++ b/Aucma.Core.OldBoxFoam/ViewModels/QuantityIssuedViewModel.cs
@@ -111,6 +111,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
plan.UpdateTime = DateTime.Now;
plan.CreateTime = DateTime.Now;
plan.OrderCode = _planInfo.OrderCode;
+ plan.PlanCode = _planInfo.PlanCode;
plan.ShiftType = 1;
var result = _boxFoamPlanServices.AddAsync(plan).Result;
if (result>=0)
diff --git a/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml b/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml
index 95753424..8e1f07d9 100644
--- a/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml
+++ b/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml
@@ -189,6 +189,7 @@
+
@@ -205,7 +206,7 @@
-