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.
98 lines
4.8 KiB
98 lines
4.8 KiB
using BBWYB.Client.Models;
|
|
using BBWYB.Client.Models.APIModel;
|
|
using BBWYB.Common.Http;
|
|
using BBWYB.Common.Models;
|
|
using System.Collections.Generic;
|
|
using System.Net.Http;
|
|
|
|
namespace BBWYB.Client.APIServices
|
|
{
|
|
public class PurchaseService : BaseApiService, IDenpendency
|
|
{
|
|
public PurchaseService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { }
|
|
|
|
/// <summary>
|
|
/// 获取采购方案
|
|
/// </summary>
|
|
/// <param name="skuIdList"></param>
|
|
/// <param name="purchaserId"></param>
|
|
/// <param name="shopId"></param>
|
|
/// <param name="schemeId"></param>
|
|
/// <param name="platform"></param>
|
|
/// <returns></returns>
|
|
public ApiResponse<IList<PurchaseSchemeResponse>> GetPurchaseSchemeList(IList<string> skuIdList = null,
|
|
string purchaserId = "",
|
|
long? shopId = null,
|
|
long? schemeId = null,
|
|
Platform? purchasePlatform = null)
|
|
{
|
|
return SendRequest<IList<PurchaseSchemeResponse>>(globalContext.BBWYApiHost,
|
|
"api/PurchaseScheme/GetPurchaseSchemeList",
|
|
new
|
|
{
|
|
skuIdList,
|
|
purchaserId,
|
|
shopId,
|
|
schemeId,
|
|
purchasePlatform
|
|
},
|
|
null,
|
|
HttpMethod.Post);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取共有采购商
|
|
/// </summary>
|
|
/// <param name="skuId"></param>
|
|
/// <param name="shopId"></param>
|
|
/// <returns></returns>
|
|
public ApiResponse<IList<Purchaser>> GetSharePurchaser(IList<string> skuIdList, long shopId)
|
|
{
|
|
return SendRequest<IList<Purchaser>>(globalContext.BBWYApiHost,
|
|
"api/PurchaseScheme/GetSharePurchaser",
|
|
new { skuIdList, shopId },
|
|
null,
|
|
HttpMethod.Post);
|
|
}
|
|
|
|
public ApiResponse<object> EditPurchaseScheme(IList<PurchaseScheme> addPurchaseSchemeList, IList<PurchaseScheme> editPurchaseSchemeList)
|
|
{
|
|
return SendRequest<object>(globalContext.BBWYApiHost,
|
|
"api/purchasescheme/EditPurchaseScheme",
|
|
new
|
|
{
|
|
AddPurchaseSchemeList = addPurchaseSchemeList,
|
|
EditPurchaseSchemeList = editPurchaseSchemeList
|
|
},
|
|
null,
|
|
HttpMethod.Post);
|
|
}
|
|
|
|
public ApiResponse<object> DeletePurchaser(string productId, string purchaserId)
|
|
{
|
|
return SendRequest<object>(globalContext.BBWYApiHost,
|
|
"api/purchasescheme/DeletePurchaser",
|
|
new { productId, purchaserId },
|
|
null,
|
|
HttpMethod.Delete);
|
|
}
|
|
|
|
public ApiResponse<object> DeletePurchaseScheme(long schemeId)
|
|
{
|
|
return SendRequest<object>(globalContext.BBWYApiHost, $"api/purchasescheme/DeletePurchaseScheme/{schemeId}", null, null, HttpMethod.Delete);
|
|
}
|
|
//Api/PurchaseScheme/GetPurchaseSkuBasicInfo
|
|
|
|
public ApiResponse<PurchaseSkuBasicInfoResponse> GetPurchaseSkuBasicInfo(string purchaseProductId, Platform platform= Platform.阿里巴巴,int priceMode=0,int firstApiMode=0)
|
|
{
|
|
|
|
|
|
return SendRequest<PurchaseSkuBasicInfoResponse>("http://bbwyb.qiyue666.com", $"Api/PurchaseScheme/GetPurchaseSkuBasicInfo", new {
|
|
purchaseProductId,
|
|
platform,
|
|
priceMode,
|
|
firstApiMode
|
|
}, null, HttpMethod.Post);
|
|
}
|
|
}
|
|
}
|
|
|