From bd18dd95b7578b6ef58ffe94da48b92c0f4edba8 Mon Sep 17 00:00:00 2001 From: Xy Date: Fri, 23 Apr 2021 10:40:07 +0000 Subject: [PATCH] --- Api/Dilon.Core/Manager/UserManager.cs | 4 ++-- Api/Dilon.Core/Service/Cache/SysCacheService.cs | 14 +++++++------- .../Service/Emp/Dto/EmpExtOrgPosOutput.cs | 4 ++-- Api/Dilon.Core/Service/Emp/Dto/EmpOutput2.cs | 2 +- Api/Dilon.Core/Service/Emp/Dto/EmpPosOutput.cs | 2 +- Api/Dilon.Core/Service/Emp/ISysEmpPosService.cs | 8 ++++---- .../Service/Emp/SysEmpExtOrgPosService.cs | 10 +++++----- Api/Dilon.Core/Service/Emp/SysEmpPosService.cs | 8 ++++---- Api/Dilon.Core/Service/Emp/SysEmpService.cs | 12 ++++++------ 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Api/Dilon.Core/Manager/UserManager.cs b/Api/Dilon.Core/Manager/UserManager.cs index c243cfe..0ca2122 100644 --- a/Api/Dilon.Core/Manager/UserManager.cs +++ b/Api/Dilon.Core/Manager/UserManager.cs @@ -15,9 +15,9 @@ namespace Dilon.Core private readonly IRepository _sysEmpRep; // 员工表 private readonly IHttpContextAccessor _httpContextAccessor; - public long UserId + public string UserId { - get => long.Parse(_httpContextAccessor.HttpContext.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value); + get => _httpContextAccessor.HttpContext.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value; } public string Account diff --git a/Api/Dilon.Core/Service/Cache/SysCacheService.cs b/Api/Dilon.Core/Service/Cache/SysCacheService.cs index 5b76ac5..4f1edd3 100644 --- a/Api/Dilon.Core/Service/Cache/SysCacheService.cs +++ b/Api/Dilon.Core/Service/Cache/SysCacheService.cs @@ -30,10 +30,10 @@ namespace Dilon.Core.Service /// /// /// - public async Task> GetDataScope(long userId) + public async Task> GetDataScope(string userId) { var cacheKey = CommonConst.CACHE_KEY_DATASCOPE + $"{userId}"; - return await _cache.GetAsync>(cacheKey); + return await _cache.GetAsync>(cacheKey); } /// @@ -43,7 +43,7 @@ namespace Dilon.Core.Service /// /// [NonAction] - public async Task SetDataScope(long userId, List dataScopes) + public async Task SetDataScope(string userId, List dataScopes) { var cacheKey = CommonConst.CACHE_KEY_DATASCOPE + $"{userId}"; await _cache.SetAsync(cacheKey, dataScopes); @@ -55,7 +55,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task> GetMenu(long userId, string appCode) + public async Task> GetMenu(string userId, string appCode) { var cacheKey = CommonConst.CACHE_KEY_MENU + $"{userId}-{appCode}"; return await _cache.GetAsync>(cacheKey); @@ -69,7 +69,7 @@ namespace Dilon.Core.Service /// /// [NonAction] - public async Task SetMenu(long userId, string appCode, List menus) + public async Task SetMenu(string userId, string appCode, List menus) { var cacheKey = CommonConst.CACHE_KEY_MENU + $"{userId}-{appCode}"; await _cache.SetAsync(cacheKey, menus); @@ -80,7 +80,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task> GetPermission(long userId) + public async Task> GetPermission(string userId) { var cacheKey = CommonConst.CACHE_KEY_PERMISSION + $"{userId}"; return await _cache.GetAsync>(cacheKey); @@ -93,7 +93,7 @@ namespace Dilon.Core.Service /// /// [NonAction] - public async Task SetPermission(long userId, List permissions) + public async Task SetPermission(string userId, List permissions) { var cacheKey = CommonConst.CACHE_KEY_PERMISSION + $"{userId}"; await _cache.SetAsync(cacheKey, permissions); diff --git a/Api/Dilon.Core/Service/Emp/Dto/EmpExtOrgPosOutput.cs b/Api/Dilon.Core/Service/Emp/Dto/EmpExtOrgPosOutput.cs index 630894c..29886b7 100644 --- a/Api/Dilon.Core/Service/Emp/Dto/EmpExtOrgPosOutput.cs +++ b/Api/Dilon.Core/Service/Emp/Dto/EmpExtOrgPosOutput.cs @@ -8,7 +8,7 @@ /// /// 附属机构id /// - public long OrgId { get; set; } + public string OrgId { get; set; } /// /// 附属机构编码 @@ -23,7 +23,7 @@ /// /// 附属职位id /// - public long PosId { get; set; } + public string PosId { get; set; } /// /// 附属职位编码 diff --git a/Api/Dilon.Core/Service/Emp/Dto/EmpOutput2.cs b/Api/Dilon.Core/Service/Emp/Dto/EmpOutput2.cs index 07d7580..de58111 100644 --- a/Api/Dilon.Core/Service/Emp/Dto/EmpOutput2.cs +++ b/Api/Dilon.Core/Service/Emp/Dto/EmpOutput2.cs @@ -35,6 +35,6 @@ namespace Dilon.Core.Service /// /// 职位集合 /// - public List PosIdList { get; set; } = new List(); + public List PosIdList { get; set; } = new List(); } } diff --git a/Api/Dilon.Core/Service/Emp/Dto/EmpPosOutput.cs b/Api/Dilon.Core/Service/Emp/Dto/EmpPosOutput.cs index 9c44fa1..a79b21d 100644 --- a/Api/Dilon.Core/Service/Emp/Dto/EmpPosOutput.cs +++ b/Api/Dilon.Core/Service/Emp/Dto/EmpPosOutput.cs @@ -8,7 +8,7 @@ /// /// 职位Id /// - public long PosId { get; set; } + public string PosId { get; set; } /// /// 职位编码 diff --git a/Api/Dilon.Core/Service/Emp/ISysEmpPosService.cs b/Api/Dilon.Core/Service/Emp/ISysEmpPosService.cs index f3808b1..399302b 100644 --- a/Api/Dilon.Core/Service/Emp/ISysEmpPosService.cs +++ b/Api/Dilon.Core/Service/Emp/ISysEmpPosService.cs @@ -5,9 +5,9 @@ namespace Dilon.Core.Service { public interface ISysEmpPosService { - Task AddOrUpdate(long empId, List posIdList); - Task DeleteEmpPosInfoByUserId(long empId); - Task> GetEmpPosList(long empId); - Task HasPosEmp(long posId); + Task AddOrUpdate(string empId, List posIdList); + Task DeleteEmpPosInfoByUserId(string empId); + Task> GetEmpPosList(string empId); + Task HasPosEmp(string posId); } } \ No newline at end of file diff --git a/Api/Dilon.Core/Service/Emp/SysEmpExtOrgPosService.cs b/Api/Dilon.Core/Service/Emp/SysEmpExtOrgPosService.cs index 6173825..1cf305e 100644 --- a/Api/Dilon.Core/Service/Emp/SysEmpExtOrgPosService.cs +++ b/Api/Dilon.Core/Service/Emp/SysEmpExtOrgPosService.cs @@ -25,7 +25,7 @@ namespace Dilon.Core.Service /// /// [UnitOfWork] - public async Task AddOrUpdate(long empId, List extIdList) + public async Task AddOrUpdate(string empId, List extIdList) { // 先删除 await DeleteEmpExtInfoByUserId(empId); @@ -48,7 +48,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task> GetEmpExtOrgPosList(long empId) + public async Task> GetEmpExtOrgPosList(string empId) { return await _sysEmpExtOrgPosRep.DetachedEntities .Where(u => u.SysEmpId == empId) @@ -68,7 +68,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task HasExtOrgEmp(long orgId) + public async Task HasExtOrgEmp(string orgId) { return await _sysEmpExtOrgPosRep.DetachedEntities.AnyAsync(u => u.SysOrgId == orgId); } @@ -78,7 +78,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task HasExtPosEmp(long posId) + public async Task HasExtPosEmp(string posId) { return await _sysEmpExtOrgPosRep.DetachedEntities.AnyAsync(u => u.SysPosId == posId); } @@ -88,7 +88,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task DeleteEmpExtInfoByUserId(long empId) + public async Task DeleteEmpExtInfoByUserId(string empId) { var empExtOrgPos = await _sysEmpExtOrgPosRep.Where(u => u.SysEmpId == empId).ToListAsync(); empExtOrgPos.ForEach(u => diff --git a/Api/Dilon.Core/Service/Emp/SysEmpPosService.cs b/Api/Dilon.Core/Service/Emp/SysEmpPosService.cs index 382b3e8..13faa83 100644 --- a/Api/Dilon.Core/Service/Emp/SysEmpPosService.cs +++ b/Api/Dilon.Core/Service/Emp/SysEmpPosService.cs @@ -27,7 +27,7 @@ namespace Dilon.Core.Service /// 职位id集合 /// [UnitOfWork] - public async Task AddOrUpdate(long empId, List posIdList) + public async Task AddOrUpdate(string empId, List posIdList) { // 先删除 await DeleteEmpPosInfoByUserId(empId); @@ -46,7 +46,7 @@ namespace Dilon.Core.Service /// 获取所属职位信息 /// /// 员工Id(用户Id) - public async Task> GetEmpPosList(long empId) + public async Task> GetEmpPosList(string empId) { return await _sysEmpPosRep.DetachedEntities .Where(u => u.SysEmpId == empId) @@ -63,7 +63,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task HasPosEmp(long posId) + public async Task HasPosEmp(string posId) { return await _sysEmpPosRep.DetachedEntities.AnyAsync(u => u.SysPosId == posId); } @@ -73,7 +73,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task DeleteEmpPosInfoByUserId(long empId) + public async Task DeleteEmpPosInfoByUserId(string empId) { var empPos = await _sysEmpPosRep.Where(u => u.SysEmpId == empId).ToListAsync(); empPos.ForEach(u => diff --git a/Api/Dilon.Core/Service/Emp/SysEmpService.cs b/Api/Dilon.Core/Service/Emp/SysEmpService.cs index 37646e5..41a2ef0 100644 --- a/Api/Dilon.Core/Service/Emp/SysEmpService.cs +++ b/Api/Dilon.Core/Service/Emp/SysEmpService.cs @@ -31,7 +31,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task GetEmpInfo(long empId) + public async Task GetEmpInfo(string empId) { var empInfoOutput = new EmpOutput(); var sysEmp = await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == empId, false); @@ -51,7 +51,7 @@ namespace Dilon.Core.Service public async Task AddOrUpdate(EmpOutput2 sysEmpParam) { // 先删除员工信息 - var emps = await _sysEmpRep.Where(u => u.Id == long.Parse(sysEmpParam.Id)).ToListAsync(); + var emps = await _sysEmpRep.Where(u => u.Id == sysEmpParam.Id).ToListAsync(); emps.ForEach(u => { u.DeleteNow(); @@ -74,7 +74,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task UpdateEmpOrgInfo(long orgId, string orgName) + public async Task UpdateEmpOrgInfo(string orgId, string orgName) { var emps = await _sysEmpRep.Where(u => u.OrgId == orgId).ToListAsync(); emps.ForEach(u => @@ -88,7 +88,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task HasOrgEmp(long orgId) + public async Task HasOrgEmp(string orgId) { return await _sysEmpRep.DetachedEntities.AnyAsync(u => u.OrgId == orgId); } @@ -99,7 +99,7 @@ namespace Dilon.Core.Service /// /// [UnitOfWork] - public async Task DeleteEmpInfoByUserId(long empId) + public async Task DeleteEmpInfoByUserId(string empId) { // 删除员工信息 var emp = await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == empId); @@ -117,7 +117,7 @@ namespace Dilon.Core.Service /// /// /// - public async Task GetEmpOrgId(long empId) + public async Task GetEmpOrgId(string empId) { return (await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == empId, false)).OrgId; }