Ver a proveniência

模块

master
747575620@qq.com há 1 ano
ascendente
cometimento
dcecc112bc
1 ficheiros alterados com 11 adições e 1 eliminações
  1. +11
    -1
      backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs

+ 11
- 1
backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs Ver ficheiro

@@ -402,8 +402,18 @@
public async Task<bool> AddRoleModule(RoleModuleAddInput input)
{
List<RoleModuleEntity> entitys = new();
var moduleList =await _dbContext.Queryable<ModuleEntity>().ToListAsync();
var parentId = input.ModuleIds.Where(x=>x.ParentId!="").GroupBy(x => x.ParentId).ToList();
foreach (var item in parentId)
{
if (input.ModuleIds.FirstOrDefault(x=>x.ModuleId==item.Key && x.ParentId=="")==null)
{
input.ModuleIds.Add(new RoleModuleDto { ModuleId = item.Key, ParentId = "", RoleId = input.RoleId });
}
}
foreach (var item in input.ModuleIds)
{
RoleModuleEntity entity = new()
{
ModuleId = item.ModuleId,
@@ -433,7 +443,7 @@
[HttpGet]
public async Task<List<RoleModuleOutput>> RoleModuleList(string RoleId)
{
var entitys = await _dbContext.Queryable<RoleModuleEntity>().Where(x => x.RoleId == RoleId).ToListAsync();
var entitys = await _dbContext.Queryable<RoleModuleEntity>().Where(x => x.RoleId == RoleId&&x.ParentId!="").ToListAsync();
var output = entitys.Adapt<List<RoleModuleOutput>>();
return output;
}


Carregando…
Cancelar
Guardar