| 
					
					
						
							
						
					
					
				 | 
				@ -28,15 +28,17 @@ namespace Shentun.Peis.ThirdBookings | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IRepository<ThirdBooking, Guid> _thirdBookingRepository; | 
				 | 
				 | 
				        private readonly IRepository<ThirdBooking, Guid> _thirdBookingRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IRepository<ThirdInterface, Guid> _thirdInterfaceRepository; | 
				 | 
				 | 
				        private readonly IRepository<ThirdInterface, Guid> _thirdInterfaceRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				        private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository; | 
				 | 
				 | 
				        private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        private readonly CacheService _cacheService; | 
			
		
		
	
		
			
				 | 
				 | 
				        public ThirdBookingAppService( | 
				 | 
				 | 
				        public ThirdBookingAppService( | 
			
		
		
	
		
			
				 | 
				 | 
				            IRepository<ThirdBooking, Guid> thirdBookingRepository, | 
				 | 
				 | 
				            IRepository<ThirdBooking, Guid> thirdBookingRepository, | 
			
		
		
	
		
			
				 | 
				 | 
				            IRepository<ThirdInterface, Guid> thirdInterfaceRepository, | 
				 | 
				 | 
				            IRepository<ThirdInterface, Guid> thirdInterfaceRepository, | 
			
		
		
	
		
			
				 | 
				 | 
				            IRepository<CustomerOrg, Guid> customerOrgRepository) | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            IRepository<CustomerOrg, Guid> customerOrgRepository, | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            CacheService cacheService) | 
			
		
		
	
		
			
				 | 
				 | 
				        { | 
				 | 
				 | 
				        { | 
			
		
		
	
		
			
				 | 
				 | 
				            _thirdBookingRepository = thirdBookingRepository; | 
				 | 
				 | 
				            _thirdBookingRepository = thirdBookingRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				            _thirdInterfaceRepository = thirdInterfaceRepository; | 
				 | 
				 | 
				            _thirdInterfaceRepository = thirdInterfaceRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				            _customerOrgRepository = customerOrgRepository; | 
				 | 
				 | 
				            _customerOrgRepository = customerOrgRepository; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            _cacheService = cacheService; | 
			
		
		
	
		
			
				 | 
				 | 
				        } | 
				 | 
				 | 
				        } | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
						
							
						
					
					
				 | 
				@ -85,7 +87,10 @@ namespace Shentun.Peis.ThirdBookings | 
			
		
		
	
		
			
				 | 
				 | 
				            if (!string.IsNullOrWhiteSpace(input.KeyWord)) | 
				 | 
				 | 
				            if (!string.IsNullOrWhiteSpace(input.KeyWord)) | 
			
		
		
	
		
			
				 | 
				 | 
				            { | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				                query = query.Where(m => m.PatientName == input.KeyWord | 
				 | 
				 | 
				                query = query.Where(m => m.PatientName == input.KeyWord | 
			
		
		
	
		
			
				 | 
				 | 
				                || m.IdNo == input.KeyWord || m.Phone == input.KeyWord); | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                || m.IdNo == input.KeyWord | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                || m.Phone == input.KeyWord | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                || m.ChildCompanyName == input.KeyWord | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                || m.DepartmentName == input.KeyWord); | 
			
		
		
	
		
			
				 | 
				 | 
				            } | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				            if (input.MedicalStatus != null) | 
				 | 
				 | 
				            if (input.MedicalStatus != null) | 
			
		
		
	
		
			
				 | 
				 | 
				            { | 
				 | 
				 | 
				            { | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -108,9 +113,28 @@ namespace Shentun.Peis.ThirdBookings | 
			
		
		
	
		
			
				 | 
				 | 
				                ChildCompanyName = s.ChildCompanyName, | 
				 | 
				 | 
				                ChildCompanyName = s.ChildCompanyName, | 
			
		
		
	
		
			
				 | 
				 | 
				                DepartmentName = s.DepartmentName, | 
				 | 
				 | 
				                DepartmentName = s.DepartmentName, | 
			
		
		
	
		
			
				 | 
				 | 
				                CustomerOrgId = GetCustomerOrgId(customerOrgList, customerOrgId, s.ChildCompanyName, s.DepartmentName), | 
				 | 
				 | 
				                CustomerOrgId = GetCustomerOrgId(customerOrgList, customerOrgId, s.ChildCompanyName, s.DepartmentName), | 
			
		
		
	
		
			
				 | 
				 | 
				                CustomerOrgRegisterId = customerOrgRegisterId, | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                CustomerOrgRegisterId = customerOrgRegisterId | 
			
		
		
	
		
			
				 | 
				 | 
				            }).ToList(); | 
				 | 
				 | 
				            }).ToList(); | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            foreach (var item in entListDto) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                Guid customerOrgGroupId; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                if (!Guid.TryParse(item.CustomerOrgGroupId, out customerOrgGroupId)) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    customerOrgGroupId = Guid.Empty; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                if (customerOrgGroupId != Guid.Empty) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    item.CustomerOrgGroupName = _cacheService.GetCustomerOrgGroupAsync(customerOrgGroupId).GetAwaiter().GetResult().DisplayName; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                if (item.CustomerOrgId != null && item.CustomerOrgId != Guid.Empty) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                    item.CustomerOrgName = _cacheService.GetCustomerOrgAsync(item.CustomerOrgId.Value).GetAwaiter().GetResult().DisplayName; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				            return entListDto; | 
				 | 
				 | 
				            return entListDto; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				        } | 
				 | 
				 | 
				        } | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
					
				 | 
				
  |