fix 部门分配问题
This commit is contained in:
@@ -560,10 +560,12 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
var gainfoByDeptWhere = LinqExpressionExtensions.False<GainfoEntity>();
|
var gainfoByDeptWhere = LinqExpressionExtensions.False<GainfoEntity>();
|
||||||
foreach ((string factory, List<string> departmentNos) in tenantDepartmentNos)
|
foreach ((string factory, List<string> departmentNos) in tenantDepartmentNos)
|
||||||
{
|
{
|
||||||
var matchDepartments = departmentNos.ToHashSet();
|
var departmentNosToSearch = new List<string>();
|
||||||
departmentNos.ForEach(x => RecursionGetNextAllDepartment(x, departments, matchDepartments));
|
foreach (var d in departmentNos)
|
||||||
|
{
|
||||||
var departmentNosToSearch = matchDepartments.ToList();
|
departmentNosToSearch.Add(d);
|
||||||
|
RecursionGetNextAllDepartment(d, departments, departmentNosToSearch);
|
||||||
|
}
|
||||||
|
|
||||||
gainfoByDeptWhere = gainfoByDeptWhere.Or(x => x.Factory == factory && departmentNosToSearch.Contains(x.DepartmentNo));
|
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();
|
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);
|
var next = data.Where(x => x.PNo == current);
|
||||||
foreach (var item in next.Select(x => x.No))
|
foreach (var item in next.Select(x => x.No))
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user