From 28dec2ebfa67b1814210d7b559721261494f4f74 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Wed, 28 Jan 2026 09:56:09 +0800
Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E8=AE=B0=E9=A1=B9=E7=9B=AE=E4=BD=93?=
=?UTF-8?q?=E6=A3=80=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...egisterCheckAsbitemWithMedicalCenterDto.cs | 42 ++++++++
...erCheckAsbitemWithMedicalCenterInputDto.cs | 21 ++++
...gisterCheckAsbitemMedicalCenterInputDto.cs | 19 ++++
.../RegisterCheckAsbitemAppService.cs | 96 ++++++++++++++++++-
4 files changed, 177 insertions(+), 1 deletion(-)
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/HandRegisterCheckAsbitemMedicalCenterInputDto.cs
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterDto.cs
new file mode 100644
index 00000000..2ff7cddb
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterDto.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterCheckAsbitems
+{
+ public class GetRegisterCheckAsbitemWithMedicalCenterDto
+ {
+ public Guid RegisterCheckAsbitemId { get; set; }
+
+ ///
+ /// 体检中心名称
+ ///
+ public string MedicalCenterName { get; set; }
+
+ ///
+ /// 组合项目名称
+ ///
+ public string AsbitemName { get; set; }
+
+ ///
+ /// 人员状态
+ ///
+ public char PatientRegisterCompleteFlag { get; set; }
+
+
+ ///
+ /// 项目状态
+ ///
+ public char RegisterCheckCompleteFlag { get; set; }
+
+ ///
+ /// 人员姓名
+ ///
+ public string PatientName { get; set; }
+
+ ///
+ /// 身份证
+ ///
+ public string IdNo { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterInputDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterInputDto.cs
new file mode 100644
index 00000000..d128c058
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/GetRegisterCheckAsbitemWithMedicalCenterInputDto.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterCheckAsbitems
+{
+ public class GetRegisterCheckAsbitemWithMedicalCenterInputDto
+ {
+
+ ///
+ /// 人员Id
+ ///
+ public Guid? PatientRegisterId { get; set; }
+
+ ///
+ /// 人员条码
+ ///
+ public string PatientRegisterNo { get; set; }
+
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/HandRegisterCheckAsbitemMedicalCenterInputDto.cs b/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/HandRegisterCheckAsbitemMedicalCenterInputDto.cs
new file mode 100644
index 00000000..02079d62
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/RegisterCheckAsbitems/HandRegisterCheckAsbitemMedicalCenterInputDto.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.RegisterCheckAsbitems
+{
+ public class HandRegisterCheckAsbitemMedicalCenterInputDto
+ {
+ ///
+ /// 登记项目id
+ ///
+ public Guid RegisterCheckAsbitemId { get; set; }
+
+ ///
+ /// 体检中心id
+ ///
+ public Guid MedicalCenterId { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application/RegisterCheckAsbitems/RegisterCheckAsbitemAppService.cs b/src/Shentun.Peis.Application/RegisterCheckAsbitems/RegisterCheckAsbitemAppService.cs
index 916f0ead..7402d735 100644
--- a/src/Shentun.Peis.Application/RegisterCheckAsbitems/RegisterCheckAsbitemAppService.cs
+++ b/src/Shentun.Peis.Application/RegisterCheckAsbitems/RegisterCheckAsbitemAppService.cs
@@ -1,6 +1,9 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.EntityFrameworkCore;
+using Microsoft.IdentityModel.Abstractions;
+using NUglify.Helpers;
using Shentun.Peis.CardBills;
using Shentun.Peis.CustomerOrgs;
using Shentun.Peis.DeviceTypes;
@@ -8,6 +11,7 @@ using Shentun.Peis.Enums;
using Shentun.Peis.ForSexs;
using Shentun.Peis.Models;
using Shentun.Peis.PatientRegisters;
+using Shentun.Peis.RegisterCheckAsbitems;
using Shentun.Peis.RegisterCheckCriticalValues;
using Shentun.Peis.RegisterCheckItems;
using Shentun.Peis.RegisterCheckPictures;
@@ -24,6 +28,7 @@ using Volo.Abp;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
+using static Volo.Abp.Identity.Settings.IdentitySettingNames;
namespace Shentun.Peis.RegisterAsbitems
{
@@ -61,6 +66,8 @@ namespace Shentun.Peis.RegisterAsbitems
private readonly RegisterCheckAsbitemManager _registerAsbitemManager;
private readonly CardBillManager _cardBillManager;
private readonly CacheService _cacheService;
+ private readonly IRepository _organizationUnitRepository;
+ private readonly IRepository _patientRepository;
public RegisterCheckAsbitemAppService(
IRepository userRepository,
IRepository registerAsbitemRepository,
@@ -87,7 +94,9 @@ namespace Shentun.Peis.RegisterAsbitems
RegisterCheckAsbitemManager registerAsbitemManager,
CardBillManager cardBillManager,
CacheService cacheService,
- IRepository chargeRequestRepository)
+ IRepository chargeRequestRepository,
+ IRepository organizationUnitRepository,
+ IRepository patientRepository)
{
this._userRepository = userRepository;
this._registerCheckAsbitemRepository = registerAsbitemRepository;
@@ -115,6 +124,8 @@ namespace Shentun.Peis.RegisterAsbitems
_customerOrgGroupDetailRepository = customerOrgGroupDetailRepository;
_medicalPackageDetailRepository = medicalPackageDetailRepository;
_chargeRequestRepository = chargeRequestRepository;
+ _organizationUnitRepository = organizationUnitRepository;
+ _patientRepository = patientRepository;
}
@@ -839,7 +850,90 @@ namespace Shentun.Peis.RegisterAsbitems
#endregion
+ #region 处理项目的体检中心
+ ///
+ /// 根据人员获取当前登记项目信息 包含体检中心信息
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheckAsbitem/GetRegisterCheckAsbitemWithMedicalCenter")]
+ public async Task> GetRegisterCheckAsbitemWithMedicalCenterAsync(GetRegisterCheckAsbitemWithMedicalCenterInputDto input)
+ {
+ if (input.PatientRegisterId == null && string.IsNullOrWhiteSpace(input.PatientRegisterNo))
+ {
+ throw new UserFriendlyException("参数不能为空");
+ }
+
+ var query = from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
+ join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
+ 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
+ join medicalCenter in await _organizationUnitRepository.GetQueryableAsync() on registerCheckAsbitem.MedicalCenterId equals medicalCenter.Id into medicalCenterTemp
+ from medicalCenterHaveEmpty in medicalCenterTemp.DefaultIfEmpty()
+ select new
+ {
+ patientRegister,
+ patient,
+ registerCheck,
+ registerCheckAsbitem,
+ asbitem,
+ medicalCenterHaveEmpty
+ };
+
+ if (!string.IsNullOrWhiteSpace(input.PatientRegisterNo))
+ {
+ query = query.Where(m => m.patientRegister.PatientRegisterNo == input.PatientRegisterNo);
+ }
+ else if (input.PatientRegisterId != null)
+ {
+ query = query.Where(m => m.patientRegister.Id == input.PatientRegisterId.Value);
+ }
+
+
+ var entListDto = query.ToList().Select(s => new GetRegisterCheckAsbitemWithMedicalCenterDto
+ {
+ RegisterCheckAsbitemId = s.registerCheckAsbitem.Id,
+ AsbitemName = s.asbitem.DisplayName,
+ IdNo = s.patient.IdNo,
+ MedicalCenterName = s.medicalCenterHaveEmpty != null ? s.medicalCenterHaveEmpty.DisplayName : "",
+ PatientName = s.patientRegister.PatientName,
+ PatientRegisterCompleteFlag = s.patientRegister.CompleteFlag,
+ RegisterCheckCompleteFlag = s.registerCheck.CompleteFlag
+ }).ToList();
+
+
+ return entListDto;
+ }
+
+
+ ///
+ /// 处理项目归属的体检中心id
+ ///
+ ///
+ ///
+ [HttpPost("api/app/RegisterCheckAsbitem/HandRegisterCheckAsbitemMedicalCenter")]
+ public async Task HandRegisterCheckAsbitemMedicalCenterAsync(List input)
+ {
+ if (!input.Any())
+ {
+ throw new UserFriendlyException("参数不能为空");
+ }
+
+ var registerCheckAsbitemIds = input.Select(s => s.RegisterCheckAsbitemId).ToList();
+
+ var registerCheckAsbitemList = await _registerCheckAsbitemRepository.GetListAsync(m => registerCheckAsbitemIds.Contains(m.Id));
+
+ foreach (var item in registerCheckAsbitemList)
+ {
+ var inputMedicalCenterId = input.FirstOrDefault(f => f.RegisterCheckAsbitemId == item.Id).MedicalCenterId;
+ item.MedicalCenterId = inputMedicalCenterId;
+ }
+
+ await _registerCheckAsbitemRepository.UpdateManyAsync(registerCheckAsbitemList);
+ }
+
+ #endregion