Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
49e372d11d
|
@ -1,5 +1,7 @@
|
|||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
@ -7,13 +9,16 @@ using Microsoft.AspNetCore.Http;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using MiniExcelLibs;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Image")]
|
||||
public class ReadingCalculateService(IEnumerable<ICriterionCalculateService> _criterionServices,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingImportFile> _readingImportFileRepository,
|
||||
IHttpContextAccessor httpContext,
|
||||
IOSSService oSSService,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IStringLocalizer _localizer, IUserInfo _userInfo
|
||||
|
||||
|
@ -53,6 +58,29 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var service = await this.GetService(visitTaskId);
|
||||
if (service != null)
|
||||
{
|
||||
var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||
|
||||
var streamCopy = new MemoryStream();
|
||||
// 将上传的文件内容复制到 MemoryStream
|
||||
await file.CopyToAsync(streamCopy);
|
||||
// 重置流的位置,以便后续读取
|
||||
streamCopy.Position = 0;
|
||||
var ossRelativePath = await oSSService.UploadToOSSAsync(streamCopy, $"{visitTaskInfo.TrialId.ToString()}/InspectionUpload/ReadingImport", file.FileName);
|
||||
|
||||
|
||||
await _readingImportFileRepository.AddAsync(new ReadingImportFile()
|
||||
{
|
||||
|
||||
FilePath = ossRelativePath,
|
||||
VisitTaskId = visitTaskId,
|
||||
TrialId = visitTaskInfo.TrialId,
|
||||
SubjectId = visitTaskInfo.SubjectId,
|
||||
SubjectVisitId = visitTaskInfo.SourceSubjectVisitId,
|
||||
TrialReadingCriterionId = visitTaskInfo.TrialReadingCriterionId,
|
||||
|
||||
});
|
||||
|
||||
|
||||
await service.ReadingImport();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("阅片导入表")]
|
||||
[Table("ReadingImportFile")]
|
||||
public class ReadingImportFile : BaseAddAuditEntity
|
||||
{
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public string FilePath { get; set; }=string.Empty;
|
||||
|
||||
}
|
|
@ -253,6 +253,43 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingImportFile)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
var basicData = item.Entity as SystemBasicData;
|
||||
extraIdentification = (basicData.ParentId == null ? "/parent" : string.Empty);
|
||||
|
||||
await InsertInspection<SystemBasicData>(item.Entity as SystemBasicData, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
ExtraIndentification = extraIdentification
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 阅片导入
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingImportFile)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as ReadingImportFile;
|
||||
|
||||
await InsertInspection<ReadingImportFile>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = entity.VisitTaskId,
|
||||
TrialReadingCriterionId=entity.TrialReadingCriterionId,
|
||||
SubjectVisitId= entity.SubjectVisitId,
|
||||
SubjectId=entity.SubjectId,
|
||||
TrialId = entity.TrialId,
|
||||
ObjectRelationParentId = entity.VisitTaskId,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
#region 已修改
|
||||
|
||||
#region 阅片单元配置
|
||||
|
|
|
@ -322,6 +322,8 @@ public class IRaCISDBContext : DbContext
|
|||
#region Reading
|
||||
public virtual DbSet<TrialCriterionDictionaryCode> TrialCriterionDictionaryCode { get; set; }
|
||||
|
||||
public virtual DbSet<ReadingImportFile> ReadingImportFile { get; set; }
|
||||
|
||||
public virtual DbSet<ReadingCustomTag> ReadingCustomTag { get; set; }
|
||||
public virtual DbSet<SystemCriterionDictionaryCode> SystemCriterionDictionaryCode { get; set; }
|
||||
public virtual DbSet<ReadingTaskRelation> ReadingTaskRelation { get; set; }
|
||||
|
|
19907
IRaCIS.Core.Infra.EFCore/Migrations/20250801093617_ReadingImport.Designer.cs
generated
Normal file
19907
IRaCIS.Core.Infra.EFCore/Migrations/20250801093617_ReadingImport.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ReadingImport : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ReadingImportFile",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TrialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SubjectId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
VisitTaskId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SubjectVisitId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
TrialReadingCriterionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FilePath = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ReadingImportFile", x => x.Id);
|
||||
|
||||
},
|
||||
comment: "阅片导入表");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ReadingImportFile_CreateUserId",
|
||||
table: "ReadingImportFile",
|
||||
column: "CreateUserId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ReadingImportFile");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4990,6 +4990,47 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ReadingImportFile", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("FilePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("TrialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("TrialReadingCriterionId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("VisitTaskId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.ToTable("ReadingImportFile", t =>
|
||||
{
|
||||
t.HasComment("阅片导出表");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ReadingJudgeInfo", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
@ -16338,6 +16379,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("VisitTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ReadingImportFile", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ReadingJudgeInfo", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
|
|
Loading…
Reference in New Issue