增加StudyCode

Test_IRC_Net8
hang 2026-04-02 17:07:46 +08:00
parent 9a276e3d3c
commit 81280a3fed
9 changed files with 22079 additions and 0 deletions

View File

@ -42,6 +42,7 @@ public class FileUploadRecordAddOrEdit
public string UploadBatchId { get; set; } public string UploadBatchId { get; set; }
public BatchDataType BatchDataType { get; set; } public BatchDataType BatchDataType { get; set; }
public string StudyCode { get; set; }
public Guid? TrialId { get; set; } public Guid? TrialId { get; set; }
@ -72,6 +73,8 @@ public class FileUploadRecordQuery : PageInput
public bool? IsSystermFile { get; set; } public bool? IsSystermFile { get; set; }
public string StudyCode { get; set; }
public string? FileMarkId { get; set; } public string? FileMarkId { get; set; }

View File

@ -29,6 +29,10 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
ObjectStoreServiceOptions ObjectStoreServiceConfig = options.CurrentValue; ObjectStoreServiceOptions ObjectStoreServiceConfig = options.CurrentValue;
/// <summary> /// <summary>
/// 上传记录表--里面包含待同步任务 /// 上传记录表--里面包含待同步任务
/// </summary> /// </summary>
@ -42,6 +46,7 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
.WhereIf(inQuery.BatchDataType != null, t => t.BatchDataType == inQuery.BatchDataType) .WhereIf(inQuery.BatchDataType != null, t => t.BatchDataType == inQuery.BatchDataType)
.WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName)) .WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName))
.WhereIf(!string.IsNullOrEmpty(inQuery.FileType), t => t.FileType.Contains(inQuery.FileType)) .WhereIf(!string.IsNullOrEmpty(inQuery.FileType), t => t.FileType.Contains(inQuery.FileType))
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId) .WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
.WhereIf(inQuery.IsSystermFile == true, t => t.TrialId == null) .WhereIf(inQuery.IsSystermFile == true, t => t.TrialId == null)
.WhereIf(inQuery.IsSync != null, t => t.IsSync == inQuery.IsSync) .WhereIf(inQuery.IsSync != null, t => t.IsSync == inQuery.IsSync)

View File

@ -265,6 +265,11 @@ namespace IRaCIS.Core.Application.Contracts
[NotDefault] [NotDefault]
public Guid StudyMonitorId { get; set; } public Guid StudyMonitorId { get; set; }
[NotDefault]
public string UploadBatchId { get; set; }
public int FailedFileCount { get; set; } public int FailedFileCount { get; set; }
public string RecordPath { get; set; } = string.Empty; public string RecordPath { get; set; } = string.Empty;
@ -289,6 +294,10 @@ namespace IRaCIS.Core.Application.Contracts
[NotDefault] [NotDefault]
public Guid StudyMonitorId { get; set; } public Guid StudyMonitorId { get; set; }
[NotDefault]
public string UploadBatchId { get; set; }
public int FailedFileCount { get; set; } public int FailedFileCount { get; set; }
public string RecordPath { get; set; } = string.Empty; public string RecordPath { get; set; } = string.Empty;

View File

@ -41,6 +41,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
IRepository<VisitTask> _visitTaskRepository, IRepository<VisitTask> _visitTaskRepository,
IRepository<SubjectVisit> _subjectVisitRepository, IRepository<SubjectVisit> _subjectVisitRepository,
IOSSService _oSSService, IOSSService _oSSService,
IRepository<FileUploadRecord> _fileUploadRecordRepository,
IRepository<Dictionary> _dictionaryRepository, IRepository<Dictionary> _dictionaryRepository,
IRepository<Trial> _trialRepository, IRepository<Trial> _trialRepository,
IRepository<StudyMonitor> _studyMonitorRepository, IRepository<StudyMonitor> _studyMonitorRepository,
@ -803,6 +804,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{ {
await _taskStudyRepository.SaveChangesAsync(); await _taskStudyRepository.SaveChangesAsync();
} }
await _fileUploadRecordRepository.BatchUpdateNoTrackingAsync(t => t.UploadBatchId == incommand.UploadBatchId, u => new FileUploadRecord() { StudyCode = findStudy.StudyCode });
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -20,6 +20,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
IRepository<Trial> _trialRepository, IRepository<Trial> _trialRepository,
IRepository<VisitTask> _visitTaskRepository, IRepository<VisitTask> _visitTaskRepository,
IRepository<SCPStudy> _scpStudyRepository, IRepository<SCPStudy> _scpStudyRepository,
IRepository<FileUploadRecord> _fileUploadRecordRepository,
IRepository<Subject> _subjectRepository, IRepository<Subject> _subjectRepository,
IRepository<StudyMonitor> _studyMonitorRepository, IRepository<StudyMonitor> _studyMonitorRepository,
IRepository<SystemAnonymization> _systemAnonymizationRepository, IRepository<SystemAnonymization> _systemAnonymizationRepository,
@ -332,6 +333,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{ {
await _dicomInstanceRepository.SaveChangesAsync(); await _dicomInstanceRepository.SaveChangesAsync();
} }
await _fileUploadRecordRepository.BatchUpdateNoTrackingAsync(t => t.UploadBatchId == incommand.UploadBatchId, u => new FileUploadRecord() { StudyCode = findStudy.StudyCode });
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -27,6 +27,8 @@ public class FileUploadRecord : BaseFullAuditEntity
public Guid? NoneDicomStudyId { get; set; } public Guid? NoneDicomStudyId { get; set; }
public string StudyCode { get; set; }
[Comment("文件标识ID")] [Comment("文件标识ID")]
public string FileMarkId { get; set; } public string FileMarkId { get; set; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class addStudyCode : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "StudyCode",
table: "FileUploadRecord",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "StudyCode",
table: "FileUploadRecord");
}
}
}

View File

@ -3163,6 +3163,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("同步优先级"); .HasComment("同步优先级");
b.Property<string>("StudyCode")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid?>("SubjectId") b.Property<Guid?>("SubjectId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");