| 
					
					
					
				 | 
				@ -1,9 +1,11 @@ | 
			
		
		
	
		
			
				 | 
				 | 
				using Microsoft.EntityFrameworkCore; | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				using AutoMapper.Internal.Mappers; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				using Microsoft.EntityFrameworkCore; | 
			
		
		
	
		
			
				 | 
				 | 
				using Microsoft.Extensions.Caching.Distributed; | 
				 | 
				 | 
				using Microsoft.Extensions.Caching.Distributed; | 
			
		
		
	
		
			
				 | 
				 | 
				using Microsoft.Extensions.Caching.Memory; | 
				 | 
				 | 
				using Microsoft.Extensions.Caching.Memory; | 
			
		
		
	
		
			
				 | 
				 | 
				using NPOI.SS.Formula.Functions; | 
				 | 
				 | 
				using NPOI.SS.Formula.Functions; | 
			
		
		
	
		
			
				 | 
				 | 
				using Shentun.Peis.Enums; | 
				 | 
				 | 
				using Shentun.Peis.Enums; | 
			
		
		
	
		
			
				 | 
				 | 
				using Shentun.Peis.Models; | 
				 | 
				 | 
				using Shentun.Peis.Models; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				using Shentun.Peis.MyUser; | 
			
		
		
	
		
			
				 | 
				 | 
				using Shentun.Peis.SysParmValues; | 
				 | 
				 | 
				using Shentun.Peis.SysParmValues; | 
			
		
		
	
		
			
				 | 
				 | 
				using System; | 
				 | 
				 | 
				using System; | 
			
		
		
	
		
			
				 | 
				 | 
				using System.Collections.Generic; | 
				 | 
				 | 
				using System.Collections.Generic; | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -21,7 +23,7 @@ namespace Shentun.Peis | 
			
		
		
	
		
			
				 | 
				 | 
				{ | 
				 | 
				 | 
				{ | 
			
		
		
	
		
			
				 | 
				 | 
				    public class CacheService : ISingletonDependency | 
				 | 
				 | 
				    public class CacheService : ISingletonDependency | 
			
		
		
	
		
			
				 | 
				 | 
				    { | 
				 | 
				 | 
				    { | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IDistributedCache<IdentityUser, Guid> _userCache; | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        private readonly IDistributedCache<IdentityUserWithExtensionDto, Guid> _userCache; | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IMemoryCache _customerOrgCache; | 
				 | 
				 | 
				        private readonly IMemoryCache _customerOrgCache; | 
			
		
		
	
		
			
				 | 
				 | 
				        //private readonly IDistributedCache<CustomerOrg, Guid> _customerOrgCache;
 | 
				 | 
				 | 
				        //private readonly IDistributedCache<CustomerOrg, Guid> _customerOrgCache;
 | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IDistributedCache<string, Guid> _customerOrgTopNameCache; | 
				 | 
				 | 
				        private readonly IDistributedCache<string, Guid> _customerOrgTopNameCache; | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
						
							
						
					
					
				 | 
				@ -60,7 +62,7 @@ namespace Shentun.Peis | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IDistributedCache<string, string> _customerOrgDisplayModeCache; | 
				 | 
				 | 
				        private readonly IDistributedCache<string, string> _customerOrgDisplayModeCache; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				        public CacheService( | 
				 | 
				 | 
				        public CacheService( | 
			
		
		
	
		
			
				 | 
				 | 
				            IDistributedCache<IdentityUser, Guid> userCache, | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            IDistributedCache<IdentityUserWithExtensionDto, Guid> userCache, | 
			
		
		
	
		
			
				 | 
				 | 
				             IMemoryCache customerOrgCache, | 
				 | 
				 | 
				             IMemoryCache customerOrgCache, | 
			
		
		
	
		
			
				 | 
				 | 
				            IDistributedCache<Nation, string> nationCache, | 
				 | 
				 | 
				            IDistributedCache<Nation, string> nationCache, | 
			
		
		
	
		
			
				 | 
				 | 
				             IRepository<IdentityUser, Guid> userRepository, | 
				 | 
				 | 
				             IRepository<IdentityUser, Guid> userRepository, | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
						
							
						
					
					
				 | 
				@ -131,12 +133,44 @@ namespace Shentun.Peis | 
			
		
		
	
		
			
				 | 
				 | 
				            _diagnosisLevelRepository = diagnosisLevelRepository; | 
				 | 
				 | 
				            _diagnosisLevelRepository = diagnosisLevelRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				        } | 
				 | 
				 | 
				        } | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				        private async Task<IdentityUser> GetUserAsync(Guid id) | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        private async Task<IdentityUserWithExtensionDto> GetUserAsync(Guid id) | 
			
		
		
	
		
			
				 | 
				 | 
				        { | 
				 | 
				 | 
				        { | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				            var entity = await _userCache.GetOrAddAsync( | 
				 | 
				 | 
				            var entity = await _userCache.GetOrAddAsync( | 
			
		
		
	
		
			
				 | 
				 | 
				               id, //缓存键
 | 
				 | 
				 | 
				               id, //缓存键
 | 
			
		
		
	
		
			
				 | 
				 | 
				                async () => await _userRepository.FirstOrDefaultAsync(m => m.Id == id) | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                async () => | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    var dataEntity = await _userRepository.FirstOrDefaultAsync(m => m.Id == id); | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    var userSign = dataEntity.GetProperty<string>("user_sign"); | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    var userPhoto = dataEntity.GetProperty<string>("user_photo"); | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    var entDto = new IdentityUserWithExtensionDto | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        ConcurrencyStamp = dataEntity.ConcurrencyStamp, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        CreationTime = dataEntity.CreationTime, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        CreatorId = dataEntity.CreatorId, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        DeleterId = dataEntity.DeleterId, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        DeletionTime = dataEntity.DeletionTime, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        Email = dataEntity.Email, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        EmailConfirmed = dataEntity.EmailConfirmed, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        Id = dataEntity.Id, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        IsActive = dataEntity.IsActive, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        IsDeleted = dataEntity.IsDeleted, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        LastModificationTime = dataEntity.LastModificationTime, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        LastModifierId = dataEntity.LastModifierId, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        LockoutEnabled = dataEntity.LockoutEnabled, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        LockoutEnd = dataEntity.LockoutEnd, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        Name = dataEntity.Name, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        PhoneNumber = dataEntity.PhoneNumber, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        PhoneNumberConfirmed = dataEntity.PhoneNumberConfirmed, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        Surname = dataEntity.Surname, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        TenantId = dataEntity.TenantId, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        UserName = dataEntity.UserName, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        UserPhoto = userPhoto, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                        UserSign = userSign | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    }; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    return entDto; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                } | 
			
		
		
	
		
			
				 | 
				 | 
				            ); | 
				 | 
				 | 
				            ); | 
			
		
		
	
		
			
				 | 
				 | 
				            return entity; | 
				 | 
				 | 
				            return entity; | 
			
		
		
	
		
			
				 | 
				 | 
				        } | 
				 | 
				 | 
				        } | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -162,7 +196,10 @@ namespace Shentun.Peis | 
			
		
		
	
		
			
				 | 
				 | 
				            } | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				            var entity = await GetUserAsync((Guid)id); | 
				 | 
				 | 
				            var entity = await GetUserAsync((Guid)id); | 
			
		
		
	
		
			
				 | 
				 | 
				            if (entity != null) | 
				 | 
				 | 
				            if (entity != null) | 
			
		
		
	
		
			
				 | 
				 | 
				                return entity.GetProperty<string>("user_sign"); | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                return entity.UserSign; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				            else | 
				 | 
				 | 
				            else | 
			
		
		
	
		
			
				 | 
				 | 
				                return ""; | 
				 | 
				 | 
				                return ""; | 
			
		
		
	
		
			
				 | 
				 | 
				        } | 
				 | 
				 | 
				        } | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
					
				 | 
				
  |