|
@ -411,7 +411,7 @@ namespace BBWY.Server.Business |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region 拳探回调
|
|
|
#region 拳探回调
|
|
|
public void QuanTan_SendGoodsCallback(QuanTanSendGoodsNotifyRequest request) |
|
|
public void QuanTanSendGoodsCallback(QuanTanSendGoodsNotifyRequest request) |
|
|
{ |
|
|
{ |
|
|
Task.Factory.StartNew(() => DeliveryCallback(request.OrderId, new WayBillNoResponse() |
|
|
Task.Factory.StartNew(() => DeliveryCallback(request.OrderId, new WayBillNoResponse() |
|
|
{ |
|
|
{ |
|
@ -427,6 +427,14 @@ namespace BBWY.Server.Business |
|
|
// WayBillNo = request.WayBillNo,
|
|
|
// WayBillNo = request.WayBillNo,
|
|
|
//}, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler);
|
|
|
//}, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void QuanTanEditPriceCallback(QuanTanEditPriceNotifyRequest request) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
//Task.Factory.StartNew(() => OrderPriceModificationCallback(request.OrderId, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler);
|
|
|
|
|
|
|
|
|
|
|
|
Task.Factory.StartNew(() => OrderPriceNotifitionForPurchaseOrder(request.OrderId, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler); |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
@ -567,7 +575,7 @@ namespace BBWY.Server.Business |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 采购平台改价回调
|
|
|
/// 采购平台改价回调(一件代发)
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="purchaseOrderId"></param>
|
|
|
/// <param name="purchaseOrderId"></param>
|
|
|
/// <param name="callbackPlatform"></param>
|
|
|
/// <param name="callbackPlatform"></param>
|
|
@ -706,6 +714,63 @@ namespace BBWY.Server.Business |
|
|
nLogManager.Default().Error(ex, $"OrderPriceModificationCallback 回调平台{callbackPlatform},采购单号{purchaseOrderId},执行进度[{currentProgress}]"); |
|
|
nLogManager.Default().Error(ex, $"OrderPriceModificationCallback 回调平台{callbackPlatform},采购单号{purchaseOrderId},执行进度[{currentProgress}]"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 采购平台改价回调(采购单)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="purchaseOrderId"></param>
|
|
|
|
|
|
/// <param name="callbackPlatform"></param>
|
|
|
|
|
|
private void OrderPriceNotifitionForPurchaseOrder(string purchaseOrderId, Enums.Platform callbackPlatform) |
|
|
|
|
|
{ |
|
|
|
|
|
string currentProgress = string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
#region 查询数据库采购单
|
|
|
|
|
|
var purchaseOrder = fsql.Select<PurchaseOrderV2>(purchaseOrderId).ToOne(); |
|
|
|
|
|
if (purchaseOrder == null) |
|
|
|
|
|
throw new Exception($"未查询到采购单"); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 查询采购账号
|
|
|
|
|
|
currentProgress = "查询采购账号"; |
|
|
|
|
|
var purchaseAccount = fsql.Select<PurchaseAccount>().Where(pa => pa.Id == purchaseOrder.PurchaseAccountId).ToOne(); |
|
|
|
|
|
if (purchaseAccount == null) |
|
|
|
|
|
throw new Exception($"未查询到采购账号"); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 查询接口采购单
|
|
|
|
|
|
var purchaseOrderSimpleInfo = platformSDKBusinessList.FirstOrDefault(p => p.Platform == callbackPlatform).GetOrderSimpleInfo(new GetOrderInfoRequest() |
|
|
|
|
|
{ |
|
|
|
|
|
AppKey = purchaseAccount.AppKey, |
|
|
|
|
|
AppSecret = purchaseAccount.AppSecret, |
|
|
|
|
|
AppToken = purchaseAccount.AppToken, |
|
|
|
|
|
OrderId = purchaseOrderId, |
|
|
|
|
|
Platform = callbackPlatform |
|
|
|
|
|
}); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
fsql.Transaction(() => |
|
|
|
|
|
{ |
|
|
|
|
|
fsql.Update<PurchaseOrderV2>(purchaseOrderId).Set(po => po.ProductAmount, purchaseOrderSimpleInfo.ProductAmount) |
|
|
|
|
|
.Set(po => po.PurchaseFreight, purchaseOrderSimpleInfo.FreightAmount) |
|
|
|
|
|
.Set(po => po.PurchaseAmount, purchaseOrderSimpleInfo.TotalAmount) |
|
|
|
|
|
.ExecuteAffrows(); |
|
|
|
|
|
foreach (var purchaseOrderSku in purchaseOrderSimpleInfo.ItemList) |
|
|
|
|
|
{ |
|
|
|
|
|
fsql.Update<PurchaseOrderSku>().Where(pos => pos.PurchaseOrderId == purchaseOrderId && pos.PurchaseSkuIds == purchaseOrderSku.SkuId) |
|
|
|
|
|
.Set(pos => pos.ProductAmount, purchaseOrderSku.ProductAmount) |
|
|
|
|
|
.Set(pos => pos.PurchaseFreight, purchaseOrderSku.FreightAmount) |
|
|
|
|
|
.Set(pos => pos.PurchaseAmount, purchaseOrderSku.ProductAmount + purchaseOrderSku.FreightAmount) |
|
|
|
|
|
.ExecuteAffrows(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
nLogManager.Default().Error(ex, $"OrderPriceNotifitionForPurchaseOrder 回调平台{callbackPlatform},采购单号{purchaseOrderId},执行进度[{currentProgress}]"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|