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
bb5844a8e8
|
@ -15,15 +15,16 @@
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"regionId": "cn-shanghai",
|
"RegionId": "cn-shanghai",
|
||||||
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"AccessKeyId": "LTAI5tJV76pYX5yPg1N9QVE8",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"AccessKeySecret": "roRNLa9YG1of4pYruJGCNKBXEWTAWa",
|
||||||
"bucketName": "zy-irc-uat-store",
|
"BucketName": "zy-irc-test-store",
|
||||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
"RoleArn": "acs:ram::1899121822495495:role/webdirect",
|
||||||
"viewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
"ViewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
"region": "oss-cn-shanghai"
|
"Region": "oss-cn-shanghai",
|
||||||
|
"DurationSeconds": 7200
|
||||||
},
|
},
|
||||||
|
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
|
|
|
@ -1002,11 +1002,12 @@
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.VerifyIRStudyAllowUpload(IRaCIS.Core.Application.Contracts.TaskStudyAchivePreConfirmCommand)">
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.VerifyIRStudyAllowUpload(IRaCIS.Core.Application.Contracts.TaskStudyAchivePreConfirmCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy})">
|
||||||
<summary>
|
<summary>
|
||||||
在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入
|
在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入
|
||||||
</summary>
|
</summary>
|
||||||
<param name="inCommand"></param>
|
<param name="inCommand"></param>
|
||||||
|
<param name="_dicomStudyRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetIRUploadTaskNoneDicomStudyList(IRaCIS.Core.Application.Contracts.IRUploadStudyQuery)">
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetIRUploadTaskNoneDicomStudyList(IRaCIS.Core.Application.Contracts.IRUploadStudyQuery)">
|
||||||
|
@ -6871,6 +6872,11 @@
|
||||||
答案分组
|
答案分组
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.Unit">
|
||||||
|
<summary>
|
||||||
|
单位
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.AnswerCombination">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.AnswerCombination">
|
||||||
<summary>
|
<summary>
|
||||||
答案组合
|
答案组合
|
||||||
|
|
|
@ -256,18 +256,28 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
/// 在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入
|
/// 在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inCommand"></param>
|
/// <param name="inCommand"></param>
|
||||||
|
/// <param name="_dicomStudyRepository"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<TaskStudyArchiveConfirmResult>> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand)
|
public async Task<List<TaskStudyArchiveConfirmResult>> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand, [FromServices] IRepository<DicomStudy> _dicomStudyRepository)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var notAllowedUidList = _taskStudyRepository.Where(t => t.TrialId == inCommand.TrialId && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
|
var notAllowedUidList1 = _taskStudyRepository.Where(t => t.TrialId == inCommand.TrialId && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
|
||||||
{
|
{
|
||||||
t.StudyInstanceUid,
|
t.StudyInstanceUid,
|
||||||
t.SubjectId,
|
t.SubjectId,
|
||||||
SubejectCode = t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindSubjectCode : t.Subject.Code
|
SubejectCode = t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindSubjectCode : t.Subject.Code
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
var notAllowedUidList2 = _dicomStudyRepository.Where(t => t.TrialId == inCommand.TrialId && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
|
||||||
|
{
|
||||||
|
t.StudyInstanceUid,
|
||||||
|
t.SubjectId,
|
||||||
|
SubejectCode = t.Subject.Code
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
var notAllowedUidList = notAllowedUidList1.Union(notAllowedUidList2);
|
||||||
|
|
||||||
var result = new List<TaskStudyArchiveConfirmResult>();
|
var result = new List<TaskStudyArchiveConfirmResult>();
|
||||||
|
|
||||||
foreach (var studyUid in inCommand.StudyInstanceUidList)
|
foreach (var studyUid in inCommand.StudyInstanceUidList)
|
||||||
|
@ -275,6 +285,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
var findStudy = notAllowedUidList.Where(t => t.StudyInstanceUid == studyUid).FirstOrDefault();
|
var findStudy = notAllowedUidList.Where(t => t.StudyInstanceUid == studyUid).FirstOrDefault();
|
||||||
if (findStudy != null)
|
if (findStudy != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
//同一个subject 同一份影响
|
//同一个subject 同一份影响
|
||||||
if (findStudy.SubejectCode == inCommand.SubjectCode && findStudy.SubjectId == inCommand.SubjectId)
|
if (findStudy.SubejectCode == inCommand.SubjectCode && findStudy.SubjectId == inCommand.SubjectId)
|
||||||
{
|
{
|
||||||
|
@ -574,7 +585,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _noneDicomStudyFileReposiotry.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visitTaskId && t.NoneDicomStudyId == noneDicomStudyId);
|
await _noneDicomStudyFileReposiotry.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visitTaskId && t.OriginNoneDicomStudyId == noneDicomStudyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
@ -590,9 +601,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<TaskNoneDicomStudyDTO>> GetIRUploadTaskNoneDicomStudyList(IRUploadStudyQuery inQuery)
|
public async Task<List<TaskNoneDicomStudyDTO>> GetIRUploadTaskNoneDicomStudyList(IRUploadStudyQuery inQuery)
|
||||||
{
|
{
|
||||||
|
var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||||
|
.Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstNotNullAsync();
|
||||||
|
|
||||||
var query = from u in _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
var query = from u in _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||||
join ns in _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId) on u.SourceSubjectVisitId equals ns.SubjectVisitId
|
join ns in _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId).WhereIf(info.IsImageFilter,t=> ("|" + info.CriterionModalitys + "|").Contains("|" + t.Modality + "|"))
|
||||||
|
on u.SourceSubjectVisitId equals ns.SubjectVisitId
|
||||||
|
|
||||||
select new TaskNoneDicomStudyDTO()
|
select new TaskNoneDicomStudyDTO()
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,11 +32,11 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
[FromQuery, NotDefault] Guid subjectVisitId,
|
[FromQuery, NotDefault] Guid subjectVisitId,
|
||||||
[FromQuery] Guid? nonedicomStudyId,
|
[FromQuery] Guid? nonedicomStudyId,
|
||||||
[FromQuery] bool isFilterZip,
|
[FromQuery] bool isFilterZip,
|
||||||
[FromQuery] Guid? visiTaskId)
|
[FromQuery] Guid? visitTaskId)
|
||||||
{
|
{
|
||||||
|
|
||||||
IQueryable<NoneDicomStudyView> noneDicomStudyQueryable = default;
|
IQueryable<NoneDicomStudyView> noneDicomStudyQueryable = default;
|
||||||
if (visiTaskId == null)
|
if (visitTaskId == null)
|
||||||
{
|
{
|
||||||
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
|
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
else
|
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)
|
.WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
|
||||||
.ProjectTo<TaskDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip, visiTaskId = visiTaskId });
|
.ProjectTo<TaskDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip, visiTaskId = visitTaskId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -599,8 +599,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
Guid? visiTaskId = null;
|
Guid? visiTaskId = null;
|
||||||
CreateMap<NoneDicomStudy, TaskDicomStudyView>()
|
CreateMap<NoneDicomStudy, TaskDicomStudyView>()
|
||||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.TaskNoneDicomFileList.WhereIf(visiTaskId!=null,t=>t.VisitTaskId==visiTaskId)
|
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ?
|
||||||
.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.TaskNoneDicomFileList.WhereIf(visiTaskId != null, t => t.VisitTaskId == visiTaskId)))
|
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));
|
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,10 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
{
|
{
|
||||||
public class SubjectVisitConfigration : IEntityTypeConfiguration<SubjectVisit>
|
public class SubjectVisitConfigration : IEntityTypeConfiguration<SubjectVisit>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public void Configure(EntityTypeBuilder<SubjectVisit> builder)
|
public void Configure(EntityTypeBuilder<SubjectVisit> builder)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
builder.HasOne(s => s.Subject).WithMany(sv => sv.SubjectVisitList);
|
builder.HasOne(s => s.Subject).WithMany(sv => sv.SubjectVisitList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|
||||||
{
|
|
||||||
public class TrialDocUserTypeConfirmConfigration : IEntityTypeConfiguration<TrialDocNeedConfirmedUserType>
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public void Configure(EntityTypeBuilder<TrialDocNeedConfirmedUserType> builder)
|
|
||||||
{
|
|
||||||
////项目文档 需要确认的用户类型 找到项目下对应用户类型的用户 用UserTypeId 关联
|
|
||||||
//builder
|
|
||||||
// .HasMany(dd => dd.TrialUserList)
|
|
||||||
// .WithOne(d => d.TrialDocNeedConfirmedUserType)
|
|
||||||
// .HasForeignKey(s => new {/* s.TrialId,*/ s.User.UserTypeId })
|
|
||||||
// .HasPrincipalKey(c => new { /*c.TrialDocument.TrialId,*/ c.NeedConfirmUserTypeId });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TrialDocConfirmUserConfigration : IEntityTypeConfiguration<TrialDocConfirmedUser>
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public void Configure(EntityTypeBuilder<TrialDocConfirmedUser> builder)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//builder
|
|
||||||
// .HasOne(dd => dd.TrialUser)
|
|
||||||
// .WithMany(d => d.TrialDocUserConfirmedList)
|
|
||||||
// .HasForeignKey(s => new { s.TrialDocument.TrialId, s.ConfirmUserId })
|
|
||||||
// .HasPrincipalKey(c => new { c.TrialId, c.UserId });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,16 +5,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
{
|
{
|
||||||
public class TrialSiteConfigration : IEntityTypeConfiguration<TrialSite>
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public void Configure(EntityTypeBuilder<TrialSite> builder)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SubjectCriteriaEvaluationConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluation>
|
public class SubjectCriteriaEvaluationConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluation>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|
||||||
{
|
|
||||||
public class TrialSiteSurveyConfigration : IEntityTypeConfiguration<TrialSiteSurvey>
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public void Configure(EntityTypeBuilder<TrialSiteSurvey> builder)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
#参考学习文档
|
||||||
|
https://www.cnblogs.com/cqpanda/p/16815263.html
|
||||||
|
|
||||||
|
# 如果不想指定项目名称,需要进入项目目录 一般pwershell进入的是项目根目录,需要命令指定项目
|
||||||
|
cd .\IRaCIS.Core.Test
|
||||||
|
|
||||||
|
# 该目录下如果有多个上下文,需要手动指定
|
||||||
|
|
||||||
|
# dotnet ef migrations add 签名名字 -p 项目名 -c 上下文名 -o 迁移文件生成目录
|
||||||
|
|
||||||
|
dotnet ef migrations add Initial -p IRaCIS.Core.Test -c IRCContext -o CodeFirstTest/MSSQL/Migrations
|
||||||
|
|
||||||
|
dotnet ef database update -p IRaCIS.Core.Test -c IRCContext
|
|
@ -0,0 +1,35 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||||
|
|
||||||
|
public partial class IRCContext : DbContext
|
||||||
|
{
|
||||||
|
public IRCContext()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IRCContext(DbContextOptions<IRCContext> options)
|
||||||
|
: base(options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<TrialImageDownload> TrialImageDownload { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<TestNew> 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");
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
}
|
100
IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.Designer.cs
generated
Normal file
100
IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910053652_testAdd.Designer.cs
generated
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
// <auto-generated />
|
||||||
|
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
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
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<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("TestName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("TestNew");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DownloadEndTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DownloadStartTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("ImageCount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<long>("ImageSize")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<int>("ImageType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsSuccess")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<Guid>("SubjectVisitId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("TrialImageDownload");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class testAdd : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "TestNew",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
TestName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||||
|
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_TestNew", x => x.Id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "TestNew");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
119
IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910055957_navigateTest.Designer.cs
generated
Normal file
119
IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240910055957_navigateTest.Designer.cs
generated
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
// <auto-generated />
|
||||||
|
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("20240910055957_navigateTest")]
|
||||||
|
partial class navigateTest
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
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<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("TestName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<Guid>("TrialImageDownloadId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("TrialImageDownloadId");
|
||||||
|
|
||||||
|
b.ToTable("TestNew");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DownloadEndTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DownloadStartTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("ImageCount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<long>("ImageSize")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<int>("ImageType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsSuccess")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<Guid>("SubjectVisitId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("TrialImageDownload");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||||
|
.WithMany("TestNewList")
|
||||||
|
.HasForeignKey("TrialImageDownloadId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("TestNewList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class navigateTest : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "TrialImageDownloadId",
|
||||||
|
table: "TestNew",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TestNew_TrialImageDownloadId",
|
||||||
|
table: "TestNew",
|
||||||
|
column: "TrialImageDownloadId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_TestNew_TrialImageDownload_TrialImageDownloadId",
|
||||||
|
table: "TestNew",
|
||||||
|
column: "TrialImageDownloadId",
|
||||||
|
principalTable: "TrialImageDownload",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_TestNew_TrialImageDownload_TrialImageDownloadId",
|
||||||
|
table: "TestNew");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_TestNew_TrialImageDownloadId",
|
||||||
|
table: "TestNew");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "TrialImageDownloadId",
|
||||||
|
table: "TestNew");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
// <auto-generated />
|
||||||
|
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<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("TestName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)");
|
||||||
|
|
||||||
|
b.Property<Guid>("TrialImageDownloadId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("TrialImageDownloadId");
|
||||||
|
|
||||||
|
b.ToTable("TestNew");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DownloadEndTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DownloadStartTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("ImageCount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<long>("ImageSize")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<int>("ImageType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("IsSuccess")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<Guid>("SubjectVisitId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("TrialImageDownload");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||||
|
.WithMany("TestNewList")
|
||||||
|
.HasForeignKey("TrialImageDownloadId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("TestNewList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
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;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||||
|
{
|
||||||
|
|
||||||
|
[Table("TrialImageDownload")]
|
||||||
|
public class TrialImageDownload : BaseFullAuditEntity
|
||||||
|
{
|
||||||
|
public Guid SubjectVisitId { get; set; }
|
||||||
|
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
|
||||||
|
public DateTime DownloadStartTime { get; set; }
|
||||||
|
public DateTime? DownloadEndTime { get; set; }
|
||||||
|
|
||||||
|
public ImageType ImageType { get; set; }
|
||||||
|
|
||||||
|
public int ImageCount { get; set; }
|
||||||
|
|
||||||
|
public long ImageSize { get; set; }
|
||||||
|
|
||||||
|
#region 测试导航属性
|
||||||
|
|
||||||
|
public List<TestNew> TestNewList { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ImageType
|
||||||
|
{
|
||||||
|
Dicom = 1,
|
||||||
|
NoneDIcom = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
public class TestNew : BaseFullAuditEntity
|
||||||
|
{
|
||||||
|
public Guid TrialImageDownloadId { get; set; }
|
||||||
|
|
||||||
|
[StringLength(100)]
|
||||||
|
public string TestName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class Subject: BaseFullAuditEntity
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SubejectVisit: BaseFullAuditEntity
|
||||||
|
{
|
||||||
|
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
|
||||||
partial class Program
|
partial class Program
|
||||||
{
|
{
|
||||||
|
@ -55,7 +56,15 @@ partial class Program
|
||||||
|
|
||||||
|
|
||||||
// 要生成的表名数组
|
// 要生成的表名数组
|
||||||
var tableNames = new List<string>(args);
|
var tableNames = new List<string>(args);
|
||||||
|
|
||||||
|
var argsStr = args.ToString()??string.Empty;
|
||||||
|
|
||||||
|
if (argsStr.Contains(".") || argsStr.Contains("-")|| argsStr.Contains("application")|| argsStr.Contains("IR"))
|
||||||
|
{
|
||||||
|
tableNames = new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue