From f78a532ff0525591899aa80c6a8484698a3e877d Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Thu, 25 Jul 2024 17:33:32 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=8A=A0=E6=89=B9=E9=87=8F=E5=AF=BC?=
=?UTF-8?q?=E5=85=A5=E5=9B=BE=E7=89=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PatientRegisterNosInputDto.cs | 14 +++
...isterCheckPictureByLisRequestNoInputDto.cs | 29 +++++
...CheckPictureByPatientRegisterNoInputDto.cs | 29 +++++
.../RegisterCheckPictureAppService.cs | 100 ++++++++++++++++--
.../RegisterChecks/RegisterCheckAppService.cs | 25 +++++
5 files changed, 191 insertions(+), 6 deletions(-)
create mode 100644 src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNosInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByLisRequestNoInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByPatientRegisterNoInputDto.cs
diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNosInputDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNosInputDto.cs
new file mode 100644
index 00000000..7a722cb6
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNosInputDto.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.PatientRegisters
+{
+ public class PatientRegisterNosInputDto
+ {
+ ///
+ /// 人员条码号集合
+ ///
+ public List PatientRegisterNos { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByLisRequestNoInputDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByLisRequestNoInputDto.cs
new file mode 100644
index 00000000..e1c60493
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByLisRequestNoInputDto.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterCheckPictures
+{
+ public class ImportRegisterCheckPictureByLisRequestNoInputDto
+ {
+ ///
+ /// 检查申请单号 不以人员条码号模式
+ ///
+ public string LisRequestNo { get; set; }
+
+ ///
+ /// 组合项目ID
+ ///
+ public Guid AsbitemId { get; set; }
+
+ ///
+ /// 图片原始名称
+ ///
+ public string PictureName { get; set; }
+
+ ///
+ /// 图片base64字符串
+ ///
+ public string PictureBase64 { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByPatientRegisterNoInputDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByPatientRegisterNoInputDto.cs
new file mode 100644
index 00000000..b646bbfc
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/ImportRegisterCheckPictureByPatientRegisterNoInputDto.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterCheckPictures
+{
+ public class ImportRegisterCheckPictureByPatientRegisterNoInputDto
+ {
+ ///
+ /// 人员条码号
+ ///
+ public string PatientRegisterNo { get; set; }
+
+ ///
+ /// 组合项目ID
+ ///
+ public Guid AsbitemId { get; set; }
+
+ ///
+ /// 图片原始名称
+ ///
+ public string PictureName { get; set; }
+
+ ///
+ /// 图片base64字符串
+ ///
+ public string PictureBase64 { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs b/src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs
index 4a9ef8eb..bfa30356 100644
--- a/src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs
+++ b/src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Configuration;
using Shentun.Peis.Enums;
using Shentun.Peis.GuideTypes;
using Shentun.Peis.Models;
+using Shentun.Peis.PatientRegisters;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -26,9 +27,10 @@ namespace Shentun.Peis.RegisterCheckPictures
{
private readonly IRepository _userRepository;
private readonly IRepository _registerCheckPictureRepository;
- private readonly IRepository _registerAsbitemRepository;
+ private readonly IRepository _registerCheckAsbitemRepository;
private readonly IRepository _registerCheckRepository;
private readonly IRepository _patientRegisterRepository;
+ private readonly IRepository _lisRequestRepository;
private readonly RegisterCheckPictureManager _registerCheckPictureManager;
private readonly IConfiguration _configuration;
@@ -36,18 +38,20 @@ namespace Shentun.Peis.RegisterCheckPictures
IRepository registerCheckPictureRepository,
RegisterCheckPictureManager registerCheckPictureManager,
IRepository userRepository,
- IRepository registerAsbitemRepository,
+ IRepository registerCheckAsbitemRepository,
IConfiguration configuration,
IRepository registerCheckRepository,
- IRepository patientRegisterRepository)
+ IRepository patientRegisterRepository,
+ IRepository lisRequestRepository)
{
_registerCheckPictureRepository = registerCheckPictureRepository;
_registerCheckPictureManager = registerCheckPictureManager;
_userRepository = userRepository;
- _registerAsbitemRepository = registerAsbitemRepository;
+ _registerCheckAsbitemRepository = registerCheckAsbitemRepository;
_configuration = configuration;
_registerCheckRepository = registerCheckRepository;
_patientRegisterRepository = patientRegisterRepository;
+ _lisRequestRepository = lisRequestRepository;
}
///
@@ -248,7 +252,7 @@ namespace Shentun.Peis.RegisterCheckPictures
string PatientRegisterId = "";
- var registerAsbitemEntity = await _registerAsbitemRepository.FirstOrDefaultAsync(m => m.RegisterCheckId == RegisterCheckId);
+ var registerAsbitemEntity = await _registerCheckAsbitemRepository.FirstOrDefaultAsync(m => m.RegisterCheckId == RegisterCheckId);
if (registerAsbitemEntity != null)
{
PatientRegisterId = registerAsbitemEntity.PatientRegisterId.ToString();
@@ -341,7 +345,7 @@ namespace Shentun.Peis.RegisterCheckPictures
///
- /// 导入检查图片
+ /// 导入检查图片 根据检查单号
///
///
[HttpPost("api/app/RegisterCheckPicture/ImportRegisterCheckPicture")]
@@ -370,5 +374,89 @@ namespace Shentun.Peis.RegisterCheckPictures
}
+
+
+ ///
+ /// 导入检查图片 根据人员条码号+项目ID
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheckPicture/ImportRegisterCheckPictureByPatientRegisterNo")]
+ public async Task ImportRegisterCheckPictureByPatientRegisterNoAsync(ImportRegisterCheckPictureByPatientRegisterNoInputDto input)
+ {
+ var registerCheckList = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
+ join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
+ join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
+ where patientRegister.PatientRegisterNo == input.PatientRegisterNo && registerCheckAsbitem.AsbitemId == input.AsbitemId
+ select registerCheck).ToList();
+
+ if (!registerCheckList.Any())
+ throw new UserFriendlyException("人员信息或项目信息不正确");
+
+ if (string.IsNullOrWhiteSpace(input.PictureBase64))
+ throw new UserFriendlyException("图片不能为空");
+
+ var pic = new List();
+ pic.Add(new UploadRegisterCheckPictureManyPictureBaseStrsDto
+ {
+ FileName = input.PictureName,
+ PictureBaseStr = input.PictureBase64
+ });
+
+
+ foreach (var registerCheck in registerCheckList)
+ {
+ await UploadRegisterCheckPictureManyAsync(new UploadRegisterCheckPictureManyDto
+ {
+ PictureBaseStrs = pic,
+ PictureFileType = '0',
+ RegisterCheckId = registerCheck.Id
+ });
+ }
+
+
+
+ }
+
+
+ ///
+ /// 导入检查图片 根据检验申请号
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheckPicture/ImportRegisterCheckPictureByLisRequestNo")]
+ public async Task ImportRegisterCheckPictureByLisRequestNoAsync(ImportRegisterCheckPictureByLisRequestNoInputDto input)
+ {
+ var registerCheckList = (from registerCheck in await _registerCheckRepository.GetQueryableAsync()
+ join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
+ join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitem.LisRequestId equals lisRequest.Id
+ where lisRequest.LisRequestNo == input.LisRequestNo && registerCheckAsbitem.AsbitemId == input.AsbitemId
+ select registerCheck).ToList();
+
+ if (!registerCheckList.Any())
+ throw new UserFriendlyException("人员信息或项目信息不正确");
+
+ if (string.IsNullOrWhiteSpace(input.PictureBase64))
+ throw new UserFriendlyException("图片不能为空");
+
+ var pic = new List();
+ pic.Add(new UploadRegisterCheckPictureManyPictureBaseStrsDto
+ {
+ FileName = input.PictureName,
+ PictureBaseStr = input.PictureBase64
+ });
+
+
+ foreach (var registerCheck in registerCheckList)
+ {
+ await UploadRegisterCheckPictureManyAsync(new UploadRegisterCheckPictureManyDto
+ {
+ PictureBaseStrs = pic,
+ PictureFileType = '0',
+ RegisterCheckId = registerCheck.Id
+ });
+ }
+
+
+
+ }
}
}
diff --git a/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs b/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
index d360db5a..310caf53 100644
--- a/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
+++ b/src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
@@ -529,6 +529,31 @@ namespace Shentun.Peis.RegisterChecks
}
+ ///
+ /// 根据人员条码号集合获取所有项目
+ ///
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheck/GetRegisterCheckAsbitemsByPatientRegisterNos")]
+ public async Task> GetRegisterCheckAsbitemsByPatientRegisterNosAsync(PatientRegisterNosInputDto input)
+ {
+ if (!input.PatientRegisterNos.Any())
+ throw new UserFriendlyException("人员条码号不能为空");
+ var entListDto = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
+ join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
+ join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
+ join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
+ where input.PatientRegisterNos.Contains(patientRegister.PatientRegisterNo) && asbitem.IsCheck == 'Y'
+ select new SimpleAsbitemDto
+ {
+ AsbitemId = registerCheckAsbitem.AsbitemId,
+ AsbitemName = asbitem.DisplayName
+ }).Distinct().ToList();
+
+ return entListDto;
+ }
+
+
///
/// 批量修改医生 根据人员ID集合
///