From e3c645278060f212d232b065f0596dd4e5445751 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Fri, 24 May 2024 19:03:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8C=E4=B8=9A=E7=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...isterCheckPictureByPatientRegisterIdDto.cs | 20 ++++++++++ .../OccupationalDiseaseAppService.cs | 37 +++++++++++++++++-- 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 src/Shentun.Peis.Application.Contracts/OccupationalDiseases/RegisterCheckPictureByPatientRegisterIdDto.cs diff --git a/src/Shentun.Peis.Application.Contracts/OccupationalDiseases/RegisterCheckPictureByPatientRegisterIdDto.cs b/src/Shentun.Peis.Application.Contracts/OccupationalDiseases/RegisterCheckPictureByPatientRegisterIdDto.cs new file mode 100644 index 0000000..6c187fd --- /dev/null +++ b/src/Shentun.Peis.Application.Contracts/OccupationalDiseases/RegisterCheckPictureByPatientRegisterIdDto.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Volo.Abp.Application.Dtos; + +namespace Shentun.Peis.OccupationalDiseases +{ + public class RegisterCheckPictureByPatientRegisterIdDto + { + /// + /// 项目名字 + /// + public string RegisterCheckAsbitemName { get; set; } + + /// + /// 图片地址 + /// + public List CheckPictureUrls { get; set; } + } +} diff --git a/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs b/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs index 9ed3c74..1cc3abb 100644 --- a/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs +++ b/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs @@ -37,8 +37,6 @@ namespace Shentun.Peis.OccupationalDiseases private readonly CacheService _cacheService; - - private readonly IRepository _patientRepository; private readonly IRepository _registerCheckRepository; private readonly IRepository _identityUserRepository; @@ -50,7 +48,7 @@ namespace Shentun.Peis.OccupationalDiseases private readonly IRepository _resultStatusRepository; private readonly IRepository _registerCheckSummaryRepository; private readonly IRepository _asbitemRepository; - + private readonly IRepository _registerCheckPictureRepository; @@ -74,7 +72,8 @@ namespace Shentun.Peis.OccupationalDiseases IRepository registerCheckSummaryRepository, IRepository asbitemRepository, IRepository patientOccupationalMedicalHistoryRepository, - IRepository patientPastMedicalHistoryRepository) + IRepository patientPastMedicalHistoryRepository, + IRepository registerCheckPictureRepository) { _patientOccupationalDiseaseRepository = patientOccupationalDiseaseRepository; _patientOccupationalHistoryRepository = patientOccupationalHistoryRepository; @@ -95,6 +94,7 @@ namespace Shentun.Peis.OccupationalDiseases _asbitemRepository = asbitemRepository; _patientOccupationalMedicalHistoryRepository = patientOccupationalMedicalHistoryRepository; _patientPastMedicalHistoryRepository = patientPastMedicalHistoryRepository; + _registerCheckPictureRepository = registerCheckPictureRepository; } /// @@ -657,7 +657,36 @@ namespace Shentun.Peis.OccupationalDiseases } + /// + /// 获取检查项目图片 + /// + /// + /// + [HttpPost("api/app/OccupationalDisease/GetRegisterCheckPictureByPatientRegisterId")] + public async Task> GetRegisterCheckPictureByPatientRegisterIdAsync(PatientRegisterIdInputDto input) + { + var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync() + join registerCheck in (await _registerCheckRepository.GetQueryableAsync()).Include(x => x.RegisterCheckAsbitems).ThenInclude(x => x.Asbitem).AsQueryable() + on patientRegister.Id equals registerCheck.PatientRegisterId + join registerCheckPicture in await _registerCheckPictureRepository.GetQueryableAsync() + on registerCheck.Id equals registerCheckPicture.RegisterCheckId + where patientRegister.Id == input.PatientRegisterId + select new + { + RegisterCheckId = registerCheck.Id, + RegisterCheckAsbitemName = string.Join(',', registerCheck.RegisterCheckAsbitems.Select(s => s.Asbitem.DisplayName)), + registerCheckPicture + }).ToList(); + + var entList = query.GroupBy(g => g.RegisterCheckId).Select(s => new RegisterCheckPictureByPatientRegisterIdDto + { + RegisterCheckAsbitemName = s.FirstOrDefault().RegisterCheckAsbitemName, + CheckPictureUrls = s.Where(m => !string.IsNullOrWhiteSpace(m.registerCheckPicture.PictureFilename)) + .Select(ss => ss.registerCheckPicture.PictureFilename).ToList() + }).ToList(); + return entList; + } } }