|
|
|
@ -29,7 +29,7 @@ using Volo.Abp.Users; |
|
|
|
namespace Shentun.Peis.ImportPacsResults |
|
|
|
{ |
|
|
|
[ApiExplorerSettings(GroupName = "Work")] |
|
|
|
//[Authorize]
|
|
|
|
[Authorize] |
|
|
|
public class ImportPacsResultAppService : ApplicationService |
|
|
|
{ |
|
|
|
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository; |
|
|
|
@ -118,6 +118,15 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
[HttpPost("api/app/ImportPacsResult/ImportResult")] |
|
|
|
public async Task ImportResultAsync(CreateImportPacsResultDto input) |
|
|
|
{ |
|
|
|
if (input == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("input参数不能为空"); |
|
|
|
|
|
|
|
} |
|
|
|
if(string.IsNullOrWhiteSpace(input.CheckRequestNo)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("CheckRequestNo不能为空"); |
|
|
|
} |
|
|
|
//设置结果
|
|
|
|
|
|
|
|
var list = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync() |
|
|
|
@ -216,17 +225,35 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
{ |
|
|
|
fileName = Path.GetFileNameWithoutExtension(file.FileName); |
|
|
|
} |
|
|
|
|
|
|
|
if (file.FileTransMode == "1") |
|
|
|
{ |
|
|
|
if(string.IsNullOrWhiteSpace(file.FileUrl)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("文件URL不能为空"); |
|
|
|
} |
|
|
|
if (!string.IsNullOrWhiteSpace(file.FileBase64)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("文件Base64不能传值"); |
|
|
|
} |
|
|
|
file.FileBase64 = Shentun.Utilities.FileHelper.ToBase64(file.FileUrl); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (string.IsNullOrWhiteSpace(file.FileBase64)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("文件Base64不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
//0-图片,1-PDF
|
|
|
|
if (file.FileFormat == "0") |
|
|
|
{ |
|
|
|
|
|
|
|
pictureUrl = ImageHelper.Base64StrToImageInAbsolutePath(absolutePath, fileName, file.FileBase64, firstEntity.patientRegister.Id.ToString(), |
|
|
|
firstEntity.registerCheck.Id.ToString()); |
|
|
|
|
|
|
|
} |
|
|
|
else if (file.FileFormat == "1") |
|
|
|
{ |
|
|
|
|
|
|
|
byte[] pdfBytes = Convert.FromBase64String(file.FileBase64); |
|
|
|
var tempFilePath = DirectoryHelper.GetAppDirectory() + "\\temp-files"; |
|
|
|
if (!Directory.Exists(tempFilePath)) |
|
|
|
@ -257,7 +284,7 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(pictureUrl)) |
|
|
|
if (string.IsNullOrWhiteSpace(pictureUrl)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("pictureUrl是空值"); |
|
|
|
} |
|
|
|
|