Browse Source

预约

master
DESKTOP-G961P6V\Zhh 1 year ago
parent
commit
84db35ef94
  1. 9
      src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs
  2. 9
      src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs

9
src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs

@ -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;
} }

9
src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs

@ -66,6 +66,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
public async Task<AppointPatientRegister> CreateAsync(AppointPatientRegister entity) public async Task<AppointPatientRegister> CreateAsync(AppointPatientRegister entity)
{ {
await Verify(entity); await Verify(entity);
entity.AppointPatientRegisterId = GuidGenerator.Create(); entity.AppointPatientRegisterId = GuidGenerator.Create();
entity.CompleteFlag = AppointPatientRegisterCompleteFlag.Appoint; entity.CompleteFlag = AppointPatientRegisterCompleteFlag.Appoint;
entity.IsCharge = 'N'; entity.IsCharge = 'N';
@ -235,6 +236,14 @@ namespace Shentun.WebPeis.AppointPatientRegisters
appointRegisterAsbitem.IsCharge = 'N'; appointRegisterAsbitem.IsCharge = 'N';
} }
var appoentPatientRegisters = await _repository.GetListAsync(o => o.PersonId == entity.PersonId &&
o.AppointDate >= DateTime.Now.Date);
if(appoentPatientRegisters.Count > 1)
{
throw new UserFriendlyException("已有今天及之后的预约订单,必须先取消订单才能重新预约");
}
} }
} }
} }
Loading…
Cancel
Save