|
|
@ -1,6 +1,7 @@ |
|
|
|
using BBWY.Common.Extensions; |
|
|
|
using BBWY.Common.Http; |
|
|
|
using BBWY.Common.Models; |
|
|
|
using BBWY.Server.Business.Sync; |
|
|
|
using BBWY.Server.Model; |
|
|
|
using BBWY.Server.Model.Db; |
|
|
|
using BBWY.Server.Model.Dto; |
|
|
@ -32,10 +33,22 @@ namespace BBWY.Server.Business |
|
|
|
private List<Enums.PromitionTaskStatus> preTaskStateList; |
|
|
|
private ProductBusiness productBusiness; |
|
|
|
private FreeSqlMultiDBManager freeSqlMultiDBManager; |
|
|
|
private ProductSyncBusiness productSyncBusiness; |
|
|
|
|
|
|
|
private char[] spliter; |
|
|
|
|
|
|
|
public EvaluationAssistantBusiness(RestApiService restApiService, IOptions<GlobalConfig> options, YunDingBusiness yunDingBusiness, IFreeSql fsql, IIdGenerator idGenerator, TaskSchedulerManager taskSchedulerManager, VenderBusiness venderBusiness, QYMessageCenterBusiness qyMessageCenterBusiness, NLogManager nLogManager, ProductBusiness productBusiness, FreeSqlMultiDBManager freeSqlMultiDBManager) : base(restApiService, options, yunDingBusiness) |
|
|
|
public EvaluationAssistantBusiness(RestApiService restApiService, |
|
|
|
IOptions<GlobalConfig> options, |
|
|
|
YunDingBusiness yunDingBusiness, |
|
|
|
IFreeSql fsql, |
|
|
|
IIdGenerator idGenerator, |
|
|
|
TaskSchedulerManager taskSchedulerManager, |
|
|
|
VenderBusiness venderBusiness, |
|
|
|
QYMessageCenterBusiness qyMessageCenterBusiness, |
|
|
|
NLogManager nLogManager, |
|
|
|
ProductBusiness productBusiness, |
|
|
|
FreeSqlMultiDBManager freeSqlMultiDBManager, |
|
|
|
ProductSyncBusiness productSyncBusiness) : base(restApiService, options, yunDingBusiness) |
|
|
|
{ |
|
|
|
|
|
|
|
this.fsql = fsql; |
|
|
@ -47,6 +60,7 @@ namespace BBWY.Server.Business |
|
|
|
this.nLogManager = nLogManager; |
|
|
|
this.productBusiness = productBusiness; |
|
|
|
this.freeSqlMultiDBManager = freeSqlMultiDBManager; |
|
|
|
this.productSyncBusiness = productSyncBusiness; |
|
|
|
validOrderStateList = new List<Enums.OrderState>() |
|
|
|
{ |
|
|
|
Enums.OrderState.待出库, |
|
|
@ -723,15 +737,6 @@ namespace BBWY.Server.Business |
|
|
|
pt.PreTaskId == -1)).Any(); |
|
|
|
if (!haveNextTask) |
|
|
|
{ |
|
|
|
//if (!string.IsNullOrEmpty(shop.PJZSDingDingKey) && !string.IsNullOrEmpty(shop.PJZSDingDingWebHook))
|
|
|
|
//{
|
|
|
|
// try
|
|
|
|
// {
|
|
|
|
// dingDingBusiness.SendDingDingBotMessage(shop.PJZSDingDingKey, shop.PJZSDingDingWebHook, $"评价助手\n店铺:{shop.ShopName}\n任务列表无后续任务,为避免空档请及时设置后续任务");
|
|
|
|
// }
|
|
|
|
// catch { }
|
|
|
|
//}
|
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
qyMessageCenterBusiness.SendMessage(shop.TeamId, shop.TeamId, shop.ShopId, "PJZS", shop.ShopName, "任务列表无后续任务,为避免空档请及时设置后续任务", "NOTASK", "PJZS API", string.Empty); |
|
|
@ -739,6 +744,34 @@ namespace BBWY.Server.Business |
|
|
|
catch { } |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 立即同步赠品到产品库
|
|
|
|
{ |
|
|
|
if (startResponse.GiftSkuList != null && startResponse.GiftSkuList.Count() > 0) |
|
|
|
{ |
|
|
|
var insertGiftSkuList = startResponse.GiftSkuList.Select(x => new ProductSku() |
|
|
|
{ |
|
|
|
Id = x.Id, |
|
|
|
IsGift = true, |
|
|
|
Logo = x.Logo, |
|
|
|
Platform = Enums.Platform.京东, |
|
|
|
Price = x.Price, |
|
|
|
ProductId = x.ProductId, |
|
|
|
ShopId = shopId, |
|
|
|
State = x.State, |
|
|
|
Title = x.Title, |
|
|
|
CategoryId = x.Source.Value<int>("categoryId"), |
|
|
|
CategoryName = productSyncBusiness.GetCategoryName(shop, x.Source.Value<string>("categoryId")), |
|
|
|
CreateTime = x.CreateTime |
|
|
|
}); |
|
|
|
try |
|
|
|
{ |
|
|
|
fsql.Insert(insertGiftSkuList).ExecuteAffrows(); |
|
|
|
} |
|
|
|
catch { } |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|