From fcffcfa308d1b4eb2a040a6c3683f7eebfb9c96a Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Mon, 3 Mar 2025 15:08:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Persons/MedicalHealthReportDto.cs | 8 ++++++ .../Persons/PersonAppService.cs | 26 ++++++++++++++++++- .../appsettings.json | 3 ++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/Shentun.WebPeis.Application.Contracts/Persons/MedicalHealthReportDto.cs b/src/Shentun.WebPeis.Application.Contracts/Persons/MedicalHealthReportDto.cs index ec39a9a..618e34d 100644 --- a/src/Shentun.WebPeis.Application.Contracts/Persons/MedicalHealthReportDto.cs +++ b/src/Shentun.WebPeis.Application.Contracts/Persons/MedicalHealthReportDto.cs @@ -50,4 +50,12 @@ namespace Shentun.WebPeis.Persons } + + + public class IsQuestionDto + { + public int code { get; set; } + public string msg { get; set; } + public bool data { get; set; } + } } diff --git a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs index 6d83f7b..610b003 100644 --- a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs +++ b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs @@ -40,6 +40,7 @@ using Shentun.Utilities; using IdentityModel; using Shentun.WebPeis.SysParmValues; using Scriban.Syntax; +using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.DepositMarketingMemberCardOpenCardCodesResponse.Types; namespace Shentun.WebPeis.Persons { /// @@ -67,6 +68,7 @@ namespace Shentun.WebPeis.Persons private readonly IRepository _registerCheckRepository; private readonly IRepository _registerCheckAsbitemRepository; private readonly IRepository _asbitemRepository; + private readonly IRepository _customerOrgRegisterRepository; public PersonAppService(IRepository repository, IConfiguration configuration, IRepository identityUserRepository, @@ -84,7 +86,8 @@ namespace Shentun.WebPeis.Persons SysParmValueManager sysParmValueManager, IRepository registerCheckRepository, IRepository registerCheckAsbitemRepository, - IRepository asbitemRepository) + IRepository asbitemRepository, + IRepository customerOrgRegisterRepository) { _repository = repository; _configuration = configuration; @@ -104,6 +107,7 @@ namespace Shentun.WebPeis.Persons _registerCheckRepository = registerCheckRepository; _registerCheckAsbitemRepository = registerCheckAsbitemRepository; _asbitemRepository = asbitemRepository; + _customerOrgRegisterRepository = customerOrgRegisterRepository; } public async Task GetByIdAsync(PersonIdInputDto input) @@ -578,6 +582,26 @@ namespace Shentun.WebPeis.Persons { throw new UserFriendlyException("没有报告单"); } + + #region 检查是否需要填写问卷 + var isQuestion = _customerOrgRegisterRepository.FirstOrDefaultAsync(f => f.CustomerOrgRegisterId == entity.CustomerOrgRegisterId && f.IsQuestion == 'Y'); + if (isQuestion != null) + { + string baseAddress = _configuration.GetSection("MedicalHealthReport").GetSection("BaseAddress").Value; + string isQuestionApiUrl = _configuration.GetSection("MedicalHealthReport").GetSection("IsQuestionApiUrl").Value; + + isQuestionApiUrl = isQuestionApiUrl + $"?recordNo={entity.PatientRegisterNo}"; //查询是否填写问卷 + + var isQuestionResult = await CallAppServiceAsync(baseAddress, isQuestionApiUrl, null, "get"); + if (isQuestionResult.code != 200 + || isQuestionResult.data != true + ) + { + throw new UserFriendlyException("请先填写问卷再来查看"); + } + } + #endregion + var Host = $"{_httpContextAccessor.HttpContext.Request.Scheme}://{_httpContextAccessor.HttpContext.Request.Host.Host}:{_httpContextAccessor.HttpContext.Request.Host.Port}"; var returnValue = new MedicalReportDto() { diff --git a/src/Shentun.WebPeis.HttpApi.Host/appsettings.json b/src/Shentun.WebPeis.HttpApi.Host/appsettings.json index 89b04af..53f19a8 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/appsettings.json +++ b/src/Shentun.WebPeis.HttpApi.Host/appsettings.json @@ -67,7 +67,8 @@ "MedicalHealthReport": { "BaseAddress": "http://10.1.13.31", "ReportListApiUrl": "http://10.1.13.31/api/report/page", - "ReportApiUrl": "http://10.1.13.31/api/report/download" + "ReportApiUrl": "http://10.1.13.31/api/report/download", + "IsQuestionApiUrl": "http://10.1.13.31/api/hasFillQueByRecordNo" }, "Swagger": { "IsEnabled": true