修改锁
							parent
							
								
									c0bd5c9d88
								
							
						
					
					
						commit
						5b92110f43
					
				| 
						 | 
				
			
			@ -1234,13 +1234,6 @@
 | 
			
		|||
            <param name="calculateType"></param>
 | 
			
		||||
            <returns></returns>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetReportTumor(System.Guid)">
 | 
			
		||||
            <summary>
 | 
			
		||||
            获取报告整体整体评估
 | 
			
		||||
            </summary>
 | 
			
		||||
            <param name="visitTaskId"></param>
 | 
			
		||||
            <returns></returns>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetReportIsExistDisease(System.Guid)">
 | 
			
		||||
            <summary>
 | 
			
		||||
            获取报告是否存在疾病
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
 | 
			
		|||
    public class StudyService : BaseService, IStudyService
 | 
			
		||||
    {
 | 
			
		||||
        private static object lockCodeGenerate = new object();
 | 
			
		||||
        private readonly AsyncLock _mutex = new AsyncLock();
 | 
			
		||||
        private static readonly AsyncLock _mutex = new AsyncLock();
 | 
			
		||||
        private static readonly AsyncLock _mutex2 = new AsyncLock();
 | 
			
		||||
 | 
			
		||||
        private readonly IEasyCachingProvider _provider;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -141,7 +142,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
 | 
			
		|||
 | 
			
		||||
                using (await _mutex.LockAsync())
 | 
			
		||||
                {
 | 
			
		||||
 | 
			
		||||
                    //查询数据库获取最大的Code 没有记录则为0
 | 
			
		||||
                    var dbStudyCodeIntMax = _dicomstudyRepository.Where(s => s.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -156,27 +156,27 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
 | 
			
		|||
 | 
			
		||||
                    _provider.Set<int>($"{trialId}_{StaticData.CacheKey.StudyMaxCode}", study.Code, TimeSpan.FromMinutes(30));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
 | 
			
		||||
                    study.TrialId = incommand.TrialId;
 | 
			
		||||
                    study.SiteId = incommand.SiteId;
 | 
			
		||||
                    study.SubjectId = incommand.SubjectId;
 | 
			
		||||
                    study.SubjectVisitId = incommand.SubjectVisitId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    //特殊处理逻辑
 | 
			
		||||
                    study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Distinct());
 | 
			
		||||
                    SpecialArchiveStudyDeal(study);
 | 
			
		||||
 | 
			
		||||
                    await _dicomstudyRepository.AddAsync(study);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    studyMonitor.StudyId = study.Id;
 | 
			
		||||
                    studyMonitor.StudyCode = study.StudyCode;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
 | 
			
		||||
                study.TrialId = incommand.TrialId;
 | 
			
		||||
                study.SiteId = incommand.SiteId;
 | 
			
		||||
                study.SubjectId = incommand.SubjectId;
 | 
			
		||||
                study.SubjectVisitId = incommand.SubjectVisitId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                //特殊处理逻辑
 | 
			
		||||
                study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Distinct());
 | 
			
		||||
                SpecialArchiveStudyDeal(study);
 | 
			
		||||
 | 
			
		||||
                await _dicomstudyRepository.AddAsync(study);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                studyMonitor.StudyId = study.Id;
 | 
			
		||||
                studyMonitor.StudyCode = study.StudyCode;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                foreach (var seriesItem in incommand.Study.SeriesList)
 | 
			
		||||
                {
 | 
			
		||||
                    var series = _mapper.Map<DicomSeries>(seriesItem);
 | 
			
		||||
| 
						 | 
				
			
			@ -284,13 +284,16 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
 | 
			
		|||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            using (await _mutex.LockAsync())
 | 
			
		||||
            using (await _mutex2.LockAsync())
 | 
			
		||||
            {
 | 
			
		||||
                await _repository.SaveChangesAsync();
 | 
			
		||||
                await _dicomInstanceRepository.SaveChangesAsync();
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            return ResponseOutput.Ok();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue