|
|
@ -69,6 +69,8 @@ namespace BBWYB.Server.Business |
|
|
|
.Distinct() |
|
|
|
.ToList(pss => pss.PurchaseSkuId); |
|
|
|
|
|
|
|
#region 配件
|
|
|
|
|
|
|
|
var dbStatisticList = fsql.Select<PurchaseSchemeProductSkuStatistic>(pssIdList).ToList(); |
|
|
|
|
|
|
|
List<PurchaseSchemeProductSkuStatistic> insertStatisticList = new List<PurchaseSchemeProductSkuStatistic>(); |
|
|
@ -131,6 +133,38 @@ namespace BBWYB.Server.Business |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 采购方案
|
|
|
|
List<PurchaseScheme> dbSchemeList = fsql.Select<PurchaseScheme>(schemeIdList).ToList(); |
|
|
|
|
|
|
|
#region 最近采购成本
|
|
|
|
var recentOrderPurchaserRelationList = fsql.Select<OrderPurchaseInfo, OrderPurchaseRelationInfo>() |
|
|
|
.InnerJoin((opi, opri) => opi.OrderId == opri.OrderId && |
|
|
|
opi.PurchaseOrderId == opri.PurchaseOrderId) |
|
|
|
.Where((opi, opri) => opi.IsEnabled == true && schemeIdList.Contains(opri.SchemeId.Value)) |
|
|
|
.GroupBy((opi, opri) => opri.SchemeId.Value) |
|
|
|
.WithTempQuery(g => new { MaxId = g.Max(g.Value.Item2.Id) }) |
|
|
|
.From<OrderPurchaseRelationInfo>() |
|
|
|
.InnerJoin((opri, opri2) => opri.MaxId == opri2.Id) |
|
|
|
.ToList((opri, opri2) => opri2); |
|
|
|
var purchaseOrderIdList = recentOrderPurchaserRelationList.Select(x => x.PurchaseOrderId).Distinct().ToList(); |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 采购次数
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 采购件数
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 采购金额
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
fsql.Transaction(() => |
|
|
|
{ |
|
|
|