|
|
@ -449,6 +449,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
[HttpPost("api/app/AppointPatientRegister/GetCustomerOrgAppointPatientRegisterByPersonId")] |
|
|
[HttpPost("api/app/AppointPatientRegister/GetCustomerOrgAppointPatientRegisterByPersonId")] |
|
|
public async Task<PatientRegisterDto> GetCustomerOrgAppointPatientRegisterByPersonIdAsync(PersonIdInputDto input) |
|
|
public async Task<PatientRegisterDto> GetCustomerOrgAppointPatientRegisterByPersonIdAsync(PersonIdInputDto input) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
var patientRegisterDto = (from user in await _identityUserRepository.GetQueryableAsync() |
|
|
var patientRegisterDto = (from user in await _identityUserRepository.GetQueryableAsync() |
|
|
join person in await _personRepository.GetQueryableAsync() |
|
|
join person in await _personRepository.GetQueryableAsync() |
|
|
on user.Id equals person.PersonId |
|
|
on user.Id equals person.PersonId |
|
|
@ -483,6 +484,14 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
var customerOrgEntity = await _customerOrgRepository.GetAsync(o => o.CustomerOrgId == patientRegisterDto.CustomerOrgId); |
|
|
var customerOrgEntity = await _customerOrgRepository.GetAsync(o => o.CustomerOrgId == patientRegisterDto.CustomerOrgId); |
|
|
customerOrgEntity = await _customerOrgRepository.GetAsync(o => o.PathCode == customerOrgEntity.PathCode.Substring(0, 5)); |
|
|
customerOrgEntity = await _customerOrgRepository.GetAsync(o => o.PathCode == customerOrgEntity.PathCode.Substring(0, 5)); |
|
|
patientRegisterDto.CustomerOrgName = customerOrgEntity.CustomerOrgName; |
|
|
patientRegisterDto.CustomerOrgName = customerOrgEntity.CustomerOrgName; |
|
|
|
|
|
|
|
|
|
|
|
var appointPatientRegisters = await _repository.GetListAsync(o => o.PersonId == input.PersonId && |
|
|
|
|
|
o.AppointDate >= DateTime.Now.Date && o.CustomerOrgRegisterId == patientRegisterDto.CustomerOrgRegisterId); |
|
|
|
|
|
if (appointPatientRegisters .Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException("已有今天及之后的团检预约订单,必须先取消订单才能重新预约"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return patientRegisterDto; |
|
|
return patientRegisterDto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|