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.
83 lines
3.3 KiB
83 lines
3.3 KiB
using BBWYB.Client.Models;
|
|
using BBWYB.Common.Http;
|
|
using BBWYB.Common.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
|
|
namespace BBWYB.Client.APIServices
|
|
{
|
|
public class OrderService : BaseApiService, IDenpendency
|
|
{
|
|
public OrderService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
|
|
{
|
|
}
|
|
|
|
public ApiResponse<OrderListResponse> GetOrderList(string orderId,
|
|
DateTime startDate,
|
|
DateTime endDate,
|
|
OrderState? orderState,
|
|
string productId,
|
|
string skuId,
|
|
string clientOrderId,
|
|
string purchaseOrderId,
|
|
string sourceShopName,
|
|
string sourceSku,
|
|
int pageIndex,
|
|
int pageSize,
|
|
long? shopId,
|
|
bool excludeCanceled)
|
|
{
|
|
return SendRequest<OrderListResponse>(globalContext.BBWYApiHost, "api/order/getorderlist", new
|
|
{
|
|
orderId,
|
|
shopId,
|
|
startDate,
|
|
endDate,
|
|
orderState,
|
|
pageIndex,
|
|
pageSize,
|
|
productId,
|
|
Sku = skuId,
|
|
clientOrderId,
|
|
purchaseOrderId,
|
|
sourceShopName,
|
|
sourceSku
|
|
}, null, HttpMethod.Post);
|
|
}
|
|
|
|
public ApiResponse<object> CancelOrder(string orderId, string remark)
|
|
{
|
|
return SendRequest<object>(globalContext.BBWYApiHost, "api/order/CancelOrder", new
|
|
{
|
|
orderId,
|
|
remark,
|
|
globalContext.User.Shop.AppKey,
|
|
globalContext.User.Shop.AppSecret,
|
|
globalContext.User.Shop.AppToken,
|
|
globalContext.User.Shop.Platform
|
|
}, null, HttpMethod.Post);
|
|
}
|
|
|
|
public ApiResponse<object> EditPrice(string orderId, IList<OrderSkuEditPrice> orderSkuList)
|
|
{
|
|
return SendRequest<object>(globalContext.BBWYApiHost, "api/order/EditPrice", new
|
|
{
|
|
orderId,
|
|
EditItems = orderSkuList.Select(osku => new
|
|
{
|
|
OrderSkuId = osku.Id,
|
|
SkuId = osku.SkuId,
|
|
Price = osku.NewPrice,
|
|
Freight = osku.FreightAmount,
|
|
Quantity = osku.ItemTotal
|
|
}),
|
|
globalContext.User.Shop.AppKey,
|
|
globalContext.User.Shop.AppSecret,
|
|
globalContext.User.Shop.AppToken,
|
|
globalContext.User.Shop.Platform
|
|
}, null, HttpMethod.Post);
|
|
}
|
|
}
|
|
}
|
|
|