diff --git a/IRaCIS.Core.API/appsettings.Uat_IRC.json b/IRaCIS.Core.API/appsettings.Uat_IRC.json index 18d24b8ce..00bcdcae1 100644 --- a/IRaCIS.Core.API/appsettings.Uat_IRC.json +++ b/IRaCIS.Core.API/appsettings.Uat_IRC.json @@ -15,15 +15,16 @@ "ObjectStoreUse": "AliyunOSS", "AliyunOSS": { - "regionId": "cn-shanghai", - "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", - "endpoint": "https://oss-cn-shanghai.aliyuncs.com", - "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", - "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", - "bucketName": "zy-irc-uat-store", - "roleArn": "acs:ram::1899121822495495:role/oss-upload", - "viewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com", - "region": "oss-cn-shanghai" + "RegionId": "cn-shanghai", + "InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", + "EndPoint": "https://oss-cn-shanghai.aliyuncs.com", + "AccessKeyId": "LTAI5tJV76pYX5yPg1N9QVE8", + "AccessKeySecret": "roRNLa9YG1of4pYruJGCNKBXEWTAWa", + "BucketName": "zy-irc-test-store", + "RoleArn": "acs:ram::1899121822495495:role/webdirect", + "ViewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com", + "Region": "oss-cn-shanghai", + "DurationSeconds": 7200 }, "MinIO": { diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 46c1ecdf5..70f8f2414 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1002,11 +1002,12 @@ - + 在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入 + diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index b59a3e043..0b0374d56 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -256,18 +256,28 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc /// 在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入 /// /// + /// /// - public async Task> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand) + public async Task> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand, [FromServices] IRepository _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.SubjectId, SubejectCode = t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindSubjectCode : t.Subject.Code }).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(); 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(); if (findStudy != null) { + //同一个subject 同一份影响 if (findStudy.SubejectCode == inCommand.SubjectCode && findStudy.SubjectId == inCommand.SubjectId) { diff --git a/IRaCIS.Core.Test/CodeFirstTest/CodeFirst使用说明 b/IRaCIS.Core.Test/CodeFirstTest/CodeFirst使用说明 new file mode 100644 index 000000000..93f496abe --- /dev/null +++ b/IRaCIS.Core.Test/CodeFirstTest/CodeFirst使用说明 @@ -0,0 +1,10 @@ + +#οѧϰĵ +https://www.cnblogs.com/cqpanda/p/16815263.html + +# ָĿƣҪĿĿ¼ һpwershellĿĿ¼ҪָĿ + cd .\IRaCIS.Core.Test + + # Ŀ¼жģҪֶָ + + dotnet ef migrations add Initial -p IRaCIS.Core.Test -c IRCContext -o CodeFirstTest/MSSQL/Migrations \ No newline at end of file diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs new file mode 100644 index 000000000..c9d1ec42a --- /dev/null +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/IRCContext.cs @@ -0,0 +1,33 @@ +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 options) + : base(options) + { + } + + public virtual DbSet TrialImageDownload { 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); +} diff --git a/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs new file mode 100644 index 000000000..68da4fa79 --- /dev/null +++ b/IRaCIS.Core.Test/CodeFirstTest/MSSQL/TrialImageDownload.cs @@ -0,0 +1,39 @@ +using IRaCIS.Core.Domain.Models; +using System; +using System.Collections.Generic; +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; } + } + + public enum ImageType + { + Dicom = 1, + NoneDIcom = 2 + }; + + public class TestNew: BaseFullAuditEntity + { + public string TestName { get; set; } + } +} diff --git a/IRaCIS.Core.Test/CodeFirstTest/PGContext.cs b/IRaCIS.Core.Test/CodeFirstTest/PGSQL/PGContext.cs similarity index 100% rename from IRaCIS.Core.Test/CodeFirstTest/PGContext.cs rename to IRaCIS.Core.Test/CodeFirstTest/PGSQL/PGContext.cs diff --git a/IRaCIS.Core.Test/CodeFirstTest/Subject.cs b/IRaCIS.Core.Test/CodeFirstTest/PGSQL/Subject.cs similarity index 100% rename from IRaCIS.Core.Test/CodeFirstTest/Subject.cs rename to IRaCIS.Core.Test/CodeFirstTest/PGSQL/Subject.cs diff --git a/IRaCIS.Core.Test/Program.cs b/IRaCIS.Core.Test/Program.cs index 90e84d66e..ea6505eac 100644 --- a/IRaCIS.Core.Test/Program.cs +++ b/IRaCIS.Core.Test/Program.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using static System.Net.Mime.MediaTypeNames; partial class Program { @@ -55,7 +56,13 @@ partial class Program // 要生成的表名数组 - var tableNames = new List(args); + var tableNames = new List(args); + + if (args.Contains(".") || args.Contains("-")|| args.Contains("application")|| args.Contains("IR")) + { + tableNames = new List(); + } + try {