出货报工
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user