|
|
@ -190,11 +190,17 @@ namespace BBWY.Server.Business |
|
|
|
fsql.Update<OrderSku>().Set(osku => osku.ShouldPay, 0).Where(osku => orderIdList.Contains(osku.OrderId)).ExecuteAffrows(); |
|
|
|
}); |
|
|
|
|
|
|
|
foreach (var orderId in orderIdList) |
|
|
|
for (var i = 0; i < orderIdList.Count(); i++) |
|
|
|
{ |
|
|
|
var orderId = orderIdList[i]; |
|
|
|
orderSyncBusiness.SyncOrder(shop, orderId); |
|
|
|
Thread.Sleep(1000); |
|
|
|
Console.WriteLine($"shopProgress {shopIndex}/{shopList.Count()} {shop.ShopName},orderProgress {i + 1}/{orderIdList.Count()}"); |
|
|
|
} |
|
|
|
// foreach (var orderId in orderIdList)
|
|
|
|
// {
|
|
|
|
// orderSyncBusiness.SyncOrder(shop, orderId);
|
|
|
|
// Thread.Sleep(1000);
|
|
|
|
// }
|
|
|
|
|
|
|
|
var orderList = fsql.Select<Order>(orderIdList).ToList(); |
|
|
|
var orderSkuList = fsql.Select<OrderSku>().Where(osku => osku.Price > 0 && orderIdList.Contains(osku.OrderId)).ToList(); |
|
|
@ -217,7 +223,8 @@ namespace BBWY.Server.Business |
|
|
|
foreach (var orderSku in currentOrderSkuList) |
|
|
|
{ |
|
|
|
var ocd = currentOrderCostDetailList.FirstOrDefault(x => x.SkuId == orderSku.SkuId); |
|
|
|
|
|
|
|
if (ocd != null) |
|
|
|
{ |
|
|
|
ocd.CalculationSkuGrossProfit(orderSku.ShouldPay ?? 0M, |
|
|
|
orderSku.PingTaiChengDanYouHuiQuan ?? 0M, |
|
|
|
orderSku.SuperRedEnvelope ?? 0M, |
|
|
@ -227,9 +234,12 @@ namespace BBWY.Server.Business |
|
|
|
var update = fsql.Update<OrderCostDetail>(ocd.Id).Set(x => x.SkuGrossProfit, ocd.SkuGrossProfit); |
|
|
|
updateOrderCostDetailList.Add(update); |
|
|
|
} |
|
|
|
} |
|
|
|
var currentAfterOrderList = afterOrderList.Where(af => af.OrderId == order.Id).ToList(); |
|
|
|
var orderTotal = orderTotalList.FirstOrDefault(on => on.Id == order.Id); |
|
|
|
var orderCost = orderCostList.FirstOrDefault(oc => oc.OrderId == order.Id); |
|
|
|
if (orderCost != null && orderTotal != null) |
|
|
|
{ |
|
|
|
orderCost.CalculationOrderProfitAndCost(order.ActualProductAmount ?? 0M, |
|
|
|
orderTotal.TotalPingTaiChengDanYouHuiQuan ?? 0M, |
|
|
|
orderTotal.TotalVenderFee ?? 0M, |
|
|
@ -245,6 +255,8 @@ namespace BBWY.Server.Business |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|