Browse Source

删除接口

qianyi
shanji 2 years ago
parent
commit
fcea1b1245
  1. 3
      BBWY.JDSDK/Request/QueryNewProductPriceRequest.cs
  2. 3
      BBWY.JDSDK/Request/QueryProdInfoRequest.cs
  3. 24
      BBWY.JDSDK/Request/SellerPromotionDeleteSkuInPromoRequest.cs
  4. 3
      BBWY.JDSDK/Response/PurchaseOrderGetResponse.cs
  5. 8
      BBWY.JDSDK/Response/SellerPromotionDeleteSkuInPromoResponse.cs
  6. 10
      BBWY.Server.API/Controllers/EvaluationAssistantController.cs
  7. 30
      BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs
  8. 13
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs
  9. 5
      BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
  10. 6
      BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs
  11. 8
      BBWY.Server.Model/Dto/Request/PromotionTask/DeletePromotionTaskRequest.cs
  12. 2
      BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs
  13. 10
      JD.API/Controllers/PlatformSDKController.cs

3
BBWY.JDSDK/Request/QueryNewProductPriceRequest.cs

@ -19,7 +19,8 @@ namespace Jd.Api.Request
{ get; set; }
public string
skuidList {get; set; }
skuidList
{ get; set; }
public string
source
{ get; set; }

3
BBWY.JDSDK/Request/QueryProdInfoRequest.cs

@ -15,7 +15,8 @@ namespace Jd.Api.Request
{ get; set; }
public string
skuList {get; set; }
skuList
{ get; set; }
public string
isProduct
{ get; set; }

24
BBWY.JDSDK/Request/SellerPromotionDeleteSkuInPromoRequest.cs

@ -0,0 +1,24 @@
using Jd.Api.Response;
using System.Collections.Generic;
namespace Jd.Api.Request
{
public class SellerPromotionDeleteSkuInPromoRequest : JdRequestBase<SellerPromotionDeleteSkuInPromoResponse>
{
public long promoId { get; set; }
public string skuId { get; set; }
public SellerPromotionDeleteSkuInPromoRequest()
{
}
public override string ApiName => "jingdong.seller.promotion.deleteSkuInPromo";
protected override void PrepareParam(IDictionary<string, object> paramters)
{
paramters.Add("promoId", promoId);
paramters.Add("skuId", skuId);
}
}
}

3
BBWY.JDSDK/Response/PurchaseOrderGetResponse.cs

@ -6,7 +6,8 @@ using Newtonsoft.Json;
namespace Jd.Api.Response
{
public class PurchaseOrderGetResponse:JdResponse{
public class PurchaseOrderGetResponse : JdResponse
{
[JsonProperty("result")]
public GxResponse

8
BBWY.JDSDK/Response/SellerPromotionDeleteSkuInPromoResponse.cs

@ -0,0 +1,8 @@
using Jd.Api;
namespace Jd.Api.Response
{
public class SellerPromotionDeleteSkuInPromoResponse: JdResponse
{
}
}

10
BBWY.Server.API/Controllers/EvaluationAssistantController.cs

@ -97,5 +97,15 @@ namespace BBWY.Server.API.Controllers
{
evaluationAssistantBusiness.DeletePromotionTaskAndJDTask(request);
}
/// <summary>
/// 删除任务同时删除京东活动中的奶妈SKU
/// </summary>
/// <param name="request"></param>
[HttpDelete]
public void DeletePromotionTaskAndMotherSku([FromBody] DeletePromotionTaskRequest request)
{
evaluationAssistantBusiness.DeletePromotionTaskAndMotherSku(request);
}
}
}

30
BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs

@ -227,8 +227,7 @@ namespace BBWY.Server.Business
{
foreach (var sku in skuIdList)
{
if ((!string.IsNullOrEmpty(pt.CustomMotherSku) && pt.CustomMotherSku.Contains(sku)) ||
(!string.IsNullOrEmpty(pt.MotherTemplateSku) && pt.MotherTemplateSku.Contains(sku)))
if (!string.IsNullOrEmpty(pt.CustomMotherSku) && pt.CustomMotherSku.Contains(sku))
{
throw new BusinessException($"sku[{sku}]已存在于任务[{pt.ActivityName}]中,请删除该sku或等待任务结束");
}
@ -262,9 +261,9 @@ namespace BBWY.Server.Business
giftTemplateSku = giftTemplate.GiftSkus;
}
//此处预留更改,等奶妈模板完善以后改为关联查询
var runingTaskList = fsql.Select<PromotionTask>().Where(pt => pt.ShopId == dbPromotionTask.ShopId && pt.Status == Enums.PromitionTaskStatus.).ToList();
if (dbPromotionTask.MotherTemplateId != null && dbPromotionTask.MotherTemplateId != 0)
{
@ -351,10 +350,35 @@ namespace BBWY.Server.Business
{
var dbPromotionTask = fsql.Select<PromotionTask>(request.TaskId).ToOne();
if (dbPromotionTask.Status != Enums.PromitionTaskStatus.)
{
List<string> motherSkuIdList = new List<string>();
if (dbPromotionTask.MotherTemplateId != null)
{
}
if (!string.IsNullOrEmpty(dbPromotionTask.CustomMotherSku))
motherSkuIdList.AddRange(dbPromotionTask.CustomMotherSku.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.),
"api/platformsdk/DeleteJDPromotionTaskSku",
new DeleteJDPromotionTaskSkuRequest()
{
AppKey = request.AppKey,
AppSecret = request.AppSecret,
AppToken = request.AppToken,
Platform = Enums.Platform.,
PromotionId = dbPromotionTask.PromotionId.Value,
SkuId = string.Join(",", motherSkuIdList)
},
GetYunDingRequestHeader(),
HttpMethod.Post);
if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
throw new BusinessException(httpResult.Content);
var response = JsonConvert.DeserializeObject<ApiResponse>(httpResult.Content);
if (!response.Success)
throw new BusinessException(response.Msg);
}
fsql.Delete<PromotionTask>(request.TaskId).ExecuteAffrows();
}
#endregion

13
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -1128,5 +1128,18 @@ namespace BBWY.Server.Business
if (res.IsError)
throw new BusinessException($"删除JD活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
}
public override void DeleteJDPromotionTaskSku(DeleteJDPromotionTaskSkuRequest request)
{
var jdClient = GetJdClient(request.AppKey, request.AppSecret);
var req = new SellerPromotionDeleteSkuInPromoRequest();
req.promoId = request.PromotionId;
req.skuId = request.SkuId;
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
if (res.IsError)
throw new BusinessException($"删除JD活动sku失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
}
}
}

5
BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs

@ -167,5 +167,10 @@ namespace BBWY.Server.Business
{
throw new NotImplementedException();
}
public virtual void DeleteJDPromotionTaskSku(DeleteJDPromotionTaskSkuRequest request)
{
throw new NotImplementedException();
}
}
}

6
BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs

@ -63,12 +63,6 @@ namespace BBWY.Server.Model.Db
public long? MotherTemplateId { get; set; }
/// <summary>
/// 奶妈模板关联的Sku
/// </summary>
[Column(IsIgnore = true)]
public string MotherTemplateSku { get; set; }
/// <summary>
/// 促销活动Id
/// </summary>

8
BBWY.Server.Model/Dto/Request/PromotionTask/DeletePromotionTaskRequest.cs

@ -9,4 +9,12 @@
{
public long PromotionId { get; set; }
}
public class DeleteJDPromotionTaskSkuRequest : DeleteJDPromotionTaskRequest
{
/// <summary>
/// 多个sku之间逗号间隔
/// </summary>
public string SkuId { get; set; }
}
}

2
BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs

@ -4,7 +4,7 @@ using System.Text;
namespace BBWY.Server.Model.Dto
{
public class StartPromotionTaskRequest
public class StartPromotionTaskRequest: PlatformRequest
{
public long Id { get; set; }
}

10
JD.API/Controllers/PlatformSDKController.cs

@ -297,5 +297,15 @@ namespace JD.API.API.Controllers
{
platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).DeleteJDPromotionTask(request);
}
/// <summary>
/// 删除京东活动SKU
/// </summary>
/// <param name="request"></param>
[HttpPost]
public void DeleteJDPromotionTaskSku([FromBody] DeleteJDPromotionTaskSkuRequest request)
{
platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).DeleteJDPromotionTaskSku(request);
}
}
}

Loading…
Cancel
Save