|
|
@ -1,13 +1,11 @@ |
|
|
|
using BBWYB.Common.Log; |
|
|
|
using BBWYB.Common.Models; |
|
|
|
using BBWYB.Server.Model; |
|
|
|
using BBWYB.Server.Model.Db; |
|
|
|
using BBWYB.Server.Model.Dto; |
|
|
|
using FreeSql; |
|
|
|
using SDKAdapter.OperationPlatform.Models; |
|
|
|
using Yitter.IdGenerator; |
|
|
|
using System.Linq; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using BBWYB.Server.Model; |
|
|
|
|
|
|
|
namespace BBWYB.Server.Business.Sync |
|
|
|
{ |
|
|
@ -162,13 +160,15 @@ namespace BBWYB.Server.Business.Sync |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 找出状态变化的SKU
|
|
|
|
var stateChangeProductSkuList = productSkuList.Where(ps => dbProductSkuList.Any(dps => dps.Id == ps.Id && (dps.State != ps.State || dps.SkuName != ps.Title))).ToList(); |
|
|
|
var stateChangeProductSkuList = productSkuList.Where(ps => dbProductSkuList.Any(dps => dps.Id == ps.Id && (dps.State != ps.State || dps.SkuName != ps.Title || dps.Price != ps.Price || dps.Logo != ps.Logo))).ToList(); |
|
|
|
if (stateChangeProductSkuList.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var productSku in stateChangeProductSkuList) |
|
|
|
{ |
|
|
|
var update = fsql.Update<ProductSku>(productSku.Id).Set(p => p.State, productSku.State) |
|
|
|
.Set(p => p.SkuName, productSku.Title); |
|
|
|
.Set(p => p.SkuName, productSku.Title) |
|
|
|
.Set(p => p.Price, productSku.Price) |
|
|
|
.Set(p => p.Logo, productSku.Logo); |
|
|
|
updateProductSkuList.Add(update); |
|
|
|
} |
|
|
|
} |
|
|
|