fix 部门分配问题
This commit is contained in:
@@ -560,10 +560,12 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
var gainfoByDeptWhere = LinqExpressionExtensions.False<GainfoEntity>();
|
||||
foreach ((string factory, List<string> departmentNos) in tenantDepartmentNos)
|
||||
{
|
||||
var matchDepartments = departmentNos.ToHashSet();
|
||||
departmentNos.ForEach(x => RecursionGetNextAllDepartment(x, departments, matchDepartments));
|
||||
|
||||
var departmentNosToSearch = matchDepartments.ToList();
|
||||
var departmentNosToSearch = new List<string>();
|
||||
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<DepartmentEntity> data, HashSet<string> result)
|
||||
void RecursionGetNextAllDepartment(string current, List<DepartmentEntity> data, List<string> result)
|
||||
{
|
||||
var next = data.Where(x => x.PNo == current);
|
||||
foreach (var item in next.Select(x => x.No))
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user