|
|
@ -37,13 +37,15 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
|
|
|
|
private readonly ISysEmpService _sysEmpService;
|
|
|
|
private readonly ISysEmpService _sysEmpService;
|
|
|
|
private readonly ISysUserDataScopeService _sysUserDataScopeService;
|
|
|
|
private readonly ISysUserDataScopeService _sysUserDataScopeService;
|
|
|
|
private readonly ISysUserRoleService _sysUserRoleService;
|
|
|
|
private readonly ISysUserRoleService _sysUserRoleService;
|
|
|
|
|
|
|
|
private readonly ISysEmpPosService _sysEmpPosService;
|
|
|
|
|
|
|
|
|
|
|
|
public SysUserService(SqlSugarRepository<SysUser> sysUserRep,
|
|
|
|
public SysUserService(SqlSugarRepository<SysUser> sysUserRep,
|
|
|
|
ISysCacheService sysCacheService,
|
|
|
|
ISysCacheService sysCacheService,
|
|
|
|
ISysEmpService sysEmpService,
|
|
|
|
ISysEmpService sysEmpService,
|
|
|
|
ISysUserDataScopeService sysUserDataScopeService,
|
|
|
|
ISysUserDataScopeService sysUserDataScopeService,
|
|
|
|
ISysUserRoleService sysUserRoleService,
|
|
|
|
ISysUserRoleService sysUserRoleService,
|
|
|
|
ISysConfigService sysConfigService)
|
|
|
|
ISysConfigService sysConfigService,
|
|
|
|
|
|
|
|
ISysEmpPosService sysEmpPosService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_sysUserRep = sysUserRep;
|
|
|
|
_sysUserRep = sysUserRep;
|
|
|
|
_sysCacheService = sysCacheService;
|
|
|
|
_sysCacheService = sysCacheService;
|
|
|
@ -51,6 +53,7 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
|
|
|
|
_sysUserDataScopeService = sysUserDataScopeService;
|
|
|
|
_sysUserDataScopeService = sysUserDataScopeService;
|
|
|
|
_sysUserRoleService = sysUserRoleService;
|
|
|
|
_sysUserRoleService = sysUserRoleService;
|
|
|
|
_sysConfigService = sysConfigService;
|
|
|
|
_sysConfigService = sysConfigService;
|
|
|
|
|
|
|
|
_sysEmpPosService = sysEmpPosService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -597,4 +600,26 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
|
|
|
|
|
|
|
|
|
|
|
|
throw Oops.Bah("没有权限");
|
|
|
|
throw Oops.Bah("没有权限");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 通过职位获取用户信息
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
|
|
|
/// <param name="pos">职位代码 PCDD-调度</param>
|
|
|
|
|
|
|
|
/// <returns>返回用户详情</returns>
|
|
|
|
|
|
|
|
[HttpGet("/sysUser/QueryUserByPos")]
|
|
|
|
|
|
|
|
public async Task<List<EmpPosOutput>> QueryUserByPos([FromQuery] string name, [FromQuery] string pos)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(pos))
|
|
|
|
|
|
|
|
Oops.Oh("没有权限");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var allList = await _sysEmpPosService.GetAllEmpByPos(new List<string> { pos });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (allList.Count > 0 && !string.IsNullOrWhiteSpace(name))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
allList = allList.Where(a => a.SysEmpName.Contains(name.Trim())).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return allList;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|