diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 70f8f2414..3e79fff0b 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -6872,6 +6872,11 @@ 答案分组 + + + 单位 + + 答案组合 diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs index 0e7c0e217..45d2f4a3a 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs @@ -32,11 +32,11 @@ namespace IRaCIS.Core.Application.Contracts [FromQuery, NotDefault] Guid subjectVisitId, [FromQuery] Guid? nonedicomStudyId, [FromQuery] bool isFilterZip, - [FromQuery] Guid? visiTaskId) + [FromQuery] Guid? visitTaskId) { IQueryable noneDicomStudyQueryable = default; - if (visiTaskId == null) + if (visitTaskId == null) { noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId) @@ -44,9 +44,9 @@ namespace IRaCIS.Core.Application.Contracts } else { - noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.TaskNoneDicomFileList.Any(t => t.VisitTaskId == visiTaskId)) + noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.TaskNoneDicomFileList.Any(t => t.VisitTaskId == visitTaskId)) .WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId) - .ProjectTo(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip, visiTaskId = visiTaskId }); + .ProjectTo(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip, visiTaskId = visitTaskId }); } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index e929e8702..0806e360d 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -599,8 +599,9 @@ namespace IRaCIS.Core.Application.Service Guid? visiTaskId = null; CreateMap() - .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.TaskNoneDicomFileList.WhereIf(visiTaskId!=null,t=>t.VisitTaskId==visiTaskId) - .Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.TaskNoneDicomFileList.WhereIf(visiTaskId != null, t => t.VisitTaskId == visiTaskId))) + .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? + s.TaskNoneDicomFileList.Where(t=> visiTaskId != null?t.VisitTaskId==visiTaskId:true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) + : s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true))) .ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode)); } diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs index c9d1ec42a..96b046415 100644 --- a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs @@ -18,6 +18,8 @@ public partial class IRCContext : DbContext public virtual DbSet TrialImageDownload { get; set; } + public virtual DbSet TestNew { get; set; } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseSqlServer("Server=106.14.89.110,1433;Database=IRC_Code;User ID=sa;Password=mssql_KnTs2a;TrustServerCertificate=true"); diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.Designer.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.Designer.cs new file mode 100644 index 000000000..b4dbb3787 --- /dev/null +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.Designer.cs @@ -0,0 +1,100 @@ +// +using System; +using IRaCIS.Core.Test.CodeFirstTest.MSSQL; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations +{ + [DbContext(typeof(IRCContext))] + [Migration("20240910053652_testAdd")] + partial class testAdd + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreateUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TestName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UpdateTime") + .HasColumnType("datetime2"); + + b.Property("UpdateUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("TestNew"); + }); + + modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreateUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DownloadEndTime") + .HasColumnType("datetime2"); + + b.Property("DownloadStartTime") + .HasColumnType("datetime2"); + + b.Property("ImageCount") + .HasColumnType("int"); + + b.Property("ImageSize") + .HasColumnType("bigint"); + + b.Property("ImageType") + .HasColumnType("int"); + + b.Property("IsSuccess") + .HasColumnType("bit"); + + b.Property("SubjectVisitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UpdateTime") + .HasColumnType("datetime2"); + + b.Property("UpdateUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("TrialImageDownload"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.cs new file mode 100644 index 000000000..e42fa119c --- /dev/null +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.cs @@ -0,0 +1,38 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations +{ + /// + public partial class testAdd : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "TestNew", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TestName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), + CreateTime = table.Column(type: "datetime2", nullable: false), + UpdateUserId = table.Column(type: "uniqueidentifier", nullable: false), + UpdateTime = table.Column(type: "datetime2", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TestNew", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "TestNew"); + } + } +} diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/IRCContextModelSnapshot.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/IRCContextModelSnapshot.cs new file mode 100644 index 000000000..7e8a390aa --- /dev/null +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/IRCContextModelSnapshot.cs @@ -0,0 +1,97 @@ +// +using System; +using IRaCIS.Core.Test.CodeFirstTest.MSSQL; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations +{ + [DbContext(typeof(IRCContext))] + partial class IRCContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreateUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TestName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UpdateTime") + .HasColumnType("datetime2"); + + b.Property("UpdateUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("TestNew"); + }); + + modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreateUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DownloadEndTime") + .HasColumnType("datetime2"); + + b.Property("DownloadStartTime") + .HasColumnType("datetime2"); + + b.Property("ImageCount") + .HasColumnType("int"); + + b.Property("ImageSize") + .HasColumnType("bigint"); + + b.Property("ImageType") + .HasColumnType("int"); + + b.Property("IsSuccess") + .HasColumnType("bit"); + + b.Property("SubjectVisitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UpdateTime") + .HasColumnType("datetime2"); + + b.Property("UpdateUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("TrialImageDownload"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs index 68da4fa79..5b27a47e1 100644 --- a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs @@ -1,6 +1,7 @@ using IRaCIS.Core.Domain.Models; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; @@ -34,6 +35,7 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL public class TestNew: BaseFullAuditEntity { + [StringLength(100)] public string TestName { get; set; } } } diff --git a/IRaCIS.Core.Test/Program.cs b/IRaCIS.Core.Test/Program.cs index ea6505eac..b2b5d4a75 100644 --- a/IRaCIS.Core.Test/Program.cs +++ b/IRaCIS.Core.Test/Program.cs @@ -58,7 +58,9 @@ partial class Program // 要生成的表名数组 var tableNames = new List(args); - if (args.Contains(".") || args.Contains("-")|| args.Contains("application")|| args.Contains("IR")) + var argsStr = args.ToString()??string.Empty; + + if (argsStr.Contains(".") || argsStr.Contains("-")|| argsStr.Contains("application")|| argsStr.Contains("IR")) { tableNames = new List(); }