From ca3866a613b40935fef55f36cb24b76f241ca4f9 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Tue, 18 Jun 2024 13:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E8=AF=84=E4=BC=B0=E6=8A=A5?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Persons/PersonAppService.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs index 802f5c5..78c43a3 100644 --- a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs +++ b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs @@ -434,11 +434,11 @@ namespace Shentun.WebPeis.Persons var medicalHealthReportListResult = await CallAppServiceAsync(baseAddress, reportListApiUrl, medicalHealthReportListInputDto, "post"); - if (medicalHealthReportListResult.Code == 200 + if (medicalHealthReportListResult.Code != 200 || medicalHealthReportListResult.Data.FirstOrDefault() == null || medicalHealthReportListResult.Data.FirstOrDefault().ReportStatus != "1") { - throw new UserFriendlyException("没有报告单"); + throw new UserFriendlyException("没有健康评估报告"); } //报告单ID @@ -447,15 +447,22 @@ namespace Shentun.WebPeis.Persons reportApiUrl = reportApiUrl + $"?resultId={resultId}"; //获取报告apiurl var medicalHealthReportResult = await CallAppServiceAsync(baseAddress, reportApiUrl, null, "get"); - if (medicalHealthReportResult.Code == 200 + if (medicalHealthReportResult.Code != 200 || string.IsNullOrWhiteSpace(medicalHealthReportResult.Data) ) { - throw new UserFriendlyException("没有报告单"); + throw new UserFriendlyException("没有健康评估报告"); } - string reportUrl= medicalHealthReportResult.Data; + string reportUrl = medicalHealthReportResult.Data; + + if (reportUrl.IndexOf(baseAddress) == -1) + { + //替换路径为代理地址 + reportUrl = reportUrl.Replace("http://", "").Replace("https://", ""); + reportUrl = baseAddress + reportUrl.Substring(reportUrl.IndexOf('/')); + } var returnValue = new MedicalReportDto() { FilePath = reportUrl,