Browse Source

取消JDShopPin逻辑

qianyi
shanji 3 years ago
parent
commit
6687226751
  1. 51
      BBWY.Server.Business/Sync/JDPopularizeSyncBusiness.cs
  2. 4
      doc/.back_步步为盈数据库/步步为盈数据库-backup-20221011194720.pdma.json
  3. 2
      doc/步步为盈数据库.pdma.json

51
BBWY.Server.Business/Sync/JDPopularizeSyncBusiness.cs

@ -66,29 +66,29 @@ namespace BBWY.Server.Business.Sync
});
}
#region 新增pin保存逻辑
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 pinchajiList = pinList.Except(dbPinList).ToList();
List<JdShopPin> insertJDShopPinList = null;
if (pinchajiList.Count() > 0)
{
insertJDShopPinList = pinchajiList.Select(pin => new JdShopPin()
{
Id = idGenerator.NewLong(),
AccessPin = pin,
CreateTime = DateTime.Now,
ShopId = shopId
}).ToList();
}
#endregion
//#region 新增pin保存逻辑
//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 pinchajiList = pinList.Except(dbPinList).ToList();
//List<JdShopPin> insertJDShopPinList = null;
//if (pinchajiList.Count() > 0)
//{
// insertJDShopPinList = pinchajiList.Select(pin => new JdShopPin()
// {
// Id = idGenerator.NewLong(),
// AccessPin = pin,
// CreateTime = DateTime.Now,
// ShopId = shopId
// }).ToList();
//}
//#endregion
fsql.Transaction(() =>
{
if (insertJDShopPinList != null)
fsql.Insert(insertJDShopPinList).ExecuteAffrows();
fsql.Insert(insertList).ExecuteAffrows();
});
//fsql.Transaction(() =>
// {
// if (insertJDShopPinList != null)
// fsql.Insert(insertJDShopPinList).ExecuteAffrows();
fsql.Insert(insertList).ExecuteAffrows();
//});
}
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)
{
var shopIds = shops.Select(s => Convert.ToInt64(s.ShopId)).ToList();
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();
});
fsql.Delete<Shoppopularize>().Where(s => shopIds.Contains(s.ShopId.Value) && s.Date >= startDate && s.Date <= endDate).ExecuteAffrows();
}
public void SyncAllShopPopularizeRecord()

4
doc/.back_步步为盈数据库/步步为盈数据库-backup-20221011194630.pdma.json → doc/.back_步步为盈数据库/步步为盈数据库-backup-20221011194720.pdma.json

@ -2,9 +2,9 @@
"name": "步步为盈数据库",
"describe": "步步为盈数据库关系图",
"avatar": "",
"version": "4.1.1",
"version": "4.1.3",
"createdTime": "2022-10-3 12:39:39",
"updatedTime": "2022-10-11 19:45:20",
"updatedTime": "2022-10-11 03:56:02",
"dbConns": [],
"profile": {
"default": {

2
doc/步步为盈数据库.pdma.json

@ -4,7 +4,7 @@
"avatar": "",
"version": "4.1.1",
"createdTime": "2022-10-3 12:39:39",
"updatedTime": "2022-10-11 19:46:30",
"updatedTime": "2022-10-11 19:47:20",
"dbConns": [],
"profile": {
"default": {

Loading…
Cancel
Save