|
|
|
@ -12,6 +12,8 @@ using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
|
using Forks.Utils; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
using BWP.B3UnitedInfos.BL; |
|
|
|
using BWP.B3UnitedInfos.BO; |
|
|
|
|
|
|
|
namespace B3_DongFangWanQi.BL |
|
|
|
{ |
|
|
|
@ -22,6 +24,7 @@ namespace B3_DongFangWanQi.BL |
|
|
|
{ |
|
|
|
void UpdateUnitNumber(ProductionNotification dmo); |
|
|
|
void LoadDetailsByOrders(ProductionNotification dmo, IList<ProductionNotification_Detail> resultDetails); |
|
|
|
void LoadOutDetailsByOrders(ProductionNotification dmo, IList<ProductionNotificationOutStore_Detail> resultDetails); |
|
|
|
void UpdateSaleOutStoreUnitNum(ProductionNotification dmo); |
|
|
|
} |
|
|
|
|
|
|
|
@ -43,8 +46,8 @@ namespace B3_DongFangWanQi.BL |
|
|
|
{ |
|
|
|
foreach (ProductionNotification_Detail detail in dmo.Details) |
|
|
|
{ |
|
|
|
var query=new DQueryDom(new JoinAlias(typeof(Order_Detail))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("ID",detail.OrderDetail_ID)); |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(Order_Detail))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("ID", detail.OrderDetail_ID)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("UnitNum")); |
|
|
|
var unitnum = query.EExecuteScalar<Money<decimal>?>(Session); |
|
|
|
detail.SendNumber = unitnum; |
|
|
|
@ -53,9 +56,9 @@ namespace B3_DongFangWanQi.BL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void LoadDetailsByOrders(ProductionNotification dmo,IList<ProductionNotification_Detail> resultDetails) |
|
|
|
public void LoadDetailsByOrders(ProductionNotification dmo, IList<ProductionNotification_Detail> resultDetails) |
|
|
|
{ |
|
|
|
// dmo.Details.Clear();
|
|
|
|
// dmo.Details.Clear();
|
|
|
|
|
|
|
|
var orderbl = BIFactory.Create<IOrderBL>(Session); |
|
|
|
foreach (ProductionNotification_Detail detail in resultDetails) |
|
|
|
@ -90,7 +93,7 @@ namespace B3_DongFangWanQi.BL |
|
|
|
public void UpdateSaleOutStoreUnitNum(ProductionNotification dmo) |
|
|
|
{ |
|
|
|
var outstorebl = BIFactory.Create<ISaleOutStoreBL>(Session); |
|
|
|
foreach (IGrouping<long, ProductionNotification_Detail> grouping in dmo.Details.GroupBy(x=>x.Order_ID)) |
|
|
|
foreach (IGrouping<long, ProductionNotification_Detail> grouping in dmo.Details.GroupBy(x => x.Order_ID)) |
|
|
|
{ |
|
|
|
var orderid = grouping.Key; |
|
|
|
var saleoutstoreid = GetSaleOutStoreId(orderid); |
|
|
|
@ -113,10 +116,46 @@ namespace B3_DongFangWanQi.BL |
|
|
|
|
|
|
|
private long? GetSaleOutStoreId(long orderid) |
|
|
|
{ |
|
|
|
var query=new DQueryDom(new JoinAlias(typeof(SaleOutStore))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Order_ID",orderid)); |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(SaleOutStore))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Order_ID", orderid)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
return query.EExecuteScalar<long?>(Session); |
|
|
|
} |
|
|
|
|
|
|
|
public void LoadOutDetailsByOrders(ProductionNotification dmo, IList<ProductionNotificationOutStore_Detail> resultDetails) |
|
|
|
{ |
|
|
|
var otheroutStore = BIFactory.Create<IOtherOutStoreBL>(Session); |
|
|
|
foreach (ProductionNotificationOutStore_Detail detail in resultDetails) |
|
|
|
{ |
|
|
|
var outstore = otheroutStore.Load(detail.OtherOutStore_ID); |
|
|
|
foreach (OtherOutStore_Detail outstoreDetail in outstore.Details) |
|
|
|
{ |
|
|
|
if (dmo.OutDetails.Any(x => x.OtherOutStore_ID == outstore.ID && x.OtherOutStoreDetail_ID == outstoreDetail.ID)) |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
var dmodetail = new ProductionNotificationOutStore_Detail() |
|
|
|
{ |
|
|
|
OtherOutStore_ID = outstore.ID, |
|
|
|
OtherOutStoreDetail_ID = outstoreDetail.ID, |
|
|
|
Goods_ID = outstoreDetail.Goods_ID, |
|
|
|
Goods_Name = outstoreDetail.Goods_Name, |
|
|
|
Goods_Spec = outstoreDetail.Goods_Spec, |
|
|
|
GoodsBatch_ID = outstoreDetail.GoodsBatch_ID, |
|
|
|
GoodsBatch_Name = outstoreDetail.GoodsBatch_Name, |
|
|
|
Goods_MainUnit = outstoreDetail.Goods_MainUnit, |
|
|
|
Goods_SecondUnit = outstoreDetail.Goods_SecondUnit, |
|
|
|
Number = outstoreDetail.Number, |
|
|
|
AccountMoney = outstoreDetail.AccountMoney, |
|
|
|
CargoSpace_ID = outstoreDetail.CargoSpace_ID, |
|
|
|
CargoSpace_Name = outstoreDetail.CargoSpace_Name, |
|
|
|
Price = outstoreDetail.Price, |
|
|
|
SecondNumber = outstoreDetail.SecondNumber, |
|
|
|
TaxRate = outstoreDetail.TaxRate, |
|
|
|
}; |
|
|
|
dmo.OutDetails.Add(dmodetail); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |