调整采购完成数
This commit is contained in:
@@ -11,6 +11,11 @@ namespace DOAN.Model.MES.order.Dto
|
|||||||
public string OrderNoMes { get; set; }
|
public string OrderNoMes { get; set; }
|
||||||
|
|
||||||
public string PurchaseOrderErp { get; set; }
|
public string PurchaseOrderErp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否完成订单
|
||||||
|
/// </summary>
|
||||||
|
public int Orderindicator { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ namespace DOAN.Service.MES.Order
|
|||||||
.AndIF(!string.IsNullOrEmpty(parm.PurchaseOrderErp), (o, w) => o.OrderNoMes.Contains(parm.PurchaseOrderErp))
|
.AndIF(!string.IsNullOrEmpty(parm.PurchaseOrderErp), (o, w) => o.OrderNoMes.Contains(parm.PurchaseOrderErp))
|
||||||
.AndIF(parm.ImportDate != null && parm.ImportDate[0] > DateTime.MinValue, (o, w) => o.ImportDate >= parm.ImportDate[0])
|
.AndIF(parm.ImportDate != null && parm.ImportDate[0] > DateTime.MinValue, (o, w) => o.ImportDate >= parm.ImportDate[0])
|
||||||
.AndIF(parm.ImportDate != null && parm.ImportDate[1] > DateTime.MinValue, (o, w) => o.ImportDate >= parm.ImportDate[1])
|
.AndIF(parm.ImportDate != null && parm.ImportDate[1] > DateTime.MinValue, (o, w) => o.ImportDate >= parm.ImportDate[1])
|
||||||
|
.AndIF(parm.Orderindicator>-1,(o,w)=>o.Orderindicator==parm.Orderindicator)
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ namespace DOAN.Service.MES.order
|
|||||||
.AndIF(!string.IsNullOrEmpty(parm.PurchaseOrderErp), it => it.OrderNoMes.Contains(parm.PurchaseOrderErp))
|
.AndIF(!string.IsNullOrEmpty(parm.PurchaseOrderErp), it => it.OrderNoMes.Contains(parm.PurchaseOrderErp))
|
||||||
.AndIF(parm.ImportDate != null && parm.ImportDate[0] > DateTime.MinValue, it => it.ImportDate >= parm.ImportDate[0])
|
.AndIF(parm.ImportDate != null && parm.ImportDate[0] > DateTime.MinValue, it => it.ImportDate >= parm.ImportDate[0])
|
||||||
.AndIF(parm.ImportDate != null && parm.ImportDate[1] > DateTime.MinValue, it => it.ImportDate >= parm.ImportDate[1])
|
.AndIF(parm.ImportDate != null && parm.ImportDate[1] > DateTime.MinValue, it => it.ImportDate >= parm.ImportDate[1])
|
||||||
|
.AndIF(parm.Orderindicator > -1, it => it.Orderindicator == parm.Orderindicator)
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using DOAN.Model;
|
using DOAN.Model;
|
||||||
using DOAN.Model.MES.base_;
|
using DOAN.Model.MES.base_;
|
||||||
using DOAN.Model.MES.base_.Dto;
|
using DOAN.Model.MES.base_.Dto;
|
||||||
|
using DOAN.Model.MES.order;
|
||||||
using DOAN.Model.MES.product;
|
using DOAN.Model.MES.product;
|
||||||
using DOAN.Model.Mobile.ReportFlow.Dto;
|
using DOAN.Model.Mobile.ReportFlow.Dto;
|
||||||
using DOAN.Model.Public;
|
using DOAN.Model.Public;
|
||||||
@@ -162,10 +163,19 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
|||||||
Context.Updateable<ProWorkorder>().Where(it => it.Workorder == workorder)
|
Context.Updateable<ProWorkorder>().Where(it => it.Workorder == workorder)
|
||||||
.SetColumns(it => it.CustomerOrder == customer_order)
|
.SetColumns(it => it.CustomerOrder == customer_order)
|
||||||
.ExecuteCommand();
|
.ExecuteCommand();
|
||||||
//出货工序
|
//调整工单完成数
|
||||||
Context.Updateable<ProWorkorder>()
|
Context.Updateable<ProWorkorder>()
|
||||||
.SetColumns(it => it.ShipmentNum == finish_num)
|
.SetColumns(it => it.ShipmentNum == finish_num)
|
||||||
.Where(it => it.Workorder == workorder).ExecuteCommand();
|
.Where(it => it.Workorder == workorder).ExecuteCommand();
|
||||||
|
//调整采购完成数
|
||||||
|
var OrderPurchase = Context.Queryable<OrderPurchase>().Where(it => it.OrderNoMes == SqlFunc.Subqueryable<ProWorkorder>().Where(s => s.Workorder == workorder).Select(s => s.FeedOrder)).First();
|
||||||
|
int? ShipmentNum= Context.Queryable<ProWorkorder>().Where(it => it.FeedOrder == SqlFunc.Subqueryable<ProWorkorder>().Where(s => s.Workorder == workorder).Select(s => s.FeedOrder)).Sum(it => it.ShipmentNum);
|
||||||
|
int Orderindicator = OrderPurchase.DemandQuantity<=ShipmentNum?1:0;
|
||||||
|
Context.Updateable<OrderPurchase>()
|
||||||
|
.SetColumns(it => it.Orderindicator == Orderindicator)
|
||||||
|
.SetColumns(it=>it.DeliveryQuantity == ShipmentNum)
|
||||||
|
.Where(it => it.Id == OrderPurchase.Id).ExecuteCommand();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -194,7 +204,14 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
|||||||
Context.Updateable<ProWorkorder>()
|
Context.Updateable<ProWorkorder>()
|
||||||
.SetColumns(it => it.ShipmentNum == finish_num)
|
.SetColumns(it => it.ShipmentNum == finish_num)
|
||||||
.Where(it => it.Workorder == workorder).ExecuteCommand();
|
.Where(it => it.Workorder == workorder).ExecuteCommand();
|
||||||
|
//调整采购完成数
|
||||||
|
var OrderPurchase = Context.Queryable<OrderPurchase>().Where(it => it.OrderNoMes == SqlFunc.Subqueryable<ProWorkorder>().Where(s => s.Workorder == workorder).Select(s => s.FeedOrder)).First();
|
||||||
|
int? ShipmentNum = Context.Queryable<ProWorkorder>().Where(it => it.FeedOrder == SqlFunc.Subqueryable<ProWorkorder>().Where(s => s.Workorder == workorder).Select(s => s.FeedOrder)).Sum(it => it.ShipmentNum);
|
||||||
|
int Orderindicator = OrderPurchase.DemandQuantity <= ShipmentNum ? 1 : 0;
|
||||||
|
Context.Updateable<OrderPurchase>()
|
||||||
|
.SetColumns(it => it.Orderindicator == Orderindicator)
|
||||||
|
.SetColumns(it => it.DeliveryQuantity == ShipmentNum)
|
||||||
|
.Where(it => it.Id == OrderPurchase.Id).ExecuteCommand();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user