73 lines
1.9 KiB
C#
73 lines
1.9 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// 拉取微信订单 - 任务数据服务。
|
|
/// </summary>
|
|
public class PullWXOrderService
|
|
{
|
|
|
|
private static readonly Lazy<PullWXOrderService> _lazy = new Lazy<PullWXOrderService>(() => new PullWXOrderService());
|
|
|
|
/// <summary>单例(全局共享同一份任务列表)</summary>
|
|
public static PullWXOrderService Instance => _lazy.Value;
|
|
|
|
private readonly PullWXOrderServiceApi _erpApi = new PullWXOrderServiceApi();
|
|
private long _seq;
|
|
public PullWXOrderService()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 拉取指定店铺的指定订单
|
|
/// </summary>
|
|
public async Task<bool> PullOrderDetailAsync(long shopId, string orderId)
|
|
{
|
|
return await _erpApi.PullOrderDetail(shopId, orderId);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 按店铺与时间范围拉取订单
|
|
/// </summary>
|
|
public Task<bool> PullOrderByShopIdsAndTimeRangeAsync(long[] shopIds, DateTime startTime, DateTime endTime)
|
|
{
|
|
return _erpApi.PullOrderByShopIdsAndTimeRange(shopIds, startTime, endTime);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拉取指定店铺的售后订单
|
|
/// </summary>
|
|
public Task<bool> PullRefundOrderByShopsAsync(long[] shopIds, DateTime startTime, DateTime endTime)
|
|
{
|
|
return _erpApi.PullRefundOrder(shopIds, startTime, endTime);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拉取指定店铺的多个售后订单
|
|
/// </summary>
|
|
public Task<bool> PullAfterSaleOrdersAsync(long shopId, string[] afterSaleOrderIds)
|
|
{
|
|
return _erpApi.PullAfterSaleOrders(shopId, afterSaleOrderIds);
|
|
}
|
|
}
|
|
}
|