Browse Source

健康评估

bjmzak
wxd 2 years ago
parent
commit
93202108a7
  1. 2
      src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PublicPatientRegisterNoInputDto.cs
  2. 25
      src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs

2
src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PublicPatientRegisterNoInputDto.cs

@ -7,7 +7,7 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
public class PublicPatientRegisterNoInputDto public class PublicPatientRegisterNoInputDto
{ {
/// <summary> /// <summary>
/// 体检人员条码
/// 体检
/// </summary> /// </summary>
public List<string> PatientRegisterNos { get; set; } public List<string> PatientRegisterNos { get; set; }
} }

25
src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs

@ -74,24 +74,27 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
/// <returns></returns> /// <returns></returns>
[Authorize(PeisPermissions.Third.Default)] [Authorize(PeisPermissions.Third.Default)]
[HttpPost("api/Third/ThirdPartyPublicInterface/GetBasicInformationOfMedicalExaminationPersonnel")] [HttpPost("api/Third/ThirdPartyPublicInterface/GetBasicInformationOfMedicalExaminationPersonnel")]
public async Task<BasicInformationOfMedicalExaminationPersonnelDto> GetBasicInformationOfMedicalExaminationPersonnelAsync(PublicPatientRegisterNoInputDto input)
public async Task<List<BasicInformationOfMedicalExaminationPersonnelDto>> GetBasicInformationOfMedicalExaminationPersonnelAsync(PublicPatientRegisterNoInputDto input)
{ {
if (input == null) if (input == null)
{ {
throw new UserFriendlyException($"请求参数错误"); throw new UserFriendlyException($"请求参数错误");
} }
if(!input.PatientRegisterNos.Any())
if (!input.PatientRegisterNos.Any())
throw new UserFriendlyException($"体检编号不能为空"); throw new UserFriendlyException($"体检编号不能为空");
var result = new BasicInformationOfMedicalExaminationPersonnelDto();
var listDto = new List<BasicInformationOfMedicalExaminationPersonnelDto>();
var patientRegisterEnt = (await _patientRegisterRepository.GetQueryableAsync()).Include(x => x.Patient)
.FirstOrDefault(m => input.PatientRegisterNos.Contains(m.PatientRegisterNo)
&& m.CompleteFlag == PatientRegisterCompleteFlag.SumCheck);
if (patientRegisterEnt != null)
var patientRegisterList = (await _patientRegisterRepository.GetQueryableAsync()).Include(x => x.Patient)
.Where(m => input.PatientRegisterNos.Contains(m.PatientRegisterNo)
&& m.CompleteFlag == PatientRegisterCompleteFlag.SumCheck).ToList();
if (patientRegisterList.Any())
{ {
foreach (var patientRegisterEnt in patientRegisterList)
{
//基础信息 //基础信息
result = new BasicInformationOfMedicalExaminationPersonnelDto
var result = new BasicInformationOfMedicalExaminationPersonnelDto
{ {
BirthDate = patientRegisterEnt.BirthDate != null ? patientRegisterEnt.BirthDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", BirthDate = patientRegisterEnt.BirthDate != null ? patientRegisterEnt.BirthDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
PatientRegisterNo = patientRegisterEnt.PatientRegisterNo, PatientRegisterNo = patientRegisterEnt.PatientRegisterNo,
@ -187,13 +190,15 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
}).ToList() }).ToList()
}).ToList(); }).ToList();
listDto.Add(result);
}
} }
else else
{ {
throw new UserFriendlyException($"条码号不正确");
throw new UserFriendlyException($"体检编号不正确");
} }
return result;
return listDto;
} }

Loading…
Cancel
Save