diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs index 3e7e213a..7d3740b8 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs @@ -26,14 +26,11 @@ public class GainfoGroupService : IGainfoGroupService public async Task> GetTreeAsync() { var gainfoGroups = await _dbContext.Queryable() - .Select() - .ToListAsync(); + .Select() + .ToListAsync(); var tops = gainfoGroups.Where(x => !x.PCode.HasValue).ToList(); - tops.ForEach(x => - { - RecursionGetNext(x, gainfoGroups); - }); + tops.ForEach(x => { RecursionGetNext(x, gainfoGroups); }); return tops; } @@ -80,9 +77,9 @@ public class GainfoGroupService : IGainfoGroupService .ToListAsync(); var list = await _dbContext.Queryable() - .Where(x => userNos.Contains(x.No)) - .Select() - .ToListAsync(); + .Where(x => userNos.Contains(x.No)) + .Select() + .ToListAsync(); return list; } @@ -103,7 +100,10 @@ public class GainfoGroupService : IGainfoGroupService var relations = await _dbContext.Queryable().Where(x => x.GroupCode == request.GroupCode).ToListAsync(); await _dbContext.DeleteReallyAsync(relations); - request.UserNos = await _dbContext.Queryable().Where(x => request.UserNos.Contains(x.No)).Select(x => x.No).ToListAsync(); + request.UserNos = await _dbContext.Queryable().Where(x => request.UserNos.Contains(x.No) || request.UserNos.Contains(x.Code)) + .Select(x => x.No) + .ToListAsync(); + var entities = request.UserNos.Select(x => new GainfoGroupRelationshipEntity { GroupCode = request.GroupCode, @@ -111,7 +111,6 @@ public class GainfoGroupService : IGainfoGroupService }).ToList(); await _dbContext.InsertAsync(entities); - }, null); } @@ -151,7 +150,6 @@ public class GainfoGroupService : IGainfoGroupService } return false; - }).ToList(); current.Next = next; foreach (var item in next) @@ -159,4 +157,4 @@ public class GainfoGroupService : IGainfoGroupService RecursionGetNext(item, gainfoGroups); } } -} +} \ No newline at end of file