From 084b3d8822dfed03446e10233557475f48ba5a1b Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Wed, 4 Sep 2024 15:58:28 +0800
Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Test/IRaCIS.Core.Test.csproj | 4 ++++
IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
index a43f6707d..e48a7b472 100644
--- a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
+++ b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
@@ -67,4 +67,8 @@
+
+
+
+
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt
index 99090292f..aa45fe94b 100644
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt
+++ b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt
@@ -39,17 +39,18 @@ using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;
+using Microsoft.EntityFrameworkCore;
namespace IRaCIS.Core.Domain.Models
{
- [Description("ע: <#=tableName#>")]
+ [Comment("<#=tableName#>")]
[Table("<#=tableName#>")]
public class <#=tableName#> : BaseFullAuditEntity
{
<# var excludedColumns = new[] { "CreateUserId", "Id", "UpdateUserId", "CreateTime", "UpdateTime", "DeleteUserId", "IsDeleted", "DeletedTime" };#>
<# foreach(DbColumn column in DbHelper.GetDbColumns(config.ConnectionString, config.DbDatabase, tableName)){ #>
<# if (!excludedColumns.Contains(column.ColumnName)){ #>
- [Description("<#= column.Remark == "" ? "" : column.Remark.Replace("\r\n"," ") #>")]
+ [Comment("<#= column.Remark == "" ? "" : column.Remark.Replace("\r\n"," ") #>")]
public <#= column.CSharpType#><# if(column.CommonType.IsValueType && column.IsNullable){#>?<#}#> <#=column.ColumnName#> { get; set; }
<#}#>
<#}#>
From 2ffd1a2520c06a47deb77bd02bd735e3d9cc82b7 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Wed, 4 Sep 2024 16:05:13 +0800
Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=8F=E5=88=97?=
=?UTF-8?q?=E5=8C=96=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs
index 1ff61ed04..40e97d11b 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs
@@ -86,7 +86,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
- public List DicomStudyList { get; set; }
+ public List DicomStudyList { get; set; }=new List();
public List NoneDicomStudyList { get; set; }
}
From bfe537920683c8b639dddd15991732163a5dcbaa Mon Sep 17 00:00:00 2001
From: hang <87227557@qq.com>
Date: Wed, 4 Sep 2024 23:21:22 +0800
Subject: [PATCH 03/10] =?UTF-8?q?=E6=96=B0=E7=9A=84=E7=94=9F=E6=88=90?=
=?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=BC=95=E6=93=8E=E5=BC=95=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Test/IRaCIS.Core.Test.csproj | 12 +-
IRaCIS.Core.Test/Program.cs | 124 ++++++++++++++++++
.../Template/EntityService.liquid | 69 ++++++++++
.../Template/IEntityService.liquid | 25 ++++
4 files changed, 229 insertions(+), 1 deletion(-)
create mode 100644 IRaCIS.Core.Test/Program.cs
create mode 100644 IRaCIS.Core.Test/Template/EntityService.liquid
create mode 100644 IRaCIS.Core.Test/Template/IEntityService.liquid
diff --git a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
index e48a7b472..7941a8ebe 100644
--- a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
+++ b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
@@ -6,15 +6,23 @@
false
default
+
+ Exe
- ..\bin
+ bin
+
+ Always
+
+
+ Always
+
IRaCIS .Core.ServiceAsync.cs
TextTemplatingFileGenerator
@@ -65,9 +73,11 @@
+
+
diff --git a/IRaCIS.Core.Test/Program.cs b/IRaCIS.Core.Test/Program.cs
new file mode 100644
index 000000000..fcbfbce59
--- /dev/null
+++ b/IRaCIS.Core.Test/Program.cs
@@ -0,0 +1,124 @@
+
+using Fluid;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+partial class Program
+{
+ static void Main()
+ {
+ //发布的目录和项目的目录有区别的
+ var rootPath = AppContext.BaseDirectory.Replace(@"\bin\net8.0\", "").Replace(@"\bin\Release\net8.0\", "");
+
+ var templateFolderPath = Path.Combine(rootPath, "Template");
+ var outPutTemplateFolderPath = Path.Combine(rootPath, "TemplateOutPut");
+
+ #region 生成文件目录准备
+ if (!Directory.Exists(outPutTemplateFolderPath))
+ {
+ Directory.CreateDirectory(outPutTemplateFolderPath);
+ }
+ var servicePath = Path.Combine(outPutTemplateFolderPath, "Service");
+ var iServicePath = Path.Combine(outPutTemplateFolderPath, "IService");
+ var entityPath = Path.Combine(outPutTemplateFolderPath, "Entity");
+ var dtoPath = Path.Combine(outPutTemplateFolderPath, "DTO");
+
+ if (!Directory.Exists(servicePath))
+ {
+ Directory.CreateDirectory(servicePath);
+ }
+ if (!Directory.Exists(iServicePath))
+ {
+ Directory.CreateDirectory(iServicePath);
+ }
+ if (!Directory.Exists(entityPath))
+ {
+ Directory.CreateDirectory(entityPath);
+ }
+ if (!Directory.Exists(dtoPath))
+ {
+ Directory.CreateDirectory(dtoPath);
+ }
+ #endregion
+
+
+ // 要生成的表名数组
+ var tableNames = new List { "User", "Product", "Order" };
+
+ try
+ {
+ //便利所有模板文件进行生成操作
+ foreach (var templateFilePath in Directory.GetFiles(templateFolderPath))
+ {
+
+ var fileName=Path.GetFileNameWithoutExtension(templateFilePath);
+
+ foreach (var tableName in tableNames)
+ {
+ var model = new TemplateModel
+ {
+ TableName = tableName,
+
+ IsPaged = true
+ };
+
+
+ var parser = new FluidParser();
+
+ var source = File.ReadAllText(templateFilePath);
+
+ if (parser.TryParse(source, out var template, out var error))
+ {
+ var context = new TemplateContext(model);
+
+ //Console.WriteLine(template.Render(context));
+
+ string outputFilePath = Path.Combine(outPutTemplateFolderPath, $"{fileName.Replace("Entity", tableName)}.cs");
+
+ File.WriteAllText(outputFilePath, template.Render(context));
+ }
+ else
+ {
+ Console.WriteLine($"Error: {error}");
+ }
+
+
+
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+
+ Console.WriteLine($"Error: {ex.Message}");
+ }
+
+
+ }
+
+ // Model class to pass data to the template
+ public class TemplateModel
+ {
+ public string TableName { get; set; }
+
+ //生成的列表是是分页 还是不分页
+ public bool IsPaged { get; set; }
+
+ // 列表视图模型名称
+ public string TableNameView => TableName + "View";
+ //列表查询模型名称
+ public string TableNameQuery => TableName + "Query";
+ //添加和编辑模型名称
+ public string TableNameAddOrEdit => TableName + "AddOrEdit";
+ //删除主键属性名
+ public string LowercaseTableNameId => char.ToLower(TableName[0]) + TableName.Substring(1) + "Id";
+
+ public string LowercaseRepositoryName => $"_{char.ToLower(TableName[0]) + TableName.Substring(1)}Repository" ;
+
+ public string LowercaseQueryableName => $"{char.ToLower(TableName[0]) + TableName.Substring(1)}Queryable";
+
+ public DateTime DateTimeNow = DateTime.Now;
+ }
+}
diff --git a/IRaCIS.Core.Test/Template/EntityService.liquid b/IRaCIS.Core.Test/Template/EntityService.liquid
new file mode 100644
index 000000000..f0bce2e1f
--- /dev/null
+++ b/IRaCIS.Core.Test/Template/EntityService.liquid
@@ -0,0 +1,69 @@
+
+//--------------------------------------------------------------------
+// 此代码由模板自动生成 byzhouhang 20210918
+// 生成时间 {{DateTimeNow}}
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+//--------------------------------------------------------------------
+using IRaCIS.Core.Domain.Models;
+using Microsoft.AspNetCore.Mvc;
+using IRaCIS.Core.Application.Interfaces;
+using IRaCIS.Core.Application.ViewModel;
+namespace IRaCIS.Core.Application.Service
+{
+
+ [ ApiExplorerSettings(GroupName = "Test")]
+ public class {{TableName}}Service(IRepository<{{TableName}}> {{LowercaseRepositoryName}}): BaseService, I{{TableName}}Service
+ {
+
+ {% if IsPaged %}
+ [HttpPost]
+ public async Task> Get{{TableName}}List({{TableNameQuery}} inQuery)
+ {
+
+ var {{LowercaseQueryableName}} ={{LowercaseRepositoryName}}
+ .ProjectTo<{{TableNameView}}>(_mapper.ConfigurationProvider);
+
+ var pageList= await {{LowercaseQueryableName}}.ToPagedListAsync(inQuery);
+
+ return pageList;
+ }
+ {% else %}
+ [HttpPost]
+ public async Task> Get{{TableName}}List({{TableNameQuery}} inQuery)
+ {
+
+
+ var {{LowercaseQueryableName}} ={{LowercaseRepositoryName}}
+ .ProjectTo<{{TableNameView}}>(_mapper.ConfigurationProvider);
+
+ return await {{LowercaseQueryableName}}.ToListAsync();
+ }
+ {% endif %}
+
+
+ public async Task AddOrUpdate{{TableName}}({{TableName}}AddOrEdit addOrEdit{{TableName}})
+ {
+ // 在此处拷贝automapper 映射
+
+ CreateMap<{{TableName}}, {{TableNameView}}>();
+ CreateMap<{{TableName}},{{TableNameAddOrEdit}}>().ReverseMap();
+
+
+ var entity = await {{LowercaseRepositoryName}}.InsertOrUpdateAsync(addOrEdit{{TableName}}, true);
+
+ return ResponseOutput.Ok(entity.Id.ToString());
+
+ }
+
+
+ [HttpDelete("{{ '{' }}{{LowercaseTableNameId}}:guid{{ '}' }}")]
+ public async Task Delete{{TableName}}(Guid {{LowercaseTableNameId}})
+ {
+ var success = await _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository.DeleteFromQueryAsync(t => t.Id == {{LowercaseTableNameId}},true);
+ return ResponseOutput.Ok();
+ }
+
+
+ }
+}
+
diff --git a/IRaCIS.Core.Test/Template/IEntityService.liquid b/IRaCIS.Core.Test/Template/IEntityService.liquid
new file mode 100644
index 000000000..37c1016f9
--- /dev/null
+++ b/IRaCIS.Core.Test/Template/IEntityService.liquid
@@ -0,0 +1,25 @@
+
+//--------------------------------------------------------------------
+// 此代码由模板自动生成 byzhouhang 20210918
+// 生成时间 {{DateTimeNow}}
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+//--------------------------------------------------------------------
+using IRaCIS.Core.Application.ViewModel;
+namespace IRaCIS.Core.Application.Interfaces
+ {
+
+ public interface I{{TableName}}Service
+ {
+
+ {% if IsPaged %}
+ Task> Get{{TableName}}List({{TableNameQuery}} inQuery);
+ {% else %}
+ Task> Get{{TableName}}List({{TableNameQuery}} inQuery);
+ {% endif %}
+
+ Task AddOrUpdate{{TableName}}({{TableNameAddOrEdit}} addOrEdit{{TableName}});
+
+ Task Delete{{TableNameView}}(Guid {{LowercaseTableNameId}});
+ }
+}
+
From 706cb888c89d92beba3d7e6ad18b8032418b602e Mon Sep 17 00:00:00 2001
From: hang <87227557@qq.com>
Date: Wed, 4 Sep 2024 23:36:19 +0800
Subject: [PATCH 04/10] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=94=BE=E5=85=A5=E7=9A=84=E7=9B=AE=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Test/IRaCIS.Core.Test.csproj | 4 ++++
IRaCIS.Core.Test/Program.cs | 5 ++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
index 7941a8ebe..fc8d2d1ec 100644
--- a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
+++ b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
@@ -74,6 +74,10 @@
+
+
+
+
diff --git a/IRaCIS.Core.Test/Program.cs b/IRaCIS.Core.Test/Program.cs
index fcbfbce59..5c692dbac 100644
--- a/IRaCIS.Core.Test/Program.cs
+++ b/IRaCIS.Core.Test/Program.cs
@@ -55,6 +55,9 @@ partial class Program
var fileName=Path.GetFileNameWithoutExtension(templateFilePath);
+ //模板放入具体的文件夹
+ var folder = fileName == "Entity" ? "Entity" : fileName.Replace("Entity", "");
+
foreach (var tableName in tableNames)
{
var model = new TemplateModel
@@ -75,7 +78,7 @@ partial class Program
//Console.WriteLine(template.Render(context));
- string outputFilePath = Path.Combine(outPutTemplateFolderPath, $"{fileName.Replace("Entity", tableName)}.cs");
+ string outputFilePath = Path.Combine(outPutTemplateFolderPath, folder, $"{fileName.Replace("Entity", tableName)}.cs");
File.WriteAllText(outputFilePath, template.Render(context));
}
From dd13eddfe3bc22e43c1c5e82b7ac7d647f5205e1 Mon Sep 17 00:00:00 2001
From: hang <87227557@qq.com>
Date: Thu, 5 Sep 2024 00:04:41 +0800
Subject: [PATCH 05/10] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E5=BA=93=E4=B8=8A=E4=B8=8B=E6=96=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Test/IRaCIS.Core.Test.csproj | 2 ++
IRaCIS.Core.Test/Program.cs | 22 ++++++++++++++++++++++
IRaCIS.Core.Test/Template/YourDbContext.cs | 20 ++++++++++++++++++++
3 files changed, 44 insertions(+)
create mode 100644 IRaCIS.Core.Test/Template/YourDbContext.cs
diff --git a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
index fc8d2d1ec..b00d3c836 100644
--- a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
+++ b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
@@ -82,7 +82,9 @@
+
+
diff --git a/IRaCIS.Core.Test/Program.cs b/IRaCIS.Core.Test/Program.cs
index 5c692dbac..0481b1089 100644
--- a/IRaCIS.Core.Test/Program.cs
+++ b/IRaCIS.Core.Test/Program.cs
@@ -1,5 +1,8 @@
using Fluid;
+using IRaCIS.Core.Test.Template;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.IO;
@@ -42,6 +45,25 @@ partial class Program
Directory.CreateDirectory(dtoPath);
}
#endregion
+ using (var context = new YourDbContext())
+ {
+ var model = context.Model;
+
+ foreach (var entityType in model.GetEntityTypes())
+ {
+ string tableName = entityType.GetTableName();
+ Console.WriteLine($"Table: {tableName}");
+
+ foreach (var property in entityType.GetProperties())
+ {
+ string columnName = property.GetColumnName();
+ string dataType = property.ClrType.Name;
+ bool isNullable = property.IsNullable;
+
+ Console.WriteLine($" Column: {columnName}, Data Type: {dataType}, Is Nullable: {isNullable}");
+ }
+ }
+ }
// 要生成的表名数组
diff --git a/IRaCIS.Core.Test/Template/YourDbContext.cs b/IRaCIS.Core.Test/Template/YourDbContext.cs
new file mode 100644
index 000000000..09593fc25
--- /dev/null
+++ b/IRaCIS.Core.Test/Template/YourDbContext.cs
@@ -0,0 +1,20 @@
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IRaCIS.Core.Test.Template
+{
+ class YourDbContext : DbContext
+ {
+
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ optionsBuilder.UseSqlServer("Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true");
+ }
+
+ }
+}
From e4c3521b047e57d377b00c9c13f55080fdc2969a Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 5 Sep 2024 09:27:04 +0800
Subject: [PATCH 06/10] =?UTF-8?q?mfa=20=E7=99=BB=E5=BD=95=E9=80=BB?=
=?UTF-8?q?=E8=BE=91=E9=81=97=E6=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.API/Controllers/ExtraController.cs | 16 +++++++++++++---
IRaCIS.Core.Test/Program.cs | 1 +
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs
index bb8be2517..413e546e4 100644
--- a/IRaCIS.Core.API/Controllers/ExtraController.cs
+++ b/IRaCIS.Core.API/Controllers/ExtraController.cs
@@ -221,9 +221,9 @@ namespace IRaCIS.Api.Controllers
if (_verifyConfig.CurrentValue.OpenLoginMFA)
{
- //发版屏蔽
+
- //returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
+
//MFA 发送邮件
@@ -235,7 +235,17 @@ namespace IRaCIS.Api.Controllers
returnModel.Data.BasicInfo.EMail = hiddenEmail;
- await _userService.SendMFAEmail(userId);
+ //修改密码
+ if (returnModel.Data.BasicInfo.IsFirstAdd)
+ {
+ returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
+ }
+ else
+ {
+ //正常登录才发送邮件
+ await _userService.SendMFAEmail(userId);
+
+ }
}
else
diff --git a/IRaCIS.Core.Test/Program.cs b/IRaCIS.Core.Test/Program.cs
index 0481b1089..533ca55fa 100644
--- a/IRaCIS.Core.Test/Program.cs
+++ b/IRaCIS.Core.Test/Program.cs
@@ -45,6 +45,7 @@ partial class Program
Directory.CreateDirectory(dtoPath);
}
#endregion
+
using (var context = new YourDbContext())
{
var model = context.Model;
From 006a5729d6eb4202464e62bf05808c1ba5efda19 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 5 Sep 2024 09:58:25 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=BE=8E=E5=9B=BD?=
=?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E6=96=87?=
=?UTF-8?q?=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRC.Core.SCP/appsettings.Prod_IRC_SCP.json | 8 -----
IRC.Core.SCP/appsettings.Test_IRC_SCP.json | 29 ++-------------
IRC.Core.SCP/appsettings.US_Uat_SCP.json | 31 ++++++++++++++++
IRC.Core.SCP/appsettings.Uat_IRC_SCP.json | 37 ++------------------
IRaCIS.Core.API/appsettings.US_Prod_IRC.json | 5 +++
IRaCIS.Core.API/appsettings.US_Test_IRC.json | 5 +++
IRaCIS.Core.API/appsettings.US_Uat_IRC.json | 5 +++
7 files changed, 50 insertions(+), 70 deletions(-)
create mode 100644 IRC.Core.SCP/appsettings.US_Uat_SCP.json
diff --git a/IRC.Core.SCP/appsettings.Prod_IRC_SCP.json b/IRC.Core.SCP/appsettings.Prod_IRC_SCP.json
index 44af0926a..218d5a2c8 100644
--- a/IRC.Core.SCP/appsettings.Prod_IRC_SCP.json
+++ b/IRC.Core.SCP/appsettings.Prod_IRC_SCP.json
@@ -18,14 +18,6 @@
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
"viewEndpoint": "https://zy-irc-cache.oss-cn-shanghai.aliyuncs.com",
"region": "oss-cn-shanghai"
- },
- "MinIO": {
- "endpoint": "http://192.168.3.68",
- "port": "8001",
- "useSSL": false,
- "accessKey": "IDFkwEpWej0b4DtiuThL",
- "secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
- "bucketName": "test"
}
},
diff --git a/IRC.Core.SCP/appsettings.Test_IRC_SCP.json b/IRC.Core.SCP/appsettings.Test_IRC_SCP.json
index 4122b7ecf..077a9194a 100644
--- a/IRC.Core.SCP/appsettings.Test_IRC_SCP.json
+++ b/IRC.Core.SCP/appsettings.Test_IRC_SCP.json
@@ -44,37 +44,12 @@
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
},
- "BasicSystemConfig": {
- "OpenUserComplexPassword": false,
-
- "OpenSignDocumentBeforeWork": false,
-
- "OpenTrialRelationDelete": true,
-
- "OpenLoginLimit": false,
- "LoginMaxFailCount": 5,
-
- "LoginFailLockMinutes": 30
-
- },
-
- "SystemEmailSendConfig": {
- "Port": 465,
- "Host": "smtp.qiye.aliyun.com",
- "FromEmail": "test-study@extimaging.com",
- "FromName": "Test_Study",
- "AuthorizationCode": "zhanying123",
-
- "SiteUrl": "http://study.test.extimaging.com/login"
- },
"DicomSCPServiceConfig": {
"CalledAEList": [
- "STORESCP",
- "Value1",
- "Value2",
- "Value3"
+ "STORESCP"
],
"ServerPort": 11112
}
+
}
diff --git a/IRC.Core.SCP/appsettings.US_Uat_SCP.json b/IRC.Core.SCP/appsettings.US_Uat_SCP.json
new file mode 100644
index 000000000..1d15fadf7
--- /dev/null
+++ b/IRC.Core.SCP/appsettings.US_Uat_SCP.json
@@ -0,0 +1,31 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ },
+ "ObjectStoreService": {
+ "ObjectStoreUse": "AWS",
+ "AWS": {
+ "endPoint": "s3.us-east-1.amazonaws.com",
+ "useSSL": true,
+ "accessKey": "AKIAW3MEAFJXUO6XYFYN",
+ "secretKey": "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",
+ "bucketName": "ei-med-s3-lili-uat-store",
+ "viewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com/"
+ }
+ },
+ "ConnectionStrings": {
+ "RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
+ "Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
+ },
+ "DicomSCPServiceConfig": {
+ "CalledAEList": [
+ "STORESCP"
+ ],
+ "ServerPort": 11112
+ }
+
+}
diff --git a/IRC.Core.SCP/appsettings.Uat_IRC_SCP.json b/IRC.Core.SCP/appsettings.Uat_IRC_SCP.json
index b2a640967..18a92a53b 100644
--- a/IRC.Core.SCP/appsettings.Uat_IRC_SCP.json
+++ b/IRC.Core.SCP/appsettings.Uat_IRC_SCP.json
@@ -18,50 +18,17 @@
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
"viewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
"region": "oss-cn-shanghai"
- },
-
- "AWS": {
- "endPoint": "s3.us-east-1.amazonaws.com",
- "useSSL": false,
- "accessKey": "AKIAZQ3DRSOHFPJJ6FEU",
- "secretKey": "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",
- "bucketName": "ei-irc-test-store",
- "viewEndpoint": "https://ei-irc-test-store.s3.amazonaws.com/"
}
},
"ConnectionStrings": {
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
"Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
},
- "BasicSystemConfig": {
-
- "OpenUserComplexPassword": false,
-
- "OpenSignDocumentBeforeWork": false,
-
- "OpenTrialRelationDelete": true,
-
- "OpenLoginLimit": false,
- "LoginMaxFailCount": 5,
-
- "LoginFailLockMinutes": 30
- },
-
- "SystemEmailSendConfig": {
- "Port": 465,
- "Host": "smtp.qiye.aliyun.com",
- "FromEmail": "uat-study@extimaging.com",
- "FromName": "Uat_Study",
- "AuthorizationCode": "zhanying123",
- "SiteUrl": "http://study.uat.extimaging.com/login"
- },
"DicomSCPServiceConfig": {
"CalledAEList": [
- "STORESCP",
- "Value1",
- "Value2",
- "Value3"
+ "STORESCP"
],
"ServerPort": 11112
}
+
}
diff --git a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json
index b2d650a67..a27844759 100644
--- a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json
+++ b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json
@@ -83,6 +83,11 @@
"CompanyShortName": "Elevate Imaging",
"CompanyShortNameCN": "展影医疗",
"SiteUrl": "https://lili.elevateimaging.ai/login"
+ },
+
+ "SystemPacsConfig": {
+ "Port": "11113",
+ "IP": "44.210.231.169"
}
}
diff --git a/IRaCIS.Core.API/appsettings.US_Test_IRC.json b/IRaCIS.Core.API/appsettings.US_Test_IRC.json
index a0eed7266..b45479ed8 100644
--- a/IRaCIS.Core.API/appsettings.US_Test_IRC.json
+++ b/IRaCIS.Core.API/appsettings.US_Test_IRC.json
@@ -89,6 +89,11 @@
"CompanyShortName": "Elevate Imaging",
"CompanyShortNameCN": "展影医疗",
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
+ },
+
+ "SystemPacsConfig": {
+ "Port": "11113",
+ "IP": "3.226.182.187,1435"
}
}
diff --git a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json
index f16b2410d..faf47a861 100644
--- a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json
+++ b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json
@@ -83,6 +83,11 @@
"CompanyShortName": "Elevate Imaging",
"CompanyShortNameCN": "展影医疗",
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
+ },
+
+ "SystemPacsConfig": {
+ "Port": "11113",
+ "IP": "3.226.182.187,1435"
}
}
From 735083999ee36af0d5f17ac58ed5b2585ebc5fd0 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 5 Sep 2024 11:05:49 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E9=9D=9Edicom=20=E6=A3=80=E6=9F=A5?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=90=8C=E6=97=B6=E5=A2=9E=E5=8A=A0IR=20?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E7=BB=91=E5=AE=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/UploadDownLoadController.cs | 29 ++++++++++++++++---
.../ImageAndDoc/DTO/UnionStudyViewDodel.cs | 22 ++++++++++++--
.../ImageAndDoc/DownloadAndUploadService.cs | 18 ++++++++++--
3 files changed, 60 insertions(+), 9 deletions(-)
diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
index df6500ede..4da2b86f6 100644
--- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
+++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
@@ -38,6 +38,7 @@ using Newtonsoft.Json;
using SharpCompress.Archives;
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Globalization;
using System.IO;
@@ -419,12 +420,20 @@ namespace IRaCIS.Core.API.Controllers
public class UploadNoneDicomFileCommand
{
- public Guid TrialId { get; set; }
+ [NotDefault]
public Guid SubjectVisitId { get; set; }
- public Guid NoneDicomStudyId { get; set; }
+
+
+ [NotDefault]
public Guid StudyMonitorId { get; set; }
+ public Guid? NoneDicomStudyId { get; set; }
+
+ //IR 上传的时候跟任务绑定
+ public Guid? VisitTaskId { get; set; }
+
+
public List UploadedFileList { get; set; } = new List();
@@ -470,7 +479,19 @@ namespace IRaCIS.Core.API.Controllers
foreach (var item in incommand.UploadedFileList)
{
- await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType,FileSize=item.FileFize });
+ //如果是跟任务绑,那么NoneDicomStudyId 设置为空,不影响之前的检查,同时设置 OriginNoneDicomStudyId 保证关系
+
+ if(incommand.VisitTaskId!=null && incommand.VisitTaskId !=Guid.Empty)
+ {
+ await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, OriginNoneDicomStudyId=noneDicomStudyId.Value, FileType = item.FileType, FileSize = item.FileFize });
+
+ }
+ else
+ {
+ await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId.Value, FileType = item.FileType, FileSize = item.FileFize });
+
+ }
+
}
var uploadFinishedTime = DateTime.Now;
@@ -483,7 +504,7 @@ namespace IRaCIS.Core.API.Controllers
studyMonitor.FileSize = incommand.UploadedFileList.Sum(t => t.FileFize);
studyMonitor.IsDicom = false;
studyMonitor.IsDicomReUpload = false;
- studyMonitor.StudyId = noneDicomStudyId;
+ studyMonitor.StudyId = noneDicomStudyId.Value;
studyMonitor.StudyCode = noneDicomStudy.StudyCode;
studyMonitor.ArchiveFinishedTime = DateTime.Now;
studyMonitor.IP = _userInfo.IP;
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
index 1f24c9735..d627136b1 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
@@ -377,7 +377,7 @@ namespace IRaCIS.Core.Application.Contracts
public string SubjectCode { get; set; }
}
- public class CRCUploadTaskStudyQuery: SortInput
+ public class CRCUploadTaskStudyQuery : SortInput
{
[NotDefault]
@@ -415,7 +415,7 @@ namespace IRaCIS.Core.Application.Contracts
public int UploadedFileCount { get; set; }
}
- public class TaskDicomStudyDTO: DicomStudyBasicInfo
+ public class TaskDicomStudyDTO : DicomStudyBasicInfo
{
public Guid SubjectId { get; set; }
@@ -438,12 +438,28 @@ namespace IRaCIS.Core.Application.Contracts
}
+ public class NoneDicomFileInfo
+ {
+ [JsonIgnore]
+ public Guid? OriginNoneDicomStudyId { get; set; }
+
+ public string FileType { get; set; }
+
+ public long? FileSize { get; set; }
+ public string FileName { get; set; }
+
+ public string Path { get; set; }
+ }
+
public class TaskNoneDicomStudyDTO : NoneDicomStudyBasicInfo
{
public int UploadedFileCount { get; set; }
+ public List UploadedFileList { get; set; }
+
+ public List FileList { get; set; }
public Guid SubjectId { get; set; }
@@ -468,7 +484,7 @@ namespace IRaCIS.Core.Application.Contracts
public List NoneDicomStudyIdList { get; set; }
}
- public class IRReadingDownloadQuery:SortInput
+ public class IRReadingDownloadQuery : SortInput
{
[NotDefault]
public Guid SubjectId { get; set; }
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
index 23f219779..4a56736c3 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
@@ -1025,6 +1025,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
Modality = ns.Modality,
StudyCode = ns.StudyCode,
+ FileList = ns.NoneDicomFileList.Select(t => new NoneDicomFileInfo()
+ {
+ FileType=t.FileType,
+ FileName = t.FileName,
+ FileSize = t.FileSize,
+ Path = t.Path
+ }).ToList()
+
};
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).SortToListAsync(inQuery);
@@ -1034,15 +1042,21 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var taskNoneDicomStudyList = _visitTaskRepository.Where(t => noneDicomStudyIdList.Contains(t.Id))
.SelectMany(t => t.TaskNoneDicomStudyFileList).Where(t => noneDicomStudyIdList.Contains((Guid)t.VisitTaskId))
- .Select(u => new
+ .Select(u => new NoneDicomFileInfo
{
- u.OriginNoneDicomStudyId,
+ OriginNoneDicomStudyId = u.OriginNoneDicomStudyId,
+
+ FileType=u.FileType
+ FileName = u.FileName,
+ FileSize = u.FileSize,
+ Path = u.Path
})
.ToList();
foreach (var item in list)
{
item.UploadedFileCount = taskNoneDicomStudyList.Where(t => t.OriginNoneDicomStudyId == item.Id).Count();
+ item.UploadedFileList = taskNoneDicomStudyList.Where(t => t.OriginNoneDicomStudyId == item.Id).ToList();
}
return list;
From 72e54fe0d9ea0767db0c278ceeb5d0a15aa6a7c8 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 5 Sep 2024 11:27:29 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E9=9D=9Edicom=20=E6=A3=80=E6=9F=A5?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E4=BB=BB=E5=8A=A1Id?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs | 2 +-
.../Service/ImageAndDoc/DownloadAndUploadService.cs | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
index d627136b1..150d90103 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
@@ -453,7 +453,7 @@ namespace IRaCIS.Core.Application.Contracts
public class TaskNoneDicomStudyDTO : NoneDicomStudyBasicInfo
{
-
+ public Guid VisitTaskId { get; set; }
public int UploadedFileCount { get; set; }
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
index 4a56736c3..2838c683a 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
@@ -1016,6 +1016,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
TaskBlindName = u.TaskBlindName,
TaskName = u.TaskName,
SourceSubjectVisitId = u.SourceSubjectVisitId,
+ VisitTaskId=u.Id,
Id = ns.Id,
Description = ns.Description,
@@ -1037,16 +1038,16 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).SortToListAsync(inQuery);
- var noneDicomStudyIdList = list.Select(t => t.Id).ToList();
+ var noneDicomStudyTaskIdList = list.Select(t => t.VisitTaskId).ToList();
- var taskNoneDicomStudyList = _visitTaskRepository.Where(t => noneDicomStudyIdList.Contains(t.Id))
- .SelectMany(t => t.TaskNoneDicomStudyFileList).Where(t => noneDicomStudyIdList.Contains((Guid)t.VisitTaskId))
+ var taskNoneDicomStudyList = _visitTaskRepository.Where(t => noneDicomStudyTaskIdList.Contains(t.Id))
+ .SelectMany(t => t.TaskNoneDicomStudyFileList).Where(t => noneDicomStudyTaskIdList.Contains((Guid)t.VisitTaskId))
.Select(u => new NoneDicomFileInfo
{
OriginNoneDicomStudyId = u.OriginNoneDicomStudyId,
- FileType=u.FileType
+ FileType=u.FileType,
FileName = u.FileName,
FileSize = u.FileSize,
Path = u.Path
From 4f77d1bfb31f09673b6ee370685ca70f3f3769cb Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 5 Sep 2024 13:26:10 +0800
Subject: [PATCH 10/10] =?UTF-8?q?MFA=20=E7=AC=AC=E4=BA=8C=E7=A7=8D?=
=?UTF-8?q?=E6=83=85=E5=86=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.API/Controllers/ExtraController.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs
index 413e546e4..f9b40bb88 100644
--- a/IRaCIS.Core.API/Controllers/ExtraController.cs
+++ b/IRaCIS.Core.API/Controllers/ExtraController.cs
@@ -236,7 +236,7 @@ namespace IRaCIS.Api.Controllers
returnModel.Data.BasicInfo.EMail = hiddenEmail;
//修改密码
- if (returnModel.Data.BasicInfo.IsFirstAdd)
+ if (returnModel.Data.BasicInfo.IsFirstAdd || returnModel.Data.BasicInfo.LoginState == 1)
{
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
}