|
|
|
@ -46,7 +46,7 @@ namespace Shentun.WebPeis.Persons |
|
|
|
[Authorize] |
|
|
|
public class PersonAppService : ApplicationService |
|
|
|
{ |
|
|
|
|
|
|
|
private readonly IRepository<QuestionRegister> _questionRegisterRepository; |
|
|
|
private readonly IConfiguration _configuration; |
|
|
|
private readonly IRepository<IdentityUser, Guid> _identityUserRepository; |
|
|
|
private readonly IdentityUserManager _userManager; |
|
|
|
@ -72,7 +72,8 @@ namespace Shentun.WebPeis.Persons |
|
|
|
IRepository<Patient> patientRepository, |
|
|
|
CacheService cacheService, |
|
|
|
IHttpContextAccessor httpContextAccessor, |
|
|
|
IRepository<CustomerOrg> customerOrgRepository) |
|
|
|
IRepository<CustomerOrg> customerOrgRepository, |
|
|
|
IRepository<QuestionRegister> questionRegisterRepository) |
|
|
|
{ |
|
|
|
_repository = repository; |
|
|
|
_configuration = configuration; |
|
|
|
@ -87,6 +88,7 @@ namespace Shentun.WebPeis.Persons |
|
|
|
_cacheService = cacheService; |
|
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
|
_customerOrgRepository = customerOrgRepository; |
|
|
|
_questionRegisterRepository = questionRegisterRepository; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<PersonDto> GetByIdAsync(PersonIdInputDto input) |
|
|
|
@ -356,6 +358,9 @@ namespace Shentun.WebPeis.Persons |
|
|
|
var personList = (from user in await _identityUserRepository.GetQueryableAsync() |
|
|
|
join person in await _repository.GetQueryableAsync() |
|
|
|
on user.Id equals person.PersonId |
|
|
|
join questionRegister in await _questionRegisterRepository.GetQueryableAsync() |
|
|
|
on person.PersonId equals questionRegister.PersonId into emptyQuestionRegister |
|
|
|
from haveQuestionRegister in emptyQuestionRegister.DefaultIfEmpty() |
|
|
|
where personKinshipIds.Contains(user.Id) |
|
|
|
orderby user.CreationTime |
|
|
|
select new PersonDto |
|
|
|
@ -367,10 +372,11 @@ namespace Shentun.WebPeis.Persons |
|
|
|
MaritalStatusId = person.MaritalStatusId, |
|
|
|
MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(person.MaritalStatusId).Result, |
|
|
|
IdNo = person.IdNo, |
|
|
|
MobileTelephone = user.PhoneNumber |
|
|
|
MobileTelephone = user.PhoneNumber, |
|
|
|
IsHaveQuestionRegister = haveQuestionRegister==null? 'N':'Y' |
|
|
|
|
|
|
|
|
|
|
|
}).ToList(); |
|
|
|
}).Distinct().ToList(); |
|
|
|
for (var i = 0; i < personList.Count; i++) |
|
|
|
{ |
|
|
|
personList[i].DisplayOrder = i + 1; |
|
|
|
|