Quellcode durchsuchen

优化部分逻辑

yuanrf vor 1 Jahr
Ursprung
Commit
bd03815e67

+ 5 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -10,6 +10,7 @@ using OASystem.Infrastructure.Tools;
 using Org.BouncyCastle.Utilities.Encoders;
 using StackExchange.Redis;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
@@ -635,7 +636,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
             _sqlSugar.BeginTran();
             try
             {
-                _sqlSugar.Updateable<Grp_TourClientList>().SetColumns(x=> new Grp_TourClientList { IsDel = 1 } ).Where(x=>x.DiId == diid).ExecuteCommand();
+                var ids = new List<int>();
+                ids = _TourClientListInfos.Select(x => x.Id).ToList();
+                _sqlSugar.Updateable<Grp_TourClientList>().SetColumns(x=> new Grp_TourClientList { IsDel = 1 } ).Where(x=>x.DiId == diid && !(ids.Contains(x.Id)) ).ExecuteCommand();
 
                 foreach (var item in _TourClientListInfos)
                 {
@@ -842,7 +845,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         HotelSpecialNeeds = item.HotelSpecialNeeds,
                         MealSpecialNeeds = item.MealSpecialNeeds,
                         Remark = item.Remark,
-                        CreateUserId = userId
+                        CreateUserId = userId,
                     };
 
                     if (item.Id < 1) // 添加