using AllBase; using AllBase.Util; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Work.ERP.API; using Work.ERP.API.Orders; using Work.KJDServer.API.Models; using Work.KJDServer.API.WXOrder; using ServerTaskStatus = Work.ERP.API.TaskStatus; namespace _29WxOrderWpf.Services { /// /// 拉取微信订单 - 任务数据服务。 /// public class PullWXOrderService { private static readonly Lazy _lazy = new Lazy(() => new PullWXOrderService()); /// 单例(全局共享同一份任务列表) public static PullWXOrderService Instance => _lazy.Value; private readonly PullWXOrderServiceApi _erpApi = new PullWXOrderServiceApi(); private long _seq; public PullWXOrderService() { } /// /// 拉取指定店铺的指定订单 /// public async Task PullOrderDetailAsync(long shopId, string orderId) { return await _erpApi.PullOrderDetail(shopId, orderId); } /// /// 按店铺与时间范围拉取订单 /// public Task PullOrderByShopIdsAndTimeRangeAsync(long[] shopIds, DateTime startTime, DateTime endTime) { return _erpApi.PullOrderByShopIdsAndTimeRange(shopIds, startTime, endTime); } /// /// 拉取指定店铺的售后订单 /// public Task PullRefundOrderByShopsAsync(long[] shopIds, DateTime startTime, DateTime endTime) { return _erpApi.PullRefundOrder(shopIds, startTime, endTime); } /// /// 拉取指定店铺的多个售后订单 /// public Task PullAfterSaleOrdersAsync(long shopId, string[] afterSaleOrderIds) { return _erpApi.PullAfterSaleOrders(shopId, afterSaleOrderIds); } } }