From 0c249a8e04786dfe2dee0b5b783c927712c8951c Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 10 Oct 2024 18:29:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=83=A8=E9=97=A8=E5=88=86=E9=85=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/DevicePermissionService.cs | 12 +++++++----- .../Controllers/GainfoFacesController.cs | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) 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;