|
|
|
@ -9,6 +9,7 @@ using System.Threading.Tasks; |
|
|
|
using Shentun.Peis.ImportPacsResults; |
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
using Shentun.Peis.ImportLisResults; |
|
|
|
using System.Security.Policy; |
|
|
|
|
|
|
|
namespace Shentun.Peis.PlugIns.Gem |
|
|
|
{ |
|
|
|
@ -29,6 +30,10 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
var beginTime = DateTime.Now.Date.AddDays(-30); |
|
|
|
foreach (var pacsRequest in pacsRequests) |
|
|
|
{ |
|
|
|
if (string.IsNullOrWhiteSpace(pacsRequest.CheckRequestNo)) |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
var interfaceInpu = new ImportPacsResultInterfaceInput() |
|
|
|
{ |
|
|
|
tjNum = pacsRequest.CheckRequestNo, |
|
|
|
@ -45,12 +50,12 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
//}
|
|
|
|
var apiResult = await CallInterfaceServiceAsync<ImportPacsResultInterfaceInput, |
|
|
|
ImportPacsResultInterfaceOut>(interfaceInpu); |
|
|
|
if(!apiResult.data.Any()) |
|
|
|
if (!apiResult.data.Any()) |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
var firstData = apiResult.data[0]; |
|
|
|
if(!DateTime.TryParse(firstData.reportDateTime,out var checkDate)) |
|
|
|
if (!DateTime.TryParse(firstData.reportDateTime, out var checkDate)) |
|
|
|
{ |
|
|
|
throw new Exception("报告时间格式不正确"); |
|
|
|
} |
|
|
|
@ -68,12 +73,13 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
new CreateImportPacsResultPictureDto() |
|
|
|
{ |
|
|
|
IsPrint = 'Y', |
|
|
|
FileTransMode = "0", |
|
|
|
FileTransMode = "0",//0-json,1-url
|
|
|
|
FileName = firstData.reportUrl, |
|
|
|
FileFormat = "1", |
|
|
|
FileFormat = "0",//0-图片,1-pdf
|
|
|
|
FileUrl = firstData.reportUrl, |
|
|
|
FileBase64 = Shentun.Utilities.FileHelper.ToBase64(firstData.reportUrl) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
@ -85,7 +91,7 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<TOut> CallInterfaceServiceAsync<TInput, TOut>( TInput data) |
|
|
|
public async Task<TOut> CallInterfaceServiceAsync<TInput, TOut>(TInput data) |
|
|
|
{ |
|
|
|
string baseAddress = InterfaceWebApiUrl; |
|
|
|
using (var httpClientHandler = new HttpClientHandler()) |
|
|
|
@ -115,7 +121,7 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
dynamic resultDto = JsonConvert.DeserializeObject<TOut>(result); |
|
|
|
if (resultDto != null) |
|
|
|
{ |
|
|
|
if (resultDto.code!= "200") |
|
|
|
if (resultDto.code != "200") |
|
|
|
{ |
|
|
|
throw new Exception($"调用WebApi失败,返回错误,消息:" + resultDto.code + resultDto.msg); |
|
|
|
} |
|
|
|
|