|
|
|
@ -28,7 +28,10 @@ namespace Admin.Core.Service.Service_New
|
|
|
|
|
private readonly ISysUserInfoServices _sysUserInfoServices;
|
|
|
|
|
|
|
|
|
|
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
|
|
|
|
|
public RecordBoxFoamFixtureComplateServices(IBaseRepository<RecordBoxFoamFixtureComplate> dal, IOldBoxFoamTypeServices boxFoamTypeServices, IBoxFoamPlanServices boxFoamPlanServices, IBoxFoamDataServices oldBoxFoamDataServices, ISysUserInfoServices sysUserInfoServices, IBaseSpaceInfoServices baseSpaceInfoServices)
|
|
|
|
|
|
|
|
|
|
private readonly IProductPlanInfoServices _productPlanInfoServices;
|
|
|
|
|
|
|
|
|
|
public RecordBoxFoamFixtureComplateServices(IBaseRepository<RecordBoxFoamFixtureComplate> 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -118,7 +122,7 @@ namespace Admin.Core.Service.Service_New
|
|
|
|
|
|
|
|
|
|
foreach (var boxFoamType in boxFoamTypeList)
|
|
|
|
|
{
|
|
|
|
|
var boxPlanList = _boxFoamPlanServices.Query(x => x.ProductLineCode == productLineCode && x.StationCode == stationCode && x.MaterialCode == boxFoamType && x.PlanAmount > x.CompleteAmount);
|
|
|
|
|
var boxPlanList = _boxFoamPlanServices.Query(x => x.ProductLineCode == productLineCode && x.StationCode == stationCode && x.MaterialCode == boxFoamType && x.PlanAmount > x.CompleteAmount && x.ShiftType == 1);
|
|
|
|
|
if (boxPlanList != null)
|
|
|
|
|
{
|
|
|
|
|
if (boxPlanList.Count > 0)
|
|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新MES计划信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|