步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.7 KiB

3 years ago
using BBWY.Common.Http;
using BBWY.Common.Models;
using BBWY.Server.Model;
using BBWY.Server.Model.Dto;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using NLog;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yitter.IdGenerator;
namespace BBWY.Server.Business
{
public class AfterSaleOrderSyncBusiness : BaseSyncBusiness, IDenpendency
{
private IDictionary<Enums.Platform, Action<JArray, ShopResponse>> syncAfterSaleOrderMethodDic;
public AfterSaleOrderSyncBusiness(RestApiService restApiService,
IOptions<GlobalConfig> options,
ILogger logger,
IFreeSql fsql,
IIdGenerator idGenerator,
TaskSchedulerManager taskSchedulerManager,
VenderBusiness venderBusiness) : base(restApiService,
options,
logger,
fsql,
idGenerator,
taskSchedulerManager,
venderBusiness)
{
syncAfterSaleOrderMethodDic = new Dictionary<Enums.Platform, Action<JArray, ShopResponse>>()
{
{ Enums.Platform., SyncJDAfterOrder }
};
}
private void SyncJDAfterOrder(JArray refundOrderTokenJArray, ShopResponse shopResponse)
{
}
private void SyncAfterOrder(ShopResponse shop, string orderId, DateTime? startTime = null, DateTime? endTime = null, bool isAuto = false)
{
}
public void SyncAllShopAfterOrder()
{
var shopList = venderBusiness.GetShopList();
//SyncRefundOrder(shopList.FirstOrDefault(s => s.ShopName == "布莱特玩具专营店"), string.Empty, isAuto: true);
foreach (var shop in shopList)
{
Task.Factory.StartNew(() => SyncAfterOrder(shop, string.Empty, isAuto: true),
System.Threading.CancellationToken.None,
TaskCreationOptions.LongRunning,
taskSchedulerManager.SyncAfterOrderTaskScheduler);
}
}
}
}