|
|
@@ -36,6 +36,7 @@ using System.Diagnostics.CodeAnalysis;
|
|
|
using System.Diagnostics;
|
|
|
using Volo.Abp.Uow;
|
|
|
using Spire.Pdf.Exporting.XPS.Schema;
|
|
|
+using Business.PriorityManagement;
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
namespace Business.ResourceExamineManagement
|
|
|
@@ -272,7 +273,16 @@ namespace Business.ResourceExamineManagement
|
|
|
private ISqlRepository<ItemMaster> _itemMaster;
|
|
|
private ISqlRepository<NbrMaster> _nbrMaster;
|
|
|
private ISqlRepository<NbrDetail> _nbrDetail;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 生产排产
|
|
|
+ /// </summary>
|
|
|
private readonly ProductionScheduleAppService _productionScheduleAppService;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 优先级
|
|
|
+ /// </summary>
|
|
|
+ private readonly PriorityAppService _priorityAppService;
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
|
@@ -355,6 +365,7 @@ namespace Business.ResourceExamineManagement
|
|
|
ISqlRepository<WorkOrdDetail> workOrdDetail,
|
|
|
ISqlRepository<NbrMaster> nbrMaster,
|
|
|
ISqlRepository<NbrDetail> nbrDetail,
|
|
|
+ PriorityAppService priorityAppService,
|
|
|
ISqlRepository<rf_serialnumber> rf_serialnumber
|
|
|
)
|
|
|
{
|
|
|
@@ -428,6 +439,7 @@ namespace Business.ResourceExamineManagement
|
|
|
_itemMaster = itemMaster;
|
|
|
_nbrMaster = nbrMaster;
|
|
|
_nbrDetail = nbrDetail;
|
|
|
+ _priorityAppService= priorityAppService;
|
|
|
_rf_serialnumber = rf_serialnumber;
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -462,6 +474,7 @@ namespace Business.ResourceExamineManagement
|
|
|
new NLogHelper("ResourceExamineAppService").WriteLog("ReceiveResult", "订单数据不存在", _currentTenant.Id.ToString());
|
|
|
throw new NotImplementedException("订单数据不存在!");
|
|
|
}
|
|
|
+
|
|
|
//获取订单行数据
|
|
|
List<crm_seorderentry> sentrys = await _mysql_crm_seorderentry.GetListAsync(p => p.tenant_id == input.tenantId && p.factory_id == input.factoryId && p.seorder_id == input.sorderId && !p.IsDeleted);
|
|
|
|
|
|
@@ -499,6 +512,9 @@ namespace Business.ResourceExamineManagement
|
|
|
DataInitialization(boms, bangid, sorder, icitemlist, stocklist, pretreatments);
|
|
|
foreach (var item in sentrys)
|
|
|
{
|
|
|
+ //获取销售订单“是否加急”字段
|
|
|
+ int urgent = sorder.urgent;
|
|
|
+
|
|
|
//工单资源检查信息
|
|
|
dtl = new ExamineResult();
|
|
|
dtl.sorderid = rtn.sorderid;
|
|
|
@@ -523,7 +539,7 @@ namespace Business.ResourceExamineManagement
|
|
|
//库存初始化
|
|
|
_CalcBomViewAppService.BomStock(getBomList, stocklist, bangid);
|
|
|
//计算
|
|
|
- _CalcBomViewAppService.CalcView(getBomList, bangid, item.qty.GetValueOrDefault(), item.plan_date, sklist, item, icitemlist);
|
|
|
+ _CalcBomViewAppService.CalcView(getBomList, bangid, item.qty.GetValueOrDefault(), item.plan_date, sklist, item, urgent, icitemlist);
|
|
|
|
|
|
//TODO:最晚开始时间
|
|
|
var curFacDtl = leadTimeList.FirstOrDefault(p => p.item_id == childBom.icitem_id);
|
|
|
@@ -2092,7 +2108,7 @@ namespace Business.ResourceExamineManagement
|
|
|
//库存初始化
|
|
|
_CalcBomViewAppService.BomStock(getBomList, stocklist, bangid);
|
|
|
//计算
|
|
|
- _CalcBomViewAppService.CalcView(getBomList, bangid, item.need_number.GetValueOrDefault(), item.start_time, sklist, sentry, icitemlist);
|
|
|
+ _CalcBomViewAppService.CalcView(getBomList, bangid, item.need_number.GetValueOrDefault(), item.start_time, sklist, sentry, item.urgent, icitemlist);
|
|
|
|
|
|
//TODO:最晚开始时间
|
|
|
var curFacDtl = leadTimeList.FirstOrDefault(p => p.item_id == childBom.icitem_id);
|
|
|
@@ -2314,7 +2330,7 @@ namespace Business.ResourceExamineManagement
|
|
|
/// </summary>
|
|
|
/// <param name="morders"></param>
|
|
|
[UnitOfWork]
|
|
|
- public async void CreateWorkOrdDates(List<mo_mes_morder> morders)
|
|
|
+ public void CreateWorkOrdDates(List<mo_mes_morder> morders)
|
|
|
{
|
|
|
//获取工艺路线数据:product_code=物料编码
|
|
|
List<RoutingOpDetail> allRoutings = _routingOpDetail.Select(p => morders.Select(m => m.product_code).Contains(p.RoutingCode));
|
|
|
@@ -2341,7 +2357,7 @@ namespace Business.ResourceExamineManagement
|
|
|
workOrd.QtyOrded = item.need_number.GetValueOrDefault();
|
|
|
workOrd.RoutingCode = item.product_code;
|
|
|
workOrd.Period = 1;
|
|
|
- workOrd.Priority = 1;
|
|
|
+ workOrd.Priority = item.urgent;
|
|
|
workOrd.Status = "";
|
|
|
workOrd.IsActive = true;
|
|
|
workOrds.Add(workOrd);
|