diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs index 36f67d0f..2373f0e1 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs @@ -560,10 +560,12 @@ public class DevicePermissionService : IDevicePermissionService var gainfoByDeptWhere = LinqExpressionExtensions.False(); foreach ((string factory, List departmentNos) in tenantDepartmentNos) { - var matchDepartments = departmentNos.ToHashSet(); - departmentNos.ForEach(x => RecursionGetNextAllDepartment(x, departments, matchDepartments)); - - var departmentNosToSearch = matchDepartments.ToList(); + var departmentNosToSearch = new List(); + foreach (var d in departmentNos) + { + departmentNosToSearch.Add(d); + RecursionGetNextAllDepartment(d, departments, departmentNosToSearch); + } gainfoByDeptWhere = gainfoByDeptWhere.Or(x => x.Factory == factory && departmentNosToSearch.Contains(x.DepartmentNo)); } @@ -580,7 +582,7 @@ public class DevicePermissionService : IDevicePermissionService return userNos.Concat(userNosByGroup).Concat(userNosByDepartment).Concat(userNosByWerk).Distinct().ToList(); - void RecursionGetNextAllDepartment(string current, List data, HashSet result) + void RecursionGetNextAllDepartment(string current, List data, List result) { var next = data.Where(x => x.PNo == current); foreach (var item in next.Select(x => x.No)) diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoFacesController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoFacesController.cs index db4cffa8..fbff304d 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfoFacesController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfoFacesController.cs @@ -1,7 +1,6 @@ using Dlhis.Basic.Organization.Request; using Dlhis.Basic.Organization.Response; using Dlhis.Basic.Organization.Services; -using Kurisu.AspNetCore.DataAccess.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc;