压缩包下载

master
hang 2023-09-14 10:20:48 +08:00
parent 913a8d75da
commit 33a8b4117c
13 changed files with 120 additions and 169 deletions

View File

@ -17,16 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Infra.EFCore",
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Infrastructure", "IRaCIS.Core.Infrastructure\IRaCIS.Core.Infrastructure.csproj", "{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Infrastructure", "IRaCIS.Core.Infrastructure\IRaCIS.Core.Infrastructure.csproj", "{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EI_Image_Viewer_Installer", "Start\EI_Image_Viewer_Installer.csproj", "{D96F4B52-359C-43C9-8110-BAD1437F9280}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Install", "Install\Install.csproj", "{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnInstall", "UnInstall\UnInstall.csproj", "{60B9AC72-5744-4517-93A5-A1ECD573A529}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EI_Image_Viewer_Activation", "EI_Image_Viewer_Activation\EI_Image_Viewer_Activation.csproj", "{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EI_TestProject", "EI_TestProject\EI_TestProject.csproj", "{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -115,66 +105,6 @@ Global
{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|x64.Build.0 = Release|x64 {07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|x64.Build.0 = Release|x64
{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|x86.ActiveCfg = Release|Any CPU {07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|x86.ActiveCfg = Release|Any CPU
{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|x86.Build.0 = Release|Any CPU {07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|x86.Build.0 = Release|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Debug|x64.ActiveCfg = Debug|x64
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Debug|x64.Build.0 = Debug|x64
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Debug|x86.ActiveCfg = Debug|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Debug|x86.Build.0 = Debug|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Release|Any CPU.Build.0 = Release|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Release|x64.ActiveCfg = Release|x64
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Release|x64.Build.0 = Release|x64
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Release|x86.ActiveCfg = Release|Any CPU
{D96F4B52-359C-43C9-8110-BAD1437F9280}.Release|x86.Build.0 = Release|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Debug|x64.ActiveCfg = Debug|x64
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Debug|x64.Build.0 = Debug|x64
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Debug|x86.ActiveCfg = Debug|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Debug|x86.Build.0 = Debug|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Release|Any CPU.Build.0 = Release|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Release|x64.ActiveCfg = Release|x64
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Release|x64.Build.0 = Release|x64
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Release|x86.ActiveCfg = Release|Any CPU
{F5820DF0-DE23-4F4A-8D49-7E22F67B784D}.Release|x86.Build.0 = Release|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Debug|x64.ActiveCfg = Debug|x64
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Debug|x64.Build.0 = Debug|x64
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Debug|x86.ActiveCfg = Debug|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Debug|x86.Build.0 = Debug|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Release|Any CPU.Build.0 = Release|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Release|x64.ActiveCfg = Release|x64
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Release|x64.Build.0 = Release|x64
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Release|x86.ActiveCfg = Release|Any CPU
{60B9AC72-5744-4517-93A5-A1ECD573A529}.Release|x86.Build.0 = Release|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Debug|x64.ActiveCfg = Debug|x64
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Debug|x64.Build.0 = Debug|x64
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Debug|x86.ActiveCfg = Debug|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Debug|x86.Build.0 = Debug|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Release|Any CPU.Build.0 = Release|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Release|x64.ActiveCfg = Release|x64
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Release|x64.Build.0 = Release|x64
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Release|x86.ActiveCfg = Release|Any CPU
{1D8AC441-D578-4B38-BCEE-686BD5D59E5A}.Release|x86.Build.0 = Release|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Debug|x64.ActiveCfg = Debug|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Debug|x64.Build.0 = Debug|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Debug|x86.ActiveCfg = Debug|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Debug|x86.Build.0 = Debug|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Release|Any CPU.Build.0 = Release|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Release|x64.ActiveCfg = Release|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Release|x64.Build.0 = Release|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Release|x86.ActiveCfg = Release|Any CPU
{47F99CA7-E55B-4A0E-A511-7EDF34C57A20}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -42,9 +42,11 @@ using System.Collections.Generic;
using System.Data; using System.Data;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using static IRaCIS.Core.Domain.Share.StaticData;
using Path = System.IO.Path; using Path = System.IO.Path;
namespace IRaCIS.Core.API.Controllers namespace IRaCIS.Core.API.Controllers
@ -266,7 +268,7 @@ namespace IRaCIS.Core.API.Controllers
[DisableFormValueModelBinding] [DisableFormValueModelBinding]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> ArchiveStudyNew(/*[FromForm] ArchiveStudyCommand archiveStudyCommand,*/ Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId,Guid studyMonitorId, public async Task<IResponseOutput> ArchiveStudyNew(/*[FromForm] ArchiveStudyCommand archiveStudyCommand,*/ Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId, Guid studyMonitorId,
[FromServices] ILogger<UploadDownLoadController> _logger, [FromServices] ILogger<UploadDownLoadController> _logger,
[FromServices] IEasyCachingProvider _provider, [FromServices] IEasyCachingProvider _provider,
[FromServices] IStudyService _studyService, [FromServices] IStudyService _studyService,
@ -394,7 +396,7 @@ namespace IRaCIS.Core.API.Controllers
studyMonitor.IsSuccess = true; studyMonitor.IsSuccess = true;
} }
} }
catch (Exception e) catch (Exception e)
{ {
@ -411,7 +413,7 @@ namespace IRaCIS.Core.API.Controllers
studyMonitor.StudyCode = archiveResult.ArchivedDicomStudies.FirstOrDefault()?.StudyCode; studyMonitor.StudyCode = archiveResult.ArchivedDicomStudies.FirstOrDefault()?.StudyCode;
studyMonitor.ArchiveFinishedTime = DateTime.Now; studyMonitor.ArchiveFinishedTime = DateTime.Now;
await _studyMonitorRepository.SaveChangesAsync(); await _studyMonitorRepository.SaveChangesAsync();
} }
@ -423,8 +425,61 @@ namespace IRaCIS.Core.API.Controllers
} }
[HttpPost, Route("Study/CreateImageZip")]
public async Task<IResponseOutput> CreateImageZipAsync(Guid visitTaskId, [FromServices] IHubContext<UploadHub, IUploadClient> _uploadHub)
{
await _repository.BatchUpdateAsync<VisitTask>(t => t.Id == visitTaskId, u => new VisitTask() { PackState = PackState.Packing });
var info = _repository.Where<VisitTask>(t => t.Id == visitTaskId).Select(t => new { t.TrialId, t.Subject.SiteId, t.SubjectId, t.SourceSubjectVisitId }).FirstOrDefault();
var folderPath = FileStoreHelper.GetSubjectVisitDicomFolderPhysicalPath(_hostEnvironment, info.TrialId, info.SiteId, info.SubjectId, info.SourceSubjectVisitId.Value);
// 获取文件夹中的文件列表
var files = Directory.GetFiles(folderPath);
// 创建一个唯一的ZIP文件名
var zipFileName = $"archive_{DateTime.Now:yyyyMMddHHmmss}.zip";
var tempStoreFolder = Path.Combine(FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment), StaticData.Folder.TempFileFolder);
if (!Directory.Exists(tempStoreFolder))
{
Directory.CreateDirectory(tempStoreFolder);
}
var zipFilePath = Path.Combine(tempStoreFolder, zipFileName);
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TempFileFolder}/{zipFileName}";
await Task.Run(async () =>
{
ZipFile.CreateFromDirectory(folderPath, zipFilePath);
await _repository.BatchUpdateAsync<VisitTask>(t => t.Id == visitTaskId, u => new VisitTask() { PackState = PackState.Packed, PackRelativePath = relativePath });
});
// 发送最终进度信息到客户端
//await _uploadHub.Clients.User(_userInfo.Id.ToString()).CompressProgressAsync(visitTaskId, $"打包完成");
return ResponseOutput.Ok(relativePath);
}
[AllowAnonymous]
[HttpGet("Study/DownloadImageZip")]
public IActionResult DownloadImageZip(string relativePath)
{
var fileStorePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, relativePath);
new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(fileStorePath), out var contentType);
return File(System.IO.File.OpenRead(fileStorePath), contentType ?? "application/octet-stream", Path.GetFileName(fileStorePath));
}
/// <summary> /// <summary>
@ -671,7 +726,7 @@ namespace IRaCIS.Core.API.Controllers
[RequestSizeLimit(1_073_741_824)] [RequestSizeLimit(1_073_741_824)]
[HttpPost("NoneDicomStudy/UploadNoneDicomFile/{trialId:guid}/{subjectVisitId:guid}/{noneDicomStudyId:guid}/{studyMonitorId:guid}")] [HttpPost("NoneDicomStudy/UploadNoneDicomFile/{trialId:guid}/{subjectVisitId:guid}/{noneDicomStudyId:guid}/{studyMonitorId:guid}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId, Guid studyMonitorId, public async Task<IResponseOutput> UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId, Guid studyMonitorId,
[FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository, [FromServices] IRepository<StudyMonitor> _studyMonitorRepository) [FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository, [FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
{ {
@ -709,7 +764,7 @@ namespace IRaCIS.Core.API.Controllers
studyMonitor.IsDicomReUpload = false; studyMonitor.IsDicomReUpload = false;
studyMonitor.StudyId = noneDicomStudyId; studyMonitor.StudyId = noneDicomStudyId;
studyMonitor.StudyCode = noneDicomStudy.StudyCode; studyMonitor.StudyCode = noneDicomStudy.StudyCode;
studyMonitor.ArchiveFinishedTime = DateTime.Now; studyMonitor.ArchiveFinishedTime = DateTime.Now;
studyMonitor.IP = _userInfo.IP; studyMonitor.IP = _userInfo.IP;
await _repository.SaveChangesAsync(); await _repository.SaveChangesAsync();
@ -727,7 +782,7 @@ namespace IRaCIS.Core.API.Controllers
/// <returns></returns> /// <returns></returns>
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")] [HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
//[Authorize(Policy = IRaCISPolicy.PM_APM)] //[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId) public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId)
{ {
@ -894,7 +949,7 @@ namespace IRaCIS.Core.API.Controllers
var dt = DateTime.Now; var dt = DateTime.Now;
etcCheckList = etcCheckList.Where(t => !(t.Modality == string.Empty || t.SiteCode == string.Empty || t.SubjectCode == string.Empty || t.VisitName == string.Empty || t.StudyDate == string.Empty ||! DateTime.TryParse(t.StudyDate, out dt))).ToList(); etcCheckList = etcCheckList.Where(t => !(t.Modality == string.Empty || t.SiteCode == string.Empty || t.SubjectCode == string.Empty || t.VisitName == string.Empty || t.StudyDate == string.Empty || !DateTime.TryParse(t.StudyDate, out dt))).ToList();
if (etcCheckList.Count == 0) if (etcCheckList.Count == 0)
{ {

View File

@ -13,7 +13,7 @@
<Version>1.0.1.001</Version> <Version>1.0.1.001</Version>
<ApplicationIcon>favicon.ico</ApplicationIcon> <ApplicationIcon>favicon.ico</ApplicationIcon>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>EI_Image_Viewer</AssemblyName> <AssemblyName></AssemblyName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<doc> <doc>
<assembly> <assembly>
<name>EI_Image_Viewer</name> <name>IRaCIS.Core.API</name>
</assembly> </assembly>
<members> <members>
<member name="M:EasyCaching.Demo.Interceptors.Controllers.ErrorController.Error(System.Int32)"> <member name="M:EasyCaching.Demo.Interceptors.Controllers.ErrorController.Error(System.Int32)">

View File

@ -16,43 +16,13 @@
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
}, },
"IRaCIS.Development": { "IRaCIS.Test510K": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": true,
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Test_510K"
}, },
"applicationUrl": "http://localhost:6100" "applicationUrl": "http://localhost:6100"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true
},
"IRaCIS.Staging": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Staging"
},
"applicationUrl": "http://localhost:6200"
},
"IRaCIS.Production": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
},
"applicationUrl": "http://localhost:6300"
},
"IRaCIS.CertificateApply": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "CertificateApply"
},
"applicationUrl": "http://localhost:6400"
} }
} }
} }

View File

@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace IRaCIS.Core.API namespace IRaCIS.Core.API
@ -11,6 +12,9 @@ namespace IRaCIS.Core.API
public interface IUploadClient public interface IUploadClient
{ {
Task ReceivProgressAsync(string studyInstanceUid, int haveReceivedCount); Task ReceivProgressAsync(string studyInstanceUid, int haveReceivedCount);
Task CompressProgressAsync(Guid visitTaskId, string msg);
} }
@ -28,6 +32,7 @@ namespace IRaCIS.Core.API
{ {
public ILogger<UploadHub> _logger { get; set; } public ILogger<UploadHub> _logger { get; set; }
//public IUserInfo _userInfo { get; set; } //public IUserInfo _userInfo { get; set; }
public UploadHub(/*IUserInfo userInfo,*/ ILogger<UploadHub> logger) public UploadHub(/*IUserInfo userInfo,*/ ILogger<UploadHub> logger)
{ {
@ -38,7 +43,6 @@ namespace IRaCIS.Core.API
public override Task OnConnectedAsync() public override Task OnConnectedAsync()
{ {
//base.Context.User.id
_logger.LogError("连接: " + Context.ConnectionId); _logger.LogError("连接: " + Context.ConnectionId);
@ -47,12 +51,7 @@ namespace IRaCIS.Core.API
return base.OnConnectedAsync(); return base.OnConnectedAsync();
} }
//public async Task SendProgress(string studyInstanceUid, int haveReceivedCount)
//{
// await Clients.All.ReceivProgressAsync(studyInstanceUid, haveReceivedCount);
//}
} }
} }

View File

@ -7,9 +7,7 @@
} }
}, },
"ConnectionStrings": { "ConnectionStrings": {
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Test.EIImageViewer;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true", "RemoteNew": "Server=192.168.3.69,1434;Database=Test_510K;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
"Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Hangfire_IRaCIS;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
}, },
"BasicSystemConfig": { "BasicSystemConfig": {

View File

@ -182,7 +182,9 @@ namespace IRaCIS.Core.Application.ViewModel
public Guid? SourceSubjectVisitId { get; set; } public Guid? SourceSubjectVisitId { get; set; }
public Guid? SouceReadModuleId { get; set; } public Guid? SouceReadModuleId { get; set; }
public PackState PackState { get; set; }
public string PackRelativePath { get; set; }
} }

View File

@ -1,22 +1,22 @@
using System; using System;
using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Core.Application.Contracts.Dicom.DTO namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
{ {
public class ImageShareCommand public class ImageShareCommand
{ {
public Guid TrialId { get; set; } [NotDefault]
public Guid SiteId { get; set; } public Guid VisitTaskId { get; set; }
public Guid SubjectId { get; set; }
public Guid? StudyId { get; set; }
public DateTime? ExpireTime { get; set; } public string RouteUrl { get; set; }
public string Password { get; set; } = string.Empty;
} }
public class ResourceInfo public class ResourceInfo
{ {
public Guid StudyId { get; set; } public Guid VisitTaskId { get; set; }
public string RouteUrl { get; set; }
public string Token { get; set; } = string.Empty; public string Token { get; set; } = string.Empty;
} }

View File

@ -29,54 +29,23 @@ namespace IRaCIS.Core.Application.Services
[HttpPost] [HttpPost]
public async Task<IResponseOutput> CreateImageShare(ImageShareCommand imageShareCommand) public async Task<IResponseOutput> CreateImageShare(ImageShareCommand imageShareCommand)
{ {
if (imageShareCommand.StudyId == null)
{ var imageShare = _mapper.Map<ImageShare>(imageShareCommand);
#region 上传不按照检查批次上传,基线没传,数据可能出错 var addEntity = await _imageShareRepository.AddAsync(imageShare);
//var subjectVisit1 = _subjectVisitRepository.FirstOrDefault(t =>
// t.TrialId == imageShareCommand.TrialId && t.SubjectId == imageShareCommand.SubjectId &&
// t.VisitNum == 1);
//if (subjectVisit1 == null)
//{
// return ResponseOutput.NotOk("当前无影像数据,无法分享!");
//}
//imageShareCommand.StudyId =
// _studyRepository.GetAll().First(t => t.SubjectVisitId == subjectVisit1.Id&&t.Status != (int)StudyStatus.Abandon).Id;
#endregion
var studyIds = await _studyRepository.AsQueryable()
.Where(t => t.TrialId == imageShareCommand.TrialId && t.SubjectId == imageShareCommand.SubjectId &&
t.SiteId == imageShareCommand.SiteId)
.Select(u => u.Id).ToListAsync();
if (!studyIds.Any())
{
return ResponseOutput.NotOk("当前检查没有影像可以分享。 ");
}
imageShareCommand.StudyId = studyIds.First();
}
//验证码 4位 //验证码 4位
int verificationPassWord = new Random().Next(1000, 10000); int verificationPassWord = new Random().Next(1000, 10000);
imageShareCommand.Password = verificationPassWord.ToString(); addEntity.Password = verificationPassWord.ToString();
//配置文件读取过期时间 //配置文件读取过期时间
var days = AppSettings.ImageShareExpireDays; var days = AppSettings.ImageShareExpireDays;
imageShareCommand.ExpireTime = DateTime.Now.AddDays(days); addEntity.ExpireTime = DateTime.Now.AddDays(days);
var imageShare = _mapper.Map<ImageShare>(imageShareCommand);
await _imageShareRepository.AddAsync(imageShare);
var success = await _imageShareRepository.SaveChangesAsync(); var success = await _imageShareRepository.SaveChangesAsync();
@ -108,7 +77,8 @@ namespace IRaCIS.Core.Application.Services
var resource = new ResourceInfo() var resource = new ResourceInfo()
{ {
StudyId = imageShare.StudyId, VisitTaskId = imageShare.VisitTaskId,
RouteUrl=imageShare.RouteUrl,
Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo() Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()
{ {
Id = Guid.Empty, Id = Guid.Empty,

View File

@ -173,7 +173,11 @@ namespace IRaCIS.Core.Domain.Models
//随访任务号 取检查批次的号 计划外是 检查批次+0.1 裁判任务在检查批次任务上+0.002 全局任务在截止检查批次号上+0.03 肿瘤待定 //随访任务号 取检查批次的号 计划外是 检查批次+0.1 裁判任务在检查批次任务上+0.002 全局任务在截止检查批次号上+0.03 肿瘤待定
public decimal VisitTaskNum { get; set; } public decimal VisitTaskNum { get; set; }
public PackState PackState { get; set; }
public string PackRelativePath { get; set; }
/// <summary> /// <summary>
/// 首次阅片时间 /// 首次阅片时间
@ -372,3 +376,25 @@ namespace IRaCIS.Core.Domain.Models
} }
} }
/// <summary>
/// 影像下载打包状态
/// </summary>
public enum PackState
{
/// <summary>
/// 待打包
/// </summary>
WaitPack = 0,
/// <summary>
/// 打包中
/// </summary>
Packing = 1,
/// <summary>
/// 打包完成
/// </summary>
Packed = 2
}

View File

@ -4,10 +4,9 @@ namespace IRaCIS.Core.Domain.Models
{ {
public class ImageShare: Entity public class ImageShare: Entity
{ {
public Guid TrialId { get; set; } public Guid VisitTaskId { get; set; }
public Guid SiteId { get; set; }
public Guid SubjectId { get; set; } public string RouteUrl { get; set; }
public Guid StudyId { get; set; }
public DateTime ExpireTime { get; set; } public DateTime ExpireTime { get; set; }

View File

@ -21,6 +21,8 @@ public static class StaticData
{ {
public static readonly string IRaCISDataFolder = "EIImageViewerData"; public static readonly string IRaCISDataFolder = "EIImageViewerData";
public static readonly string TempFileFolder = "TempFile";
public static readonly string TrialDataFolder = "TrialData"; public static readonly string TrialDataFolder = "TrialData";
public static readonly string SystemDataFolder = "SystemData"; public static readonly string SystemDataFolder = "SystemData";