Browse Source

导入结果报告图片

bjmzak
wxd 1 year ago
parent
commit
9f554f2db4
  1. 17
      src/Shentun.Peis.Application/ImportPacsResults/ImportPacsResultAppService.cs
  2. 21
      src/Shentun.Peis.Domain/CacheService.cs

17
src/Shentun.Peis.Application/ImportPacsResults/ImportPacsResultAppService.cs

@ -21,6 +21,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography.Xml; using System.Security.Cryptography.Xml;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
@ -278,9 +279,21 @@ namespace Shentun.Peis.ImportPacsResults
} }
} }
PDFHelper.ConvertPdfToImage(tempPdf, tempFilePath ,"tempImage");
pictureUrl = ImageHelper.SavePacsFile(absolutePath, tempFilePath + "\\tempImage_0.jpg", firstEntity.patientRegister.Id.ToString(),
string hostName = file.FileUrl.Replace("http://", "").Replace("https://", "");
if (hostName.IndexOf(":") > 0)
{
hostName = hostName.Substring(0, hostName.IndexOf(":"));
}
else
{
hostName = hostName.Substring(0, hostName.IndexOf("/"));
}
string tempImageName = "tempImage" + hostName;
PDFHelper.ConvertPdfToImage(tempPdf, tempFilePath, tempImageName);
pictureUrl = ImageHelper.SavePacsFile(absolutePath, tempFilePath + "\\" + tempImageName + "_0.jpg", firstEntity.patientRegister.Id.ToString(),
firstEntity.registerCheck.Id.ToString(), fileName); firstEntity.registerCheck.Id.ToString(), fileName);
} }
else else

21
src/Shentun.Peis.Domain/CacheService.cs

@ -67,8 +67,7 @@ namespace Shentun.Peis
IRepository<CustomerOrg, Guid> customerOrgRepository, IRepository<CustomerOrg, Guid> customerOrgRepository,
IRepository<MaritalStatus> maritalStatusRepository, IRepository<MaritalStatus> maritalStatusRepository,
IRepository<MedicalType, Guid> medicalTypeRepository, IRepository<MedicalType, Guid> medicalTypeRepository,
IRepository<PersonnelType, Guid> personnelTypeRepository
,
IRepository<PersonnelType, Guid> personnelTypeRepository,
IDistributedCache<string, Guid> customerOrgTopNameCache) IDistributedCache<string, Guid> customerOrgTopNameCache)
{ {
_userCache = userCache; _userCache = userCache;
@ -164,11 +163,19 @@ namespace Shentun.Peis
private async Task<MaritalStatus> GetMaritalStatusAsync(char id) private async Task<MaritalStatus> GetMaritalStatusAsync(char id)
{ {
var entity = await _maritalStatusCache.GetOrAddAsync(
id, //缓存键
async () => (await _maritalStatusRepository.GetQueryableAsync()).Where(o => o.Id == id).Single()
);
return entity;
var maritalStatusEntity = await _maritalStatusCache.GetAsync(id);
if (maritalStatusEntity == null)
{
maritalStatusEntity = await _maritalStatusRepository.FirstOrDefaultAsync(f => f.Id == id);
}
return maritalStatusEntity;
//var entity = await _maritalStatusCache.GetOrAddAsync(
// id, //缓存键
// async () => (await _maritalStatusRepository.GetQueryableAsync()).Where(o => o.Id == id).Single()
//);
//return entity;
} }
public async Task<string> GetMaritalStatusNameAsync(char id) public async Task<string> GetMaritalStatusNameAsync(char id)
{ {

Loading…
Cancel
Save