From 75c6753d86510a572736416955f12ea47788536e Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Wed, 3 May 2023 13:57:53 +0800 Subject: [PATCH 1/2] 1 --- .../PurchaseOrder/PurchaseOrderBusiness.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs index 302c74ae..a8a5b56e 100644 --- a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs @@ -4,15 +4,12 @@ using BBWY.Server.Model; using BBWY.Server.Model.Db; using BBWY.Server.Model.Dto; using FreeSql; -using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using QuanTan.SDK.Model; using System; using System.Collections.Generic; using System.Linq; -using System.Linq.Expressions; -using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Yitter.IdGenerator; @@ -394,7 +391,12 @@ namespace BBWY.Server.Business private void DeliveryCallbackFrom1688(JObject jObject) { var purchaseOrderId = jObject["data"].Value("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); + + //处理采购单的回调 + } /// From ffa9cd871ce85b4df6c72c9a2d2ace4e615340e5 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Thu, 4 May 2023 02:49:57 +0800 Subject: [PATCH 2/2] 1 --- .../PurchaseOrder/PurchaseOrderBusiness.cs | 50 +++++++++++-------- .../BatchPurchase/BatchPurchaseBusiness.cs | 2 - 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs index a8a5b56e..c2ba10c9 100644 --- a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs @@ -419,11 +419,18 @@ namespace BBWY.Server.Business LogisticsCompanyName = request.ExpressName, WayBillNo = request.WayBillNo, }, 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 /// - /// 采购平台发货回调 + /// 采购平台发货回调(一件代发) /// /// /// @@ -535,26 +542,29 @@ namespace BBWY.Server.Business } } - ///// - ///// 物流公司翻译, 将发货平台的物流公司翻译为店铺平台的物流公司 - ///// - ///// - ///// - ///// - ///// - //private string ConvertLogisticsCompanyId(string sourceLogisticsCompanyName, IList targetLogisticsList, Enums.Platform tagetLogisticsPlatform) - //{ - // var match = Regex.Match(sourceLogisticsCompanyName, "(中通|圆通|申通|顺丰|韵达|邮政快递包裹|平邮|EMS|德邦|百世|天天|优速)"); - // if (match.Success) - // { - // var sname = match.Groups[1].Value; - // var targetLogistics = targetLogisticsList.FirstOrDefault(t => t.Name.Contains(sname)); - // if (targetLogistics != null) - // return targetLogistics.Id; - // } - // return deliverySelfDic[tagetLogisticsPlatform]; - //} + /// + /// 采购平台发货回调(采购单) + /// + /// + /// + /// + private void DeliveryCallbackForPurchaseOrder(string purchaseOrderId, WayBillNoResponse wayBillNoResponse, Enums.Platform callbackPlatform) + { + var msg = $"DeliveryCallbackForPurchaseOrder purchaseOrderId:{purchaseOrderId},wayBillNoResponse:{JsonConvert.SerializeObject(wayBillNoResponse)},callbackPlatform:{callbackPlatform}"; + try + { + nLogManager.Default().Info(msg); + + var purchaseOrderV2 = fsql.Select(purchaseOrderId).ToOne(); + if (purchaseOrderV2 == null) + throw new Exception("未查询到采购单信息"); + } + catch (Exception ex) + { + nLogManager.Default().Error(ex, msg); + } + } /// /// 采购平台改价回调 diff --git a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs index 4166ce8f..6a6d27e3 100644 --- a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs @@ -3,7 +3,6 @@ using BBWY.Server.Model; using BBWY.Server.Model.Db; using BBWY.Server.Model.Dto; using FreeSql; -using Jd.Api.Domain; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; @@ -11,7 +10,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using Yitter.IdGenerator; -using static System.Net.Mime.MediaTypeNames; namespace BBWY.Server.Business {