出货报工

This commit is contained in:
qianhao.xu
2025-02-18 13:11:15 +08:00
parent c9447db7d0
commit 9b3a6f9038
3 changed files with 24 additions and 1 deletions

View File

@@ -41,6 +41,13 @@ namespace DOAN.Model.MES.product
[SugarColumn(ColumnName = "plan_num")]
public int? PlanNum { get; set; }
/// <summary>
/// 出货数量
/// </summary>
[SugarColumn(ColumnName = "shipment_num")]
public int? ShipmentNum { get; set; }
/// <summary>
/// 序号
/// </summary>

View File

@@ -46,7 +46,8 @@ namespace DOAN.Service.MES.Order
MaterialCode = o.MaterialCode,
DemandQuantity = o.DemandQuantity,
DeliveryDate = o.DeliveryDate,
DeliveryQuantity = o.DeliveryQuantity,
DeliveryQuantity = SqlFunc.Subqueryable<ProWorkorder>()
.Where(w => w.FeedOrder == o.OrderNoMes).Sum(it=>it.ShipmentNum),
StartDate = o.StartDate,
EndDate = o.EndDate,
Orderindicator = o.Orderindicator,

View File

@@ -73,6 +73,14 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
/// <returns></returns>
public ProReportwork01 AddProReportwork(ProReportwork01 model)
{
//出货工序
if(model.ProcessId== 90&& !string.IsNullOrEmpty(model.Workorder))
{
Context.Updateable<ProWorkorder>()
.SetColumns(it => it.ShipmentNum == model.FinishNum)
.Where(it => it.Workorder == model.Workorder).ExecuteCommand();
}
return Insertable(model).ExecuteReturnEntity();
}
@@ -83,6 +91,13 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
/// <returns></returns>
public int UpdateProReportwork(ProReportwork01 model)
{
//出货工序
if (model.ProcessId == 90 && !string.IsNullOrEmpty(model.Workorder))
{
Context.Updateable<ProWorkorder>()
.SetColumns(it => it.ShipmentNum == model.FinishNum)
.Where(it => it.Workorder == model.Workorder).ExecuteCommand();
}
return Update(model, true);
}