Browse Source

取消JDShopPin逻辑

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

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

@ -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.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() public void SyncAllShopPopularizeRecord()

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

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

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

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

Loading…
Cancel
Save