diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 7bd1eef8..2cc363a5 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -11893,6 +11893,14 @@ + + + 获取接口Key 个人或公司 + + + + + 网站账号维护输入参数 @@ -12523,6 +12531,18 @@ 职位名称 + + + 员工名称 + + + + + 通过职位代码列表获取人员ID信息 + + 职位代码列表 + 返回人员ID列表 + 员工附属机构和职位服务 @@ -12595,6 +12615,13 @@ + + + 通过职位代码列表获取人员ID信息 + + 职位代码列表 + 返回人员ID列表 + 员工服务 @@ -15527,6 +15554,14 @@ 默认0 获取当前用户,可不传 传租户id获取当前租户 + + + 获取租户下的用户 + + + 职位代码 PCDD-调度 + 返回用户详情 + EDI参数设置输出参数 diff --git a/Myshipping.Core/Service/Emp/Dto/EmpPosOutput.cs b/Myshipping.Core/Service/Emp/Dto/EmpPosOutput.cs index 87bf65f2..dc2d6cf3 100644 --- a/Myshipping.Core/Service/Emp/Dto/EmpPosOutput.cs +++ b/Myshipping.Core/Service/Emp/Dto/EmpPosOutput.cs @@ -23,4 +23,9 @@ public class EmpPosOutput /// 职位名称 /// public string PosName { get; set; } + + /// + /// 员工名称 + /// + public string SysEmpName { get; set; } } diff --git a/Myshipping.Core/Service/Emp/ISysEmpPosService.cs b/Myshipping.Core/Service/Emp/ISysEmpPosService.cs index 8ca07a89..8ae8777a 100644 --- a/Myshipping.Core/Service/Emp/ISysEmpPosService.cs +++ b/Myshipping.Core/Service/Emp/ISysEmpPosService.cs @@ -10,4 +10,12 @@ public interface ISysEmpPosService Task> GetEmpPosList(long empId); Task> GetEmpPosList(List empIds); Task HasPosEmp(long posId); + + /// + /// 通过职位代码列表获取人员ID信息 + /// + /// 职位代码列表 + /// 返回人员ID列表 + Task> GetAllEmpByPos(List posCodeList); + } diff --git a/Myshipping.Core/Service/Emp/SysEmpPosService.cs b/Myshipping.Core/Service/Emp/SysEmpPosService.cs index e817ce05..eddf3229 100644 --- a/Myshipping.Core/Service/Emp/SysEmpPosService.cs +++ b/Myshipping.Core/Service/Emp/SysEmpPosService.cs @@ -15,10 +15,12 @@ namespace Myshipping.Core.Service; public class SysEmpPosService : ISysEmpPosService, ITransient { private readonly SqlSugarRepository _sysEmpPosRep; // 员工职位表仓储 + private readonly SqlSugarRepository _sysPosRep; - public SysEmpPosService(SqlSugarRepository sysEmpPosRep) + public SysEmpPosService(SqlSugarRepository sysEmpPosRep, SqlSugarRepository sysPosRep) { _sysEmpPosRep = sysEmpPosRep; + _sysPosRep = sysPosRep; } /// @@ -105,4 +107,27 @@ public class SysEmpPosService : ISysEmpPosService, ITransient { await _sysEmpPosRep.DeleteAsync(u => u.SysEmpId == empId); } + + /// + /// 通过职位代码列表获取人员ID信息 + /// + /// 职位代码列表 + /// 返回人员ID列表 + public async Task> GetAllEmpByPos(List posCodeList) + { + var query = _sysPosRep.AsQueryable().Where(a => posCodeList.Contains(a.Code)); + + var list = await query.InnerJoin((l,r)=>l.Id == r.SysPosId) + .InnerJoin((l,r,x)=> r.SysEmpId == x.Id) + .Select((l, r,x) => new EmpPosOutput + { + PosId = l.Id, + PosCode = l.Code, + PosName = l.Name, + SysEmpId = x.Id, + SysEmpName = x.Name + }).ToListAsync(); + + return list; + } } diff --git a/Myshipping.Core/Service/User/SysUserService.cs b/Myshipping.Core/Service/User/SysUserService.cs index 39a8575f..1d6ec50d 100644 --- a/Myshipping.Core/Service/User/SysUserService.cs +++ b/Myshipping.Core/Service/User/SysUserService.cs @@ -37,13 +37,15 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient private readonly ISysEmpService _sysEmpService; private readonly ISysUserDataScopeService _sysUserDataScopeService; private readonly ISysUserRoleService _sysUserRoleService; + private readonly ISysEmpPosService _sysEmpPosService; public SysUserService(SqlSugarRepository sysUserRep, ISysCacheService sysCacheService, ISysEmpService sysEmpService, ISysUserDataScopeService sysUserDataScopeService, ISysUserRoleService sysUserRoleService, - ISysConfigService sysConfigService) + ISysConfigService sysConfigService, + ISysEmpPosService sysEmpPosService) { _sysUserRep = sysUserRep; _sysCacheService = sysCacheService; @@ -51,6 +53,7 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient _sysUserDataScopeService = sysUserDataScopeService; _sysUserRoleService = sysUserRoleService; _sysConfigService = sysConfigService; + _sysEmpPosService = sysEmpPosService; } /// @@ -597,4 +600,26 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient throw Oops.Bah("没有权限"); } + + /// + /// 通过职位获取用户信息 + /// + /// + /// 职位代码 PCDD-调度 + /// 返回用户详情 + [HttpGet("/sysUser/QueryUserByPos")] + public async Task> QueryUserByPos([FromQuery] string name, [FromQuery] string pos) + { + if (string.IsNullOrWhiteSpace(pos)) + Oops.Oh("没有权限"); + + var allList = await _sysEmpPosService.GetAllEmpByPos(new List { pos }); + + if (allList.Count > 0 && !string.IsNullOrWhiteSpace(name)) + { + allList = allList.Where(a => a.SysEmpName.Contains(name.Trim())).ToList(); + } + + return allList; + } }