|
@ -15,6 +15,7 @@ using BBWY.Server.Business.Extensions; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using System.Net.Http; |
|
|
using System.Net.Http; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using Org.BouncyCastle.Crypto.Signers; |
|
|
|
|
|
|
|
|
namespace BBWY.Server.Business |
|
|
namespace BBWY.Server.Business |
|
|
{ |
|
|
{ |
|
@ -25,6 +26,7 @@ namespace BBWY.Server.Business |
|
|
private IFreeSql fsql; |
|
|
private IFreeSql fsql; |
|
|
private OrderSyncBusiness orderSyncBusiness; |
|
|
private OrderSyncBusiness orderSyncBusiness; |
|
|
private TaskSchedulerManager taskSchedulerManager; |
|
|
private TaskSchedulerManager taskSchedulerManager; |
|
|
|
|
|
private PurchaseOrderBusiness purchaseOrderBusiness; |
|
|
public TestBusiness(RestApiService restApiService, |
|
|
public TestBusiness(RestApiService restApiService, |
|
|
IOptions<GlobalConfig> options, |
|
|
IOptions<GlobalConfig> options, |
|
|
FreeSqlMultiDBManager freeSqlMultiDBManager, |
|
|
FreeSqlMultiDBManager freeSqlMultiDBManager, |
|
@ -32,13 +34,15 @@ namespace BBWY.Server.Business |
|
|
YunDingBusiness yunDingBusiness, |
|
|
YunDingBusiness yunDingBusiness, |
|
|
IFreeSql fsql, |
|
|
IFreeSql fsql, |
|
|
OrderSyncBusiness orderSyncBusiness, |
|
|
OrderSyncBusiness orderSyncBusiness, |
|
|
TaskSchedulerManager taskSchedulerManager) : base(restApiService, options, yunDingBusiness) |
|
|
TaskSchedulerManager taskSchedulerManager, |
|
|
|
|
|
PurchaseOrderBusiness purchaseOrderBusiness) : base(restApiService, options, yunDingBusiness) |
|
|
{ |
|
|
{ |
|
|
this.freeSqlMultiDBManager = freeSqlMultiDBManager; |
|
|
this.freeSqlMultiDBManager = freeSqlMultiDBManager; |
|
|
this.venderBusiness = venderBusiness; |
|
|
this.venderBusiness = venderBusiness; |
|
|
this.fsql = fsql; |
|
|
this.fsql = fsql; |
|
|
this.orderSyncBusiness = orderSyncBusiness; |
|
|
this.orderSyncBusiness = orderSyncBusiness; |
|
|
this.taskSchedulerManager = taskSchedulerManager; |
|
|
this.taskSchedulerManager = taskSchedulerManager; |
|
|
|
|
|
this.purchaseOrderBusiness = purchaseOrderBusiness; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void SyncVenderId() |
|
|
public void SyncVenderId() |
|
@ -385,6 +389,25 @@ namespace BBWY.Server.Business |
|
|
if (!response.Success) |
|
|
if (!response.Success) |
|
|
throw new BusinessException(response.Msg); |
|
|
throw new BusinessException(response.Msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void RepairDFOrder() |
|
|
|
|
|
{ |
|
|
|
|
|
var st = DateTime.Parse("2023-11-01"); |
|
|
|
|
|
var et = DateTime.Parse("2023-11-30 23:59:59"); |
|
|
|
|
|
var list = fsql.Select<Order, OrderDropShipping, OrderCostDetail>() |
|
|
|
|
|
.InnerJoin((o, ods, ocd) => o.Id == ods.OrderId) |
|
|
|
|
|
.InnerJoin((o, ods, ocd) => o.Id == ocd.OrderId) |
|
|
|
|
|
.Where((o, ods, ocd) => o.ShopId == 11817258 && o.OrderState != Enums.OrderState.已取消 && o.StartTime >= st && o.StartTime <= et && o.StorageType == Enums.StorageType.代发 && ocd.IsEnabled == true && ocd.SkuAmount == 0) |
|
|
|
|
|
.ToList((o, ods, ocd) => ods.PurchaseOrderId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < list.Count; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
Console.WriteLine($"{i + 1}/{list.Count()},{list[i]}"); |
|
|
|
|
|
var param = new { type = "ORDER_BUYER_VIEW_ORDER_PRICE_MODIFY", data = new { orderId = list[i] } }; |
|
|
|
|
|
purchaseOrderBusiness.CallbackFrom1688(JsonConvert.SerializeObject(param)); |
|
|
|
|
|
Thread.Sleep(1000); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public class JPCount |
|
|
public class JPCount |
|
|