From 6c2a9bacc41182ac446438cb87267b93cb9fad86 Mon Sep 17 00:00:00 2001 From: sanji Date: Mon, 22 Jan 2024 17:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E6=B5=81=E7=A8=8B=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E6=96=B0=E5=93=81=E8=80=81=E5=93=81=20(=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EvaluationAssistantBusiness.cs | 25 ++++++++++++++----- .../Db/EvaluationAssistant/PromotionTask.cs | 5 ++++ .../AddOrEditPromotionTaskRequest.cs | 5 ++++ .../StartPromotionTaskRequest.cs | 10 ++++++++ .../PromotionTask/PromotionTaskResponse.cs | 5 ++++ 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs index 9c5aca76..ea4b9c35 100644 --- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs +++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs @@ -164,11 +164,22 @@ namespace BBWY.Server.Business if (request.GiftTemplateId == 0 && string.IsNullOrEmpty(request.MainProductGiftSku)) throw new BusinessException("赠品模板和主商品赠品SKU至少具备一个"); - if (string.IsNullOrEmpty(request.FullTitle)) - throw new BusinessException("缺少完整标题"); + if (request.IsNewProduct == null) + request.IsNewProduct = 1; - if (string.IsNullOrEmpty(request.SimpleTitle)) - throw new BusinessException("缺少精简标题"); + if (request.IsNewProduct == 1) + { + if (string.IsNullOrEmpty(request.FullTitle)) + throw new BusinessException("缺少完整标题"); + + if (string.IsNullOrEmpty(request.SimpleTitle)) + throw new BusinessException("缺少精简标题"); + } + else if (request.IsNewProduct == 0) + { + if (string.IsNullOrEmpty(request.FullTitle)) + throw new BusinessException("缺少完整标题"); + } if (string.IsNullOrEmpty(request.ActivityName)) throw new BusinessException("缺少任务名称"); @@ -234,7 +245,8 @@ namespace BBWY.Server.Business SpuPublishTime = spuResponse.Data.Items[0].CreateTime, TaskCount = request.TaskCount, CustomMotherSku = request.CustomMotherSku, - OuterId = request.OuterId + OuterId = request.OuterId, + IsNewProduct = request.IsNewProduct }; fsql.Insert(promotionTask).ExecuteAffrows(); } @@ -679,7 +691,8 @@ namespace BBWY.Server.Business JoinSkuCount = joinSkuList.Count(), JoinSkuList = joinSkuList, PJZSDingDingKey = shop.PJZSDingDingKey, - PJZSDingDingWebHook = shop.PJZSDingDingWebHook + PJZSDingDingWebHook = shop.PJZSDingDingWebHook, + IsNewProduct = promotionTask.IsNewProduct ?? 1 }, GetYunDingRequestHeader(), HttpMethod.Post, timeOutSeconds: 500); var errorBack = new Action((id, errorMsg) => diff --git a/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs b/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs index 317a7571..7ae665a0 100644 --- a/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs +++ b/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs @@ -145,6 +145,11 @@ namespace BBWY.Server.Model.Db /// 外部Id /// public string OuterId { get; set; } + + /// + /// 是否新品(0=老 1=新) + /// + public int? IsNewProduct { get; set; } = 1; } } diff --git a/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs b/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs index 864591e3..7940c133 100644 --- a/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs @@ -54,5 +54,10 @@ /// 外部Id /// public string OuterId { get; set; } + + /// + /// 是否为新品 是否新品(0=老 1=新) + /// + public int? IsNewProduct { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs index 2287e654..ebaf1e8b 100644 --- a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs @@ -76,6 +76,11 @@ namespace BBWY.Server.Model.Dto public bool MainProductSkuInStore { get; set; } public string OuterId { get; set; } + + /// + /// 是否新品 (0=老品 1=新品) + /// + public int IsNewProduct { get; set; } } public class StartPromotionTaskDelayRequest : PlatformRequest @@ -113,5 +118,10 @@ namespace BBWY.Server.Model.Dto public string PJZSDingDingKey { get; set; } public string PJZSDingDingWebHook { get; set; } + + /// + /// 是否新品 (0=老品 1=新品) + /// + public int IsNewProduct { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs b/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs index 514be04c..729af917 100644 --- a/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs +++ b/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs @@ -133,6 +133,11 @@ namespace BBWY.Server.Model.Dto /// 外部Id /// public string OuterId { get; set; } + + /// + /// 是否新品(0=老 1=新) + /// + public int? IsNewProduct { get; set; } } public class PromotionTaskResponse