|
@ -66,29 +66,29 @@ namespace BBWY.Server.Business.Sync |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region 新增pin保存逻辑
|
|
|
//#region 新增pin保存逻辑
|
|
|
var pinList = jArray.Select(j => j.Value<string>("pin")).Distinct().ToList(); |
|
|
//var pinList = jArray.Select(j => j.Value<string>("pin")).Distinct().ToList();
|
|
|
var dbPinList = fsql.Select<JdShopPin>().Where(p => p.ShopId == shopId).ToList(p => p.AccessPin); |
|
|
//var dbPinList = fsql.Select<JdShopPin>().Where(p => p.ShopId == shopId).ToList(p => p.AccessPin);
|
|
|
var pinchajiList = pinList.Except(dbPinList).ToList(); |
|
|
//var pinchajiList = pinList.Except(dbPinList).ToList();
|
|
|
List<JdShopPin> insertJDShopPinList = null; |
|
|
//List<JdShopPin> insertJDShopPinList = null;
|
|
|
if (pinchajiList.Count() > 0) |
|
|
//if (pinchajiList.Count() > 0)
|
|
|
{ |
|
|
//{
|
|
|
insertJDShopPinList = pinchajiList.Select(pin => new JdShopPin() |
|
|
// insertJDShopPinList = pinchajiList.Select(pin => new JdShopPin()
|
|
|
{ |
|
|
// {
|
|
|
Id = idGenerator.NewLong(), |
|
|
// Id = idGenerator.NewLong(),
|
|
|
AccessPin = pin, |
|
|
// AccessPin = pin,
|
|
|
CreateTime = DateTime.Now, |
|
|
// CreateTime = DateTime.Now,
|
|
|
ShopId = shopId |
|
|
// ShopId = shopId
|
|
|
}).ToList(); |
|
|
// }).ToList();
|
|
|
} |
|
|
//}
|
|
|
#endregion
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
fsql.Transaction(() => |
|
|
//fsql.Transaction(() =>
|
|
|
{ |
|
|
// {
|
|
|
if (insertJDShopPinList != null) |
|
|
// if (insertJDShopPinList != null)
|
|
|
fsql.Insert(insertJDShopPinList).ExecuteAffrows(); |
|
|
// fsql.Insert(insertJDShopPinList).ExecuteAffrows();
|
|
|
fsql.Insert(insertList).ExecuteAffrows(); |
|
|
fsql.Insert(insertList).ExecuteAffrows(); |
|
|
}); |
|
|
//});
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void SyncShopPopularizeRecord(ShopResponse shop, DateTime startDate, DateTime endDate, int pageIndex, out int currentCount) |
|
|
private void SyncShopPopularizeRecord(ShopResponse shop, DateTime startDate, DateTime endDate, int pageIndex, out int currentCount) |
|
@ -140,12 +140,7 @@ namespace BBWY.Server.Business.Sync |
|
|
private void DeleteOldData(IList<ShopResponse> shops, DateTime startDate, DateTime endDate) |
|
|
private void DeleteOldData(IList<ShopResponse> shops, DateTime startDate, DateTime endDate) |
|
|
{ |
|
|
{ |
|
|
var shopIds = shops.Select(s => Convert.ToInt64(s.ShopId)).ToList(); |
|
|
var shopIds = shops.Select(s => Convert.ToInt64(s.ShopId)).ToList(); |
|
|
|
|
|
fsql.Delete<Shoppopularize>().Where(s => shopIds.Contains(s.ShopId.Value) && s.Date >= startDate && s.Date <= endDate).ExecuteAffrows(); |
|
|
fsql.Transaction(() => |
|
|
|
|
|
{ |
|
|
|
|
|
fsql.Delete<JdShopPin>().Where(p => shopIds.Contains(p.ShopId.Value)).ExecuteAffrows(); |
|
|
|
|
|
fsql.Delete<Shoppopularize>().Where(s => shopIds.Contains(s.ShopId.Value) && s.Date >= startDate && s.Date <= endDate).ExecuteAffrows(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void SyncAllShopPopularizeRecord() |
|
|
public void SyncAllShopPopularizeRecord() |
|
|