|
@ -47,22 +47,20 @@ namespace BBWY.Server.Business |
|
|
{ Enums.Platform.京东, SyncJDOrder } |
|
|
{ Enums.Platform.京东, SyncJDOrder } |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 同步订单
|
|
|
/// 手动同步订单
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="shopId"></param>
|
|
|
/// <param name="shopId"></param>
|
|
|
/// <param name="orderId"></param>
|
|
|
/// <param name="orderId"></param>
|
|
|
/// <param name="startTime">默认3小时前</param>
|
|
|
/// <param name="startTime"></param>
|
|
|
/// <param name="endTime">默认当前时间</param>
|
|
|
/// <param name="endTime"></param>
|
|
|
/// <exception cref="Exception"></exception>
|
|
|
public void ManualSyncOrder(long shopId, string orderId, DateTime? startTime = null, DateTime? endTime = null) |
|
|
public void SyncOrder(long shopId, string orderId, DateTime? startTime = null, DateTime? endTime = null) |
|
|
|
|
|
{ |
|
|
{ |
|
|
var shop = venderBusiness.GetShopByShopId(shopId.ToString()); |
|
|
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 |
|
|
try |
|
|
{ |
|
|
{ |
|
@ -83,7 +81,8 @@ namespace BBWY.Server.Business |
|
|
Platform = shop.PlatformId, |
|
|
Platform = shop.PlatformId, |
|
|
JDColType = string.IsNullOrEmpty(shop.ShopType) ? "0" : shop.ShopType, |
|
|
JDColType = string.IsNullOrEmpty(shop.ShopType) ? "0" : shop.ShopType, |
|
|
//SaveResponseLog = true,
|
|
|
//SaveResponseLog = true,
|
|
|
OrderId = orderId |
|
|
OrderId = orderId, |
|
|
|
|
|
SortTimeType = sortTimeType |
|
|
}, null, HttpMethod.Post); |
|
|
}, null, HttpMethod.Post); |
|
|
if (orderListApiResult.StatusCode != System.Net.HttpStatusCode.OK) |
|
|
if (orderListApiResult.StatusCode != System.Net.HttpStatusCode.OK) |
|
|
throw new Exception($"获取订单失败 {orderListApiResult.Content}"); |
|
|
throw new Exception($"获取订单失败 {orderListApiResult.Content}"); |
|
@ -130,7 +129,7 @@ namespace BBWY.Server.Business |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
SyncOrder(syncOrderByDateRequest.ShopId, String.Empty, currentStartTime, currentEndTime); |
|
|
ManualSyncOrder(syncOrderByDateRequest.ShopId, string.Empty, currentStartTime, currentEndTime); |
|
|
} |
|
|
} |
|
|
catch (Exception ex) { } |
|
|
catch (Exception ex) { } |
|
|
finally |
|
|
finally |
|
|