|
@ -4,15 +4,12 @@ using BBWY.Server.Model; |
|
|
using BBWY.Server.Model.Db; |
|
|
using BBWY.Server.Model.Db; |
|
|
using BBWY.Server.Model.Dto; |
|
|
using BBWY.Server.Model.Dto; |
|
|
using FreeSql; |
|
|
using FreeSql; |
|
|
using Microsoft.Extensions.Options; |
|
|
|
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using QuanTan.SDK.Model; |
|
|
using QuanTan.SDK.Model; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Linq.Expressions; |
|
|
|
|
|
using System.Text.RegularExpressions; |
|
|
|
|
|
using System.Threading; |
|
|
using System.Threading; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using Yitter.IdGenerator; |
|
|
using Yitter.IdGenerator; |
|
@ -394,7 +391,12 @@ namespace BBWY.Server.Business |
|
|
private void DeliveryCallbackFrom1688(JObject jObject) |
|
|
private void DeliveryCallbackFrom1688(JObject jObject) |
|
|
{ |
|
|
{ |
|
|
var purchaseOrderId = jObject["data"].Value<string>("orderId"); |
|
|
var purchaseOrderId = jObject["data"].Value<string>("orderId"); |
|
|
Task.Factory.StartNew(() => DeliveryCallback(purchaseOrderId, null, Enums.Platform.阿里巴巴), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler); |
|
|
|
|
|
|
|
|
//处理一键代发的回调
|
|
|
|
|
|
//Task.Factory.StartNew(() => DeliveryCallback(purchaseOrderId, null, Enums.Platform.阿里巴巴), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler);
|
|
|
|
|
|
|
|
|
|
|
|
//处理采购单的回调
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
@ -417,11 +419,18 @@ namespace BBWY.Server.Business |
|
|
LogisticsCompanyName = request.ExpressName, |
|
|
LogisticsCompanyName = request.ExpressName, |
|
|
WayBillNo = request.WayBillNo, |
|
|
WayBillNo = request.WayBillNo, |
|
|
}, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler); |
|
|
}, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler); |
|
|
|
|
|
|
|
|
|
|
|
//Task.Factory.StartNew(() => DeliveryCallbackForPurchaseOrder(request.OrderId, new WayBillNoResponse()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// LogisticsCompanyId = request.ExpressId,
|
|
|
|
|
|
// LogisticsCompanyName = request.ExpressName,
|
|
|
|
|
|
// WayBillNo = request.WayBillNo,
|
|
|
|
|
|
//}, Enums.Platform.拳探), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.PurchaseOrderCallbackTaskScheduler);
|
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 采购平台发货回调
|
|
|
/// 采购平台发货回调(一件代发)
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="purchaseOrderId"></param>
|
|
|
/// <param name="purchaseOrderId"></param>
|
|
|
/// <param name="wayBillNoResponse"></param>
|
|
|
/// <param name="wayBillNoResponse"></param>
|
|
@ -533,26 +542,29 @@ namespace BBWY.Server.Business |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
/// <summary>
|
|
|
///// 物流公司翻译, 将发货平台的物流公司翻译为店铺平台的物流公司
|
|
|
/// 采购平台发货回调(采购单)
|
|
|
///// </summary>
|
|
|
/// </summary>
|
|
|
///// <param name="sourceLogisticsCompanyName"></param>
|
|
|
/// <param name="purchaseOrderId"></param>
|
|
|
///// <param name="targetLogisticsList"></param>
|
|
|
/// <param name="wayBillNoResponse"></param>
|
|
|
///// <param name="tagetLogisticsPlatform"></param>
|
|
|
/// <param name="callbackPlatform"></param>
|
|
|
///// <returns></returns>
|
|
|
private void DeliveryCallbackForPurchaseOrder(string purchaseOrderId, WayBillNoResponse wayBillNoResponse, Enums.Platform callbackPlatform) |
|
|
//private string ConvertLogisticsCompanyId(string sourceLogisticsCompanyName, IList<LogisticsResponse> targetLogisticsList, Enums.Platform tagetLogisticsPlatform)
|
|
|
{ |
|
|
//{
|
|
|
var msg = $"DeliveryCallbackForPurchaseOrder purchaseOrderId:{purchaseOrderId},wayBillNoResponse:{JsonConvert.SerializeObject(wayBillNoResponse)},callbackPlatform:{callbackPlatform}"; |
|
|
// var match = Regex.Match(sourceLogisticsCompanyName, "(中通|圆通|申通|顺丰|韵达|邮政快递包裹|平邮|EMS|德邦|百世|天天|优速)");
|
|
|
try |
|
|
// if (match.Success)
|
|
|
{ |
|
|
// {
|
|
|
nLogManager.Default().Info(msg); |
|
|
// var sname = match.Groups[1].Value;
|
|
|
|
|
|
// var targetLogistics = targetLogisticsList.FirstOrDefault(t => t.Name.Contains(sname));
|
|
|
var purchaseOrderV2 = fsql.Select<PurchaseOrderV2>(purchaseOrderId).ToOne(); |
|
|
// if (targetLogistics != null)
|
|
|
if (purchaseOrderV2 == null) |
|
|
// return targetLogistics.Id;
|
|
|
throw new Exception("未查询到采购单信息"); |
|
|
// }
|
|
|
|
|
|
// return deliverySelfDic[tagetLogisticsPlatform];
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
nLogManager.Default().Error(ex, msg); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 采购平台改价回调
|
|
|
/// 采购平台改价回调
|
|
|