Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
2530843931
|
|
@ -47,8 +47,6 @@ namespace IRaCIS.Core.SCP.Service
|
|||
|
||||
private List<Guid> _SCPStudyIdList => _ImageUploadList.Where(t => t.SCPStudyId != Guid.Empty).Select(t => t.SCPStudyId).ToList();
|
||||
|
||||
|
||||
|
||||
private List<ImageUploadInfo> _ImageUploadList { get; set; } = new List<ImageUploadInfo>();
|
||||
|
||||
private SCPImageUpload _upload { get; set; }
|
||||
|
|
@ -57,6 +55,8 @@ namespace IRaCIS.Core.SCP.Service
|
|||
|
||||
private List<Guid> HospitalGroupIdList { get; set; }
|
||||
|
||||
private bool _releasedNormally = false;
|
||||
|
||||
|
||||
private static readonly DicomTransferSyntax[] _acceptedTransferSyntaxes = new DicomTransferSyntax[]
|
||||
{
|
||||
|
|
@ -159,6 +159,7 @@ namespace IRaCIS.Core.SCP.Service
|
|||
{
|
||||
var _distributedLockProvider = _serviceProvider.GetService<IDistributedLockProvider>();
|
||||
|
||||
|
||||
var @lock = _distributedLockProvider.CreateLock($"{_upload.CallingAE}");
|
||||
|
||||
using (await @lock.AcquireAsync())
|
||||
|
|
@ -168,6 +169,9 @@ namespace IRaCIS.Core.SCP.Service
|
|||
|
||||
await AddUploadLogAsync();
|
||||
|
||||
_releasedNormally = true;
|
||||
|
||||
Log.Logger.Information($"进入释放连接请求 {_releasedNormally}");
|
||||
}
|
||||
|
||||
await SendAssociationReleaseResponseAsync();
|
||||
|
|
@ -245,27 +249,29 @@ namespace IRaCIS.Core.SCP.Service
|
|||
|
||||
|
||||
public async void OnConnectionClosed(Exception exception)
|
||||
{
|
||||
/* nothing to do here */
|
||||
|
||||
//奇怪的bug 上传的时候,用王捷修改的影像,会关闭,重新连接,导致检查id 丢失,然后状态不一致
|
||||
if (exception == null)
|
||||
{
|
||||
var _studyRepository = _serviceProvider.GetService<IRepository<SCPStudy>>();
|
||||
//将检查设置为传输结束
|
||||
await _studyRepository.BatchUpdateNoTrackingAsync(t => _SCPStudyIdList.Contains(t.Id), u => new SCPStudy() { IsUploadFinished = true });
|
||||
|
||||
await _studyRepository.SaveChangesAndClearAllTrackingAsync();
|
||||
}
|
||||
else
|
||||
|
||||
if (exception == null || _releasedNormally == false)
|
||||
{
|
||||
//客户端断网,恢复后,也是没有异常的,估计是超时走了关闭
|
||||
|
||||
await _studyRepository.BatchUpdateNoTrackingAsync(t => _SCPStudyIdList.Contains(t.Id), u => new SCPStudy() { IsUploadFinished = true, IsUploadFaild = true });
|
||||
//记录日志
|
||||
await AddUploadLogAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
//将检查设置为传输结束
|
||||
await _studyRepository.BatchUpdateNoTrackingAsync(t => _SCPStudyIdList.Contains(t.Id), u => new SCPStudy() { IsUploadFinished = true, IsUploadFaild = false });
|
||||
}
|
||||
|
||||
|
||||
await _studyRepository.SaveChangesAndClearAllTrackingAsync();
|
||||
|
||||
Log.Logger.Warning($"连接关闭 {exception?.Message} {exception?.InnerException?.Message}");
|
||||
|
||||
Log.Logger.Warning($"连接关闭 {_releasedNormally} {exception?.Message} {exception?.InnerException?.Message}");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -400,7 +406,7 @@ namespace IRaCIS.Core.SCP.Service
|
|||
{
|
||||
try
|
||||
{
|
||||
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.File , storeRelativePath, Association.CallingAE, Association.CalledAE, fileSize);
|
||||
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.File, storeRelativePath, Association.CallingAE, Association.CalledAE, fileSize);
|
||||
|
||||
var series = await _seriesRepository.FirstOrDefaultAsync(t => t.Id == seriesId);
|
||||
|
||||
|
|
@ -513,6 +519,8 @@ namespace IRaCIS.Core.SCP.Service
|
|||
|
||||
public Task OnCStoreRequestExceptionAsync(string tempFileName, Exception e)
|
||||
{
|
||||
Log.Logger.Warning($"CStoreRequestException {tempFileName} {e?.Message} {e?.InnerException?.Message}");
|
||||
|
||||
// let library handle logging and error response
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
|
|||
|
||||
public bool IsUploadFinished { get; set; }
|
||||
|
||||
|
||||
public bool IsUploadFaild { get; set; }
|
||||
|
||||
#region HIR 注释
|
||||
//public Guid TrialId { get; set; }
|
||||
|
|
|
|||
19208
IRaCIS.Core.Infra.EFCore/Migrations/20250919084625_modifyUploadFailed.Designer.cs
generated
Normal file
19208
IRaCIS.Core.Infra.EFCore/Migrations/20250919084625_modifyUploadFailed.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,29 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class modifyUploadFailed : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsUploadFaild",
|
||||
table: "SCPStudy",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsUploadFaild",
|
||||
table: "SCPStudy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8190,6 +8190,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsUploadFaild")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsUploadFinished")
|
||||
.HasColumnType("bit");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue