Browse Source

修复预估数据问题

pjzs_starttask_update
shanji 2 years ago
parent
commit
77cc420552
  1. 3
      BBWY.Server.Business/Sync/OrderEstimateCostSyncBusiness.cs
  2. 4
      BBWY.Server.Business/Sync/OrderSyncBusiness.cs

3
BBWY.Server.Business/Sync/OrderEstimateCostSyncBusiness.cs

@ -267,13 +267,14 @@ namespace BBWY.Server.Business
{
try
{
var jcycStorageTypeList = new List<Enums.StorageType?>() { Enums.StorageType., Enums.StorageType. };
var shopId = long.Parse(shop.ShopId);
var orderList = fsql.Select<Order>().Where(o => o.ShopId == shopId &&
o.ModifyTime >= startTime &&
o.ModifyTime <= endTime &&
!invalidOrderStateList.Contains(o.OrderState) &&
o.IsGift == false &&
o.StorageType == null &&
(o.StorageType == null || jcycStorageTypeList.Contains(o.StorageType)) &&
!fsql.Select<OrderCost>().Where(oc => oc.OrderId == o.Id).Any())
.ToList();
Console.WriteLine($"预估成本-{shop.ShopName},符合条件且没有成本的订单一共{orderList.Count()}个");

4
BBWY.Server.Business/Sync/OrderSyncBusiness.cs

@ -915,6 +915,9 @@ namespace BBWY.Server.Business
#endregion
#region 计算成本
//当具备订单明细成本的时候,才为其创建订单成本
if (insertOrderCostDetailList.Any(iocd => iocd.OrderId == orderId))
{
orderCost = new OrderCost()
{
OrderId = orderId,
@ -932,6 +935,7 @@ namespace BBWY.Server.Business
orderCost.CalculationOrderProfitAndCost(actualAmount, null);
insertOrderCostList.Add(orderCost);
}
#endregion
}
}

Loading…
Cancel
Save