diff --git a/BBWY.Server.API/Controllers/OrderSyncController.cs b/BBWY.Server.API/Controllers/OrderSyncController.cs index 9c40184b..4f802c36 100644 --- a/BBWY.Server.API/Controllers/OrderSyncController.cs +++ b/BBWY.Server.API/Controllers/OrderSyncController.cs @@ -31,7 +31,7 @@ namespace BBWY.Server.API.Controllers [HttpPost("{shopId}/{orderId}")] public void SyncOrder([FromRoute] long shopId, [FromRoute] string orderId) { - orderSyncBusiness.SyncOrder(shopId, orderId, null, null); + orderSyncBusiness.ManualSyncOrder(shopId, orderId, null, null); } /// diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs index 1175ddab..834bef12 100644 --- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs @@ -47,22 +47,20 @@ namespace BBWY.Server.Business { Enums.Platform.京东, SyncJDOrder } }; } - /// - /// 同步订单 + /// 手动同步订单 /// /// /// - /// 默认3小时前 - /// 默认当前时间 - /// - public void SyncOrder(long shopId, string orderId, DateTime? startTime = null, DateTime? endTime = null) + /// + /// + public void ManualSyncOrder(long shopId, string orderId, DateTime? startTime = null, DateTime? endTime = null) { var shop = venderBusiness.GetShopByShopId(shopId.ToString()); - SyncOrder(shop, orderId, startTime, endTime); + SyncOrder(shop, orderId, startTime, endTime, isAuto: false, Enums.SortTimeType.StartTime); } - private void SyncOrder(ShopResponse shop, string orderId, DateTime? startTime = null, DateTime? endTime = null, bool isAuto = false) + private void SyncOrder(ShopResponse shop, string orderId, DateTime? startTime = null, DateTime? endTime = null, bool isAuto = false, Enums.SortTimeType? sortTimeType = null) { try { @@ -83,7 +81,8 @@ namespace BBWY.Server.Business Platform = shop.PlatformId, JDColType = string.IsNullOrEmpty(shop.ShopType) ? "0" : shop.ShopType, //SaveResponseLog = true, - OrderId = orderId + OrderId = orderId, + SortTimeType = sortTimeType }, null, HttpMethod.Post); if (orderListApiResult.StatusCode != System.Net.HttpStatusCode.OK) throw new Exception($"获取订单失败 {orderListApiResult.Content}"); @@ -130,7 +129,7 @@ namespace BBWY.Server.Business { try { - SyncOrder(syncOrderByDateRequest.ShopId, String.Empty, currentStartTime, currentEndTime); + ManualSyncOrder(syncOrderByDateRequest.ShopId, string.Empty, currentStartTime, currentEndTime); } catch (Exception ex) { } finally