|
@@ -6,6 +6,8 @@ using Business.Dto;
|
|
|
using Business.EntityFrameworkCore;
|
|
using Business.EntityFrameworkCore;
|
|
|
using Business.EntityFrameworkCore.SqlRepositories;
|
|
using Business.EntityFrameworkCore.SqlRepositories;
|
|
|
using Business.PriorityManagement;
|
|
using Business.PriorityManagement;
|
|
|
|
|
+using Business.Replenishment;
|
|
|
|
|
+using Business.ReplenishmentManagement;
|
|
|
using Business.ResourceExamineManagement.Dto;
|
|
using Business.ResourceExamineManagement.Dto;
|
|
|
using Business.StructuredDB.SaleFcst;
|
|
using Business.StructuredDB.SaleFcst;
|
|
|
using Business.StructuredDB.WMS;
|
|
using Business.StructuredDB.WMS;
|
|
@@ -298,6 +300,11 @@ namespace Business.ResourceExamineManagement
|
|
|
|
|
|
|
|
private readonly SerialNumberAppService _serialNumberAppService;
|
|
private readonly SerialNumberAppService _serialNumberAppService;
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 优先级
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ private readonly ReplenishmentAppService _replenishmentAppService;
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 计算BOM平铺物料情况
|
|
/// 计算BOM平铺物料情况
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -471,7 +478,8 @@ namespace Business.ResourceExamineManagement
|
|
|
ISqlRepository<MonthlyShipmentPlan> monthlyShipmentPlan,
|
|
ISqlRepository<MonthlyShipmentPlan> monthlyShipmentPlan,
|
|
|
IRepository<srm_purchase, long> srmPurchase,
|
|
IRepository<srm_purchase, long> srmPurchase,
|
|
|
IUnitOfWorkManager unitOfWorkManager,
|
|
IUnitOfWorkManager unitOfWorkManager,
|
|
|
- SerialNumberAppService serialNumberAppService
|
|
|
|
|
|
|
+ SerialNumberAppService serialNumberAppService,
|
|
|
|
|
+ ReplenishmentAppService replenishmentAppService
|
|
|
)
|
|
)
|
|
|
{
|
|
{
|
|
|
_mes_technique = mes_technique;
|
|
_mes_technique = mes_technique;
|
|
@@ -560,6 +568,7 @@ namespace Business.ResourceExamineManagement
|
|
|
_unitOfWorkManager = unitOfWorkManager;
|
|
_unitOfWorkManager = unitOfWorkManager;
|
|
|
_scheduleResultOpMaster = scheduleResultOpMaster;
|
|
_scheduleResultOpMaster = scheduleResultOpMaster;
|
|
|
_serialNumberAppService = serialNumberAppService;
|
|
_serialNumberAppService = serialNumberAppService;
|
|
|
|
|
+ _replenishmentAppService = replenishmentAppService;
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
@@ -4354,10 +4363,16 @@ namespace Business.ResourceExamineManagement
|
|
|
workOrd.JointTyped = "B";
|
|
workOrd.JointTyped = "B";
|
|
|
_workOrdMaster.Update(workOrd);
|
|
_workOrdMaster.Update(workOrd);
|
|
|
|
|
|
|
|
|
|
+ //获取需要排产的工单(获取四周的工单:正常工单+已审批通过的特殊工单)
|
|
|
|
|
+ DateTime endDate = DateTime.Now.Date.AddDays(28).AddDays(1);
|
|
|
|
|
+ //取数开始时间为当前天的下一天
|
|
|
|
|
+ DateTime startDate = DateTime.Now.Date.AddDays(1);
|
|
|
|
|
+ //尚未开始生产的工单+正在生产的工单
|
|
|
|
|
+ var workOrds = _workOrdMaster.Select(p => p.IsActive && p.Domain == input.domain && ((p.OrdDate < endDate && p.OrdDate >= startDate && (string.IsNullOrEmpty(p.Typed) || (!string.IsNullOrEmpty(p.Typed) && p.BusinessID > 0))) || p.Status.ToLower() == "w")).ToList();
|
|
|
//调用优先级计算算法
|
|
//调用优先级计算算法
|
|
|
-
|
|
|
|
|
- //调用手动排产算法
|
|
|
|
|
- string result = await ProductionSchedule(input.domain);
|
|
|
|
|
|
|
+ workOrds = _replenishmentAppService.CalcPriority(workOrds.Select(p=>p.WorkOrd).ToList(), input.domain);
|
|
|
|
|
+ //执行排产
|
|
|
|
|
+ string result = await _productionScheduleAppService.DoProductSchedule(workOrds, input.domain, 2);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|