|
@ -1,6 +1,5 @@ |
|
|
using BBWY.Common.Extensions; |
|
|
using BBWY.Common.Extensions; |
|
|
using BBWY.Common.Models; |
|
|
using BBWY.Common.Models; |
|
|
using BBWY.Server.Business.PlatformSDK.DataExtension; |
|
|
|
|
|
using BBWY.Server.Model; |
|
|
using BBWY.Server.Model; |
|
|
using BBWY.Server.Model.Dto; |
|
|
using BBWY.Server.Model.Dto; |
|
|
using Jd.ACES; |
|
|
using Jd.ACES; |
|
@ -10,7 +9,6 @@ using Jd.Api.Response; |
|
|
using Microsoft.Extensions.Caching.Memory; |
|
|
using Microsoft.Extensions.Caching.Memory; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using NLog; |
|
|
|
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
@ -1093,7 +1091,7 @@ namespace BBWY.Server.Business |
|
|
req.type = 4; //赠品促销
|
|
|
req.type = 4; //赠品促销
|
|
|
req.beginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
req.beginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
req.endTime = DateTime.Now.AddDays(180).ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
req.endTime = DateTime.Now.AddDays(180).ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
req.per_min_num = 1; |
|
|
//req.bound = 123;
|
|
|
//req.bound = 123;
|
|
|
//req.member = 123;
|
|
|
//req.member = 123;
|
|
|
//req.slogan = "abc";
|
|
|
//req.slogan = "abc";
|
|
@ -1192,9 +1190,15 @@ namespace BBWY.Server.Business |
|
|
public override void DeleteJDPromotionTask(DeleteJDPromotionTaskRequest request) |
|
|
public override void DeleteJDPromotionTask(DeleteJDPromotionTaskRequest request) |
|
|
{ |
|
|
{ |
|
|
var jdClient = GetJdClient(request.AppKey, request.AppSecret); |
|
|
var jdClient = GetJdClient(request.AppKey, request.AppSecret); |
|
|
var req = new SellerPromotionDeleteRequest(); |
|
|
//var req = new SellerPromotionDeleteRequest();
|
|
|
|
|
|
|
|
|
|
|
|
//req.promoId = request.PromotionId;
|
|
|
|
|
|
//var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
|
|
|
|
|
|
|
|
|
|
|
|
var req = new SellerPromotionV2RemoveRequest(); |
|
|
|
|
|
req.requestId = Guid.NewGuid().ToString(); |
|
|
req.promoId = request.PromotionId; |
|
|
req.promoId = request.PromotionId; |
|
|
|
|
|
req.promoType = 4; |
|
|
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); |
|
|
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); |
|
|
|
|
|
|
|
|
if (res.IsError) |
|
|
if (res.IsError) |
|
@ -1217,8 +1221,14 @@ namespace BBWY.Server.Business |
|
|
public override void SuspendJDPromotionTask(SuspendDPromotionTaskRequest request) |
|
|
public override void SuspendJDPromotionTask(SuspendDPromotionTaskRequest request) |
|
|
{ |
|
|
{ |
|
|
var jdClient = GetJdClient(request.AppKey, request.AppSecret); |
|
|
var jdClient = GetJdClient(request.AppKey, request.AppSecret); |
|
|
var req = new SellerPromotionSuspendRequest(); |
|
|
//var req = new SellerPromotionSuspendRequest();
|
|
|
|
|
|
//req.promoId = request.PromotionId;
|
|
|
|
|
|
|
|
|
|
|
|
var req = new SellerPromotionV2SuspendRequest(); |
|
|
|
|
|
|
|
|
|
|
|
req.requestId = Guid.NewGuid().ToString(); |
|
|
req.promoId = request.PromotionId; |
|
|
req.promoId = request.PromotionId; |
|
|
|
|
|
req.promoType = 4; |
|
|
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); |
|
|
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); |
|
|
if (res.IsError) |
|
|
if (res.IsError) |
|
|
throw new BusinessException($"暂停JD活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); |
|
|
throw new BusinessException($"暂停JD活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); |
|
@ -1228,15 +1238,22 @@ namespace BBWY.Server.Business |
|
|
{ |
|
|
{ |
|
|
var jdClient = GetJdClient(appkey, appSecret); |
|
|
var jdClient = GetJdClient(appkey, appSecret); |
|
|
Thread.Sleep(3000); |
|
|
Thread.Sleep(3000); |
|
|
var req = new SellerPromotionCheckRequest(); |
|
|
//var req = new SellerPromotionCheckRequest();
|
|
|
|
|
|
//req.promoId = promotionId;
|
|
|
|
|
|
//req.status = 4;
|
|
|
|
|
|
//var res = jdClient.Execute(req, token, DateTime.Now.ToLocalTime());
|
|
|
|
|
|
//if (res.IsError)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// //RollBackWhenStartPromotionError(deleteGiftSkuRequest, request, brandName, haveGiftTemplateSku);
|
|
|
|
|
|
// //throw new BusinessException($"审核活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
var req = new PopMarketWritePromotionGiftApproveRequest(); |
|
|
req.promoId = promotionId; |
|
|
req.promoId = promotionId; |
|
|
req.status = 4; |
|
|
req.requestId = Guid.NewGuid().ToString(); |
|
|
var res = jdClient.Execute(req, token, DateTime.Now.ToLocalTime()); |
|
|
|
|
|
if (res.IsError) |
|
|
PopMarketWritePromotionGiftApproveResponse response = jdClient.Execute(req, token, DateTime.Now.ToLocalTime()); |
|
|
{ |
|
|
|
|
|
//RollBackWhenStartPromotionError(deleteGiftSkuRequest, request, brandName, haveGiftTemplateSku);
|
|
|
|
|
|
//throw new BusinessException($"审核活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private List<JToken> GetPromotionTaskSku(string appkey, string appSecret, string token, long promotionId) |
|
|
private List<JToken> GetPromotionTaskSku(string appkey, string appSecret, string token, long promotionId) |
|
|