上传再次增加判断

IRC_NewDev
hang 2024-07-31 13:42:49 +08:00
parent d3e7b3a8d8
commit 81aa7fb8ef
1 changed files with 20 additions and 4 deletions

View File

@ -145,6 +145,22 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand)
{
var @uploadLock = _distributedLockProvider.CreateLock($"UploadDicom");
using (await @uploadLock.AcquireAsync())
{
if (_provider.Exists($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}"))
{
//---当前已有人正在上传和归档该检查!
return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress"));
}
else
{
_provider.Set($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30));
}
}
var modalitys = string.Empty;
try
@ -191,7 +207,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
study.SubjectVisitId = incommand.SubjectVisitId;
//如果因为意外情况,连续点击两次,导致第一次插入了,第二次进来也会插入,在此判断一下
var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == study.Id);
var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == study.Id);
if (findStudy != null)
{
@ -372,7 +388,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
VisitNum = t.SubjectVisit.VisitNum,
IsDicom = true,
IsFromPACS=t.IsFromPACS,
IsFromPACS = t.IsFromPACS,
SubjectCode = t.Subject.Code,
@ -422,7 +438,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
VisitNum = t.SubjectVisit.VisitNum,
IsDicom = false,
IsFromPACS=false,
IsFromPACS = false,
SubjectCode = t.Subject.Code,
@ -543,7 +559,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
path = (await _dicomInstanceRepository.Where(s => s.StudyId == studyId).Select(t => t.Path).FirstOrDefaultAsync()).IfNullThrowException();
using (var sw = ImageHelper.RenderPreviewJpeg(path))
{