diff --git a/BBWY.Server.Business/Sync/StoreHouseSyncBusiness.cs b/BBWY.Server.Business/Sync/StoreHouseSyncBusiness.cs index f8db1684..a33a7c0d 100644 --- a/BBWY.Server.Business/Sync/StoreHouseSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/StoreHouseSyncBusiness.cs @@ -78,19 +78,19 @@ namespace BBWY.Server.Business.Sync } } - //var storeHouseIds = storeHouseList.Select(s => s.Id).ToArray(); - //var dbStoreIds = fsql.Select(storeHouseIds).ToList(s => s.Id); - //var exceptIds = storeHouseIds.Except(dbStoreIds); - //if (exceptIds.Count() > 0) - //{ - // var insertList = storeHouseList.Where(s => exceptIds.Contains(s.Id)).ToList(); - // fsql.Insert(insertList).ExecuteAffrows(); - //} - fsql.Transaction(() => + var storeHouseIds = storeHouseList.Select(s => s.Id).ToArray(); + var dbStoreIds = fsql.Select(storeHouseIds).ToList(s => s.Id); + var exceptIds = storeHouseIds.Except(dbStoreIds); + if (exceptIds.Count() > 0) { - fsql.Delete().Where(s => 1 == 1).ExecuteAffrows(); - fsql.Insert(storeHouseList).ExecuteAffrows(); - }); + var insertList = storeHouseList.Where(s => exceptIds.Contains(s.Id)).ToList(); + fsql.Insert(insertList).ExecuteAffrows(); + } + //fsql.Transaction(() => + //{ + // fsql.Delete().Where(s => 1 == 1).ExecuteAffrows(); + // fsql.Insert(storeHouseList).ExecuteAffrows(); + //}); }