增加异常处理
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
790d751c1f
commit
596c46d885
|
|
@ -30,6 +30,7 @@ using NPOI.XWPF.UserModel;
|
|||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Log = Serilog.Log;
|
||||
|
||||
|
||||
|
||||
|
|
@ -78,6 +79,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
// DicomStudyTime = REPLACE(CONVERT(char(8), StudyTime, 108), ':', ''); --HHmmss
|
||||
// where DicomStudyDate = ''
|
||||
|
||||
var errorCount = 0;
|
||||
|
||||
//instance 找到传输语法为空的,然后分组
|
||||
var seriesList = _instanceRepository.Where(t => t.TransferSyntaxUID == "")
|
||||
|
|
@ -87,6 +89,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
.Select(g => new { g.Key.SeriesId, g.Key.NumberOfFrames, g.OrderBy(t => t.FileSize).First().Path }).ToList();
|
||||
|
||||
foreach (var item in seriesList)
|
||||
{
|
||||
try
|
||||
{
|
||||
var stream = await _oSSService.GetStreamFromOSSAsync(item.Path);
|
||||
|
||||
|
|
@ -111,6 +115,15 @@ namespace IRaCIS.Core.Application.Service
|
|||
MediaStorageSOPClassUID = mediaStorageSOPClassUID,
|
||||
SOPClassUID = sOPClassUID,
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errorCount++;
|
||||
|
||||
Log.Logger.Error($"错误数量:{errorCount} 路径:{item.Path}");
|
||||
Log.Logger.Error(e.InnerException is null ? e.Message + e.StackTrace : e.InnerException?.Message + e.InnerException?.StackTrace);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue