This commit is contained in:
2021-06-01 10:55:21 +08:00
2 changed files with 4 additions and 5 deletions

View File

@@ -358,9 +358,9 @@ namespace Ewide.Core.Service
{
var org = await _sysOrgRep.FirstOrDefaultAsync(o => o.Id == orgId);
if (dataScopeType == (int)DataScopeType.AREA_WITH_CHILD)
return await _sysOrgRep.DetachedEntities.Where(p => p.AreaCode.StartsWith(org.Code)).Select(p => p.Id).ToListAsync();
return await _sysOrgRep.DetachedEntities.Where(p => p.AreaCode.StartsWith(org.AreaCode)).Select(p => p.Id).ToListAsync();
if (dataScopeType == (int)DataScopeType.AREA)
return await _sysOrgRep.DetachedEntities.Where(p => p.AreaCode == org.Code).Select(p => p.Id).ToListAsync();
return await _sysOrgRep.DetachedEntities.Where(p => p.AreaCode == org.AreaCode).Select(p => p.Id).ToListAsync();
return new List<string>();
}
public async Task<List<string>> GetAreaDataScopeIdListWithoutChildrenArea(string areaNumberCode)

View File

@@ -75,9 +75,8 @@ namespace Ewide.Core.Service
List<string> areaDataScopeIdList = new List<string>();
foreach (var areaNumberCode in areaList)
{
areaDataScopeIdList.AddRange(await _sysOrgRep.DetachedEntities.Where(p => p.AreaCode == areaNumberCode).Select(p => p.Id).ToListAsync());
}
//用户自定义的组织权限
areaDataScopeIdList.AddRange(await _sysOrgRep.DetachedEntities.Where(p => p.AreaCode.StartsWith(areaNumberCode)).Select(p => p.Id).ToListAsync());
} //用户自定义的组织权限
var orgIdList = await _sysUserDataScopeRep.DetachedEntities
.Where(u => u.SysUserId == userId)
.Select(u => u.SysOrgId).ToListAsync();