diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs index 1b10531c..36105fea 100644 --- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs +++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs @@ -81,8 +81,8 @@ namespace BBWY.Server.Business if (string.IsNullOrEmpty(request.MainProductSpu)) throw new BusinessException("缺少主商品SPU"); - if (request.MotherTemplateId == 0 && string.IsNullOrEmpty(request.MainProductSku)) - throw new BusinessException("奶妈模板和主商品SKU至少具备一个"); + if (request.MotherTemplateId == 0 && string.IsNullOrEmpty(request.MainProductSku) && string.IsNullOrEmpty(request.CustomMotherSku)) + throw new BusinessException("奶妈模板,奶妈自定义SKU,主商品SKU至少具备一个"); if (request.GiftTemplateId == 0 && string.IsNullOrEmpty(request.MainProductGiftSku)) throw new BusinessException("赠品模板和主商品赠品SKU至少具备一个"); @@ -96,6 +96,9 @@ namespace BBWY.Server.Business if (request.ActivityName.Length > 10) throw new BusinessException("活动名称不能超过10个字"); + if (request.TaskCount == 0) + throw new BusinessException("任务量不能为0"); + if (request.Id == 0) { var relayAPIHost = GetPlatformRelayAPIHost(Enums.Platform.京东); @@ -149,7 +152,17 @@ namespace BBWY.Server.Business request.Map(dbPromotionTask); fsql.Update().SetSource(dbPromotionTask) - .IgnoreColumns(new string[] { "UpdateSortTime", "Sort", "Status", "CreateTime", "SpuLogo", "SpuPublishTime", "StartTime", "EndTime" }) + .IgnoreColumns(new string[] + { + "UpdateSortTime", + "Sort", "Status", + "CreateTime", + "SpuLogo", + "SpuPublishTime", + "StartTime", + "EndTime", + "CompletedTaskCount" + }) .ExecuteAffrows(); } } @@ -247,6 +260,7 @@ namespace BBWY.Server.Business MainProductGiftSku = dbPromotionTask.MainProductGiftSku, MainProductSku = dbPromotionTask.MainProductSku, MotherTemplateSku = motherTemplateSku, + CustomMotherSku = dbPromotionTask.CustomMotherSku, MainProductSpu = dbPromotionTask.MainProductSpu, Platform = Enums.Platform.京东, ShopId = dbPromotionTask.ShopId.Value diff --git a/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs b/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs index 485f208d..2ee22255 100644 --- a/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs +++ b/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs @@ -52,7 +52,7 @@ namespace BBWY.Server.Model.Db public string MainProductSku { get; set; } /// - /// 主商品SPU + /// 主商品spu /// [Column(StringLength = 50)] public string MainProductSpu { get; set; } @@ -102,6 +102,21 @@ namespace BBWY.Server.Model.Db [Column(DbType = "datetime")] public DateTime? EndTime { get; set; } + + /// + /// 自定义奶妈sku + /// + public string CustomMotherSku { get; set; } + + /// + /// 任务数量 + /// + public int TaskCount { get; set; } + + /// + /// 已完成任务量 + /// + public int CompletedTaskCount { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs b/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs index 45393d3e..233af9a0 100644 --- a/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PromotionTask/AddOrEditPromotionTaskRequest.cs @@ -40,6 +40,14 @@ /// public string MainProductSku { get; set; } + /// + /// 自定义奶妈sku + /// + public string CustomMotherSku { get; set; } + /// + /// 任务数量 + /// + public int TaskCount { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs index 2afdbea2..dfef0e7c 100644 --- a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs @@ -45,5 +45,10 @@ namespace BBWY.Server.Model.Dto /// 主商品的sku (非赠品) /// public string MainProductSku { get; set; } + + /// + /// 自定义奶妈sku + /// + public string CustomMotherSku { get; set; } } }