From 1a6764c4857e83e4d88d55ba2abe85edd3a039a1 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Wed, 14 Aug 2024 15:17:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8A=A5=E5=91=8A=E6=AC=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ThirdPartyPublicInterfaceAppService.cs | 27 +++++++++++++++++++ .../TransToWebPeisAppService.cs | 9 +++---- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs b/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs index fcbbb3e..a3fa7de 100644 --- a/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs +++ b/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs @@ -6,6 +6,7 @@ using NPOI.SS.Formula.Functions; using Shentun.Peis.Enums; using Shentun.Peis.Models; using Shentun.Peis.PatientRegisters; +using Shentun.Peis.Patients; using Shentun.Peis.Permissions; using SqlSugar; using System; @@ -82,6 +83,29 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces _columnReferenceInterfaceRepository = columnReferenceInterfaceRepository; } + /// + /// 根据身份证获取体检记录 + /// + /// + /// + [Authorize(PeisPermissions.Third.Default)] + [HttpPost("api/Third/ThirdPartyPublicInterface/GetPatientRegisterListByIdNo")] + public async Task> GetPatientRegisterListByIdNoAsync(IdNoInputDto input) + { + var entListDto = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync() + join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id + where patient.IdNo == input.IdNo + orderby patientRegister.MedicalStartDate descending + select new GetPatientRegisterListByIdNoDto + { + MedicalStartDate = DataHelper.ConversionDateShortToString(patientRegister.MedicalStartDate), + PatientName = patientRegister.PatientName, + PatientRegisterNo = patientRegister.PatientRegisterNo + }).ToList(); + + return entListDto; + } + /// /// 查询体检人员基本信息 @@ -276,6 +300,9 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces } + + + ///// ///// 查询体检明细项目信息 ///// diff --git a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs index 6018829..cedd2a5 100644 --- a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs +++ b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs @@ -918,7 +918,7 @@ namespace Shentun.Peis.TransToWebPeis - short newMedicalTimes = patientRegisterEnt.MedicalTimes; + var IsPatient = (await WebDb.Ado.GetDataTableAsync($"select patient_id from patient where patient_id='{patientRegisterEnt.PatientId}'")).Rows.Count; @@ -957,10 +957,9 @@ namespace Shentun.Peis.TransToWebPeis #endregion } - else - { - newMedicalTimes = (short)((short)(await WebDb.Ado.GetScalarAsync($"select max(medical_times) from patient_register where patient_id='{patientRegisterEnt.PatientId}'")) + 1); - } + + short newMedicalTimes = (short)((short)(await WebDb.Ado.GetScalarAsync($"select max(medical_times) from patient_register where patient_id='{patientRegisterEnt.PatientId}'")) + 1); +