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.
130 lines
5.3 KiB
130 lines
5.3 KiB
3 years ago
|
using BBWY.Client.Models;
|
||
|
using BBWY.Common.Http;
|
||
|
using BBWY.Common.Models;
|
||
|
using System;
|
||
|
using System.Net.Http;
|
||
|
|
||
|
namespace BBWY.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 sku,
|
||
|
string productNo,
|
||
|
string waybill,
|
||
|
string contactName,
|
||
|
int pageIndex, int pageSize,
|
||
|
long shopId)
|
||
|
{
|
||
|
return SendRequest<OrderListResponse>(globalContext.BBYWApiHost, "api/order/getOrderList", new
|
||
|
{
|
||
|
orderId,
|
||
|
startDate,
|
||
|
EndDate = endDate.Date.AddDays(1).AddSeconds(-1),
|
||
|
orderState,
|
||
|
pageIndex,
|
||
|
pageSize,
|
||
|
shopId,
|
||
|
sku,
|
||
|
productNo,
|
||
|
waybill,
|
||
|
contactName
|
||
|
}, null, HttpMethod.Post);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 解密收货人信息
|
||
|
/// </summary>
|
||
|
/// <param name="orderId"></param>
|
||
|
/// <returns></returns>
|
||
|
public ApiResponse<ConsigneeSimpleResponse> DecodeConsignee(string orderId)
|
||
|
{
|
||
|
return SendRequest<ConsigneeSimpleResponse>(globalContext.BBYWApiHost, "Api/Order/DecryptConsignee", new
|
||
|
{
|
||
|
globalContext.User.Shop.Platform,
|
||
|
globalContext.User.Shop.AppKey,
|
||
|
globalContext.User.Shop.AppSecret,
|
||
|
globalContext.User.Shop.AppToken,
|
||
|
saveResponseLog = true,
|
||
|
orderId,
|
||
|
saveDb = true
|
||
|
}, null, HttpMethod.Post);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 自动计算成本
|
||
|
/// </summary>
|
||
|
/// <param name="orderId"></param>
|
||
|
/// <param name="isSetStorageType">是否设置仓储类型</param>
|
||
|
/// <param name="storageType"></param>
|
||
|
/// <returns></returns>
|
||
|
public ApiResponse<object> AutoCalculationCost(string orderId, bool isSetStorageType, StorageType storageType)
|
||
|
{
|
||
|
return SendRequest<object>(globalContext.BBYWApiHost, "api/order/AutoCalculationCost", new { orderId, isSetStorageType, storageType }, null, HttpMethod.Post);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 手动计算成本
|
||
|
/// </summary>
|
||
|
/// <param name="orderId"></param>
|
||
|
/// <param name="isSetStorageType">是否设置仓储类型</param>
|
||
|
/// <param name="storageType"></param>
|
||
|
/// <returns></returns>
|
||
|
public ApiResponse<object> ManualCalculationCost(string orderId, bool isSetStorageType, StorageType storageType, decimal purchaseCost, decimal deliveryExpressFreight)
|
||
|
{
|
||
|
return SendRequest<object>(globalContext.BBYWApiHost, "api/order/ManualCalculationCost",
|
||
|
new
|
||
|
{
|
||
|
orderId,
|
||
|
isSetStorageType,
|
||
|
storageType,
|
||
|
purchaseCost,
|
||
|
deliveryExpressFreight
|
||
|
}, null, HttpMethod.Post);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 设置刷单成本
|
||
|
/// </summary>
|
||
|
/// <param name="orderId"></param>
|
||
|
/// <param name="isSetStorageType"></param>
|
||
|
/// <param name="sdCommissionAmount"></param>
|
||
|
/// <param name="deliveryExpressFreight"></param>
|
||
|
/// <param name="sdType"></param>
|
||
|
/// <param name="flag"></param>
|
||
|
/// <param name="venderRemark"></param>
|
||
|
/// <returns></returns>
|
||
|
public ApiResponse<object> SDCalculationCost(string orderId,
|
||
|
bool isSetStorageType,
|
||
|
decimal sdCommissionAmount,
|
||
|
decimal deliveryExpressFreight,
|
||
|
SDType sdType,
|
||
|
string flag,
|
||
|
string venderRemark)
|
||
|
{
|
||
|
return SendRequest<object>(globalContext.BBYWApiHost, "api/order/SDCalculationCost", new
|
||
|
{
|
||
|
orderId,
|
||
|
isSetStorageType,
|
||
|
flag,
|
||
|
venderRemark,
|
||
|
sdType,
|
||
|
sdCommissionAmount,
|
||
|
deliveryExpressFreight,
|
||
|
Platform = globalContext.User.Shop.Platform,
|
||
|
AppKey = globalContext.User.Shop.AppKey,
|
||
|
AppSecret = globalContext.User.Shop.AppSecret,
|
||
|
AppToken = globalContext.User.Shop.AppToken
|
||
|
}, null, HttpMethod.Post);
|
||
|
}
|
||
|
}
|
||
|
}
|