From 36acbc1df8aa1a1cb845d9ea0d4d4a388b9fcd13 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Tue, 10 Sep 2024 13:50:35 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E5=90=8D?=
=?UTF-8?q?=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 5 +
.../ImageAndDoc/NoneDicomStudyService.cs | 8 +-
.../Service/QC/_MapConfig.cs | 5 +-
.../CodeFirstTest/MSSQL/IRCContext.cs | 2 +
.../20240910053652_testAdd.Designer.cs | 100 ++++++++++++++++++
.../Migrations/20240910053652_testAdd.cs | 38 +++++++
.../Migrations/IRCContextModelSnapshot.cs | 97 +++++++++++++++++
.../CodeFirstTest/MSSQL/TrialImageDownload.cs | 2 +
IRaCIS.Core.Test/Program.cs | 4 +-
9 files changed, 254 insertions(+), 7 deletions(-)
create mode 100644 IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.Designer.cs
create mode 100644 IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.cs
create mode 100644 IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/IRCContextModelSnapshot.cs
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();
}