|
@ -28,10 +28,13 @@ namespace BBWY.Server.Business |
|
|
private List<Enums.OrderState> validOrderStateList; |
|
|
private List<Enums.OrderState> validOrderStateList; |
|
|
private List<Enums.PromitionTaskStatus> preTaskStateList; |
|
|
private List<Enums.PromitionTaskStatus> preTaskStateList; |
|
|
private ProductBusiness productBusiness; |
|
|
private ProductBusiness productBusiness; |
|
|
|
|
|
private FreeSqlMultiDBManager freeSqlMultiDBManager; |
|
|
|
|
|
|
|
|
private char[] spliter; |
|
|
private char[] spliter; |
|
|
|
|
|
|
|
|
public EvaluationAssistantBusiness(RestApiService restApiService, IOptions<GlobalConfig> options, YunDingBusiness yunDingBusiness, IFreeSql fsql, IIdGenerator idGenerator, TaskSchedulerManager taskSchedulerManager, VenderBusiness venderBusiness, DingDingBusiness dingDingBusiness, NLogManager nLogManager, ProductBusiness productBusiness) : base(restApiService, options, yunDingBusiness) |
|
|
public EvaluationAssistantBusiness(RestApiService restApiService, IOptions<GlobalConfig> options, YunDingBusiness yunDingBusiness, IFreeSql fsql, IIdGenerator idGenerator, TaskSchedulerManager taskSchedulerManager, VenderBusiness venderBusiness, DingDingBusiness dingDingBusiness, NLogManager nLogManager, ProductBusiness productBusiness, FreeSqlMultiDBManager freeSqlMultiDBManager) : base(restApiService, options, yunDingBusiness) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
this.fsql = fsql; |
|
|
this.fsql = fsql; |
|
|
this.idGenerator = idGenerator; |
|
|
this.idGenerator = idGenerator; |
|
|
this.taskSchedulerManager = taskSchedulerManager; |
|
|
this.taskSchedulerManager = taskSchedulerManager; |
|
@ -39,6 +42,7 @@ namespace BBWY.Server.Business |
|
|
this.dingDingBusiness = dingDingBusiness; |
|
|
this.dingDingBusiness = dingDingBusiness; |
|
|
this.nLogManager = nLogManager; |
|
|
this.nLogManager = nLogManager; |
|
|
this.productBusiness = productBusiness; |
|
|
this.productBusiness = productBusiness; |
|
|
|
|
|
this.freeSqlMultiDBManager = freeSqlMultiDBManager; |
|
|
validOrderStateList = new List<Enums.OrderState>() |
|
|
validOrderStateList = new List<Enums.OrderState>() |
|
|
{ |
|
|
{ |
|
|
Enums.OrderState.待出库, |
|
|
Enums.OrderState.待出库, |
|
@ -691,6 +695,15 @@ namespace BBWY.Server.Business |
|
|
throw new BusinessException(response.Msg); |
|
|
throw new BusinessException(response.Msg); |
|
|
fsql.Update<PromotionTask>(request.Id).Set(pt => pt.Status, Enums.PromitionTaskStatus.已停止).ExecuteAffrows(); |
|
|
fsql.Update<PromotionTask>(request.Id).Set(pt => pt.Status, Enums.PromitionTaskStatus.已停止).ExecuteAffrows(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void EditPJZSSettings(PJZSShopSettingRequest request) |
|
|
|
|
|
{ |
|
|
|
|
|
var shopId = request.ShopId.ToString(); |
|
|
|
|
|
freeSqlMultiDBManager.MDSfsql.Update<Model.Db.Mds.Shops>().Set(s => s.PJZSDingDingKey, request.PJZSDingDingKey) |
|
|
|
|
|
.Set(s => s.PJZSDingDingWebHook, request.PJZSDingDingWebHook) |
|
|
|
|
|
.Where(s => s.ShopId == shopId) |
|
|
|
|
|
.ExecuteAffrows(); |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region 自动任务
|
|
|
#region 自动任务
|
|
@ -702,8 +715,8 @@ namespace BBWY.Server.Business |
|
|
|
|
|
|
|
|
//开始下一轮开始任务
|
|
|
//开始下一轮开始任务
|
|
|
var nextPromotionTaskList = fsql.Select<PromotionTask>().WhereIf(shopId != null, pt => pt.ShopId == shopId) |
|
|
var nextPromotionTaskList = fsql.Select<PromotionTask>().WhereIf(shopId != null, pt => pt.ShopId == shopId) |
|
|
.Where(pt => pt.Status == Enums.PromitionTaskStatus.等待 && |
|
|
.Where(pt => pt.Status == Enums.PromitionTaskStatus.等待 && pt.PreTaskId == -1) |
|
|
pt.PreTaskId == -1).ToList(pt => new { Id = pt.Id, ShopId = pt.ShopId }); |
|
|
.ToList(pt => new { Id = pt.Id, ShopId = pt.ShopId }); |
|
|
if (nextPromotionTaskList.Count() > 0) |
|
|
if (nextPromotionTaskList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
foreach (var nextTask in nextPromotionTaskList) |
|
|
foreach (var nextTask in nextPromotionTaskList) |
|
|