Compare commits

..

58 Commits

Author SHA1 Message Date
hang 0a2513245c 升级net8 模型要求严格了 2024-01-05 17:09:25 +08:00
hang f10cc0adbf 修改稽查上传文件路径
continuous-integration/drone/push Build is passing
2024-01-05 12:56:26 +08:00
hang 58b2f9c7a9 修改配置文件
continuous-integration/drone/push Build is passing
2024-01-05 12:40:13 +08:00
hang 472e744b6c 修改生产数据库
continuous-integration/drone/push Build is passing
2024-01-05 12:27:11 +08:00
hang 699df338c1 修改待阅列表 临床数据未签名但是可以做后续访视,生成任务逻辑遗漏
continuous-integration/drone/push Build is passing
2024-01-04 15:20:00 +08:00
hang a64127537e Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing
2024-01-04 12:16:39 +08:00
hang 2287c8869d 修改导表错误 2024-01-04 12:16:31 +08:00
he 0d8319feaa 代码修改
continuous-integration/drone/push Build is passing
2024-01-03 17:28:15 +08:00
he 676c5b0e74 再次修改
continuous-integration/drone/push Build is passing
2024-01-03 17:17:33 +08:00
he a76654c210 修改状态
continuous-integration/drone/push Build is passing
2024-01-03 17:08:39 +08:00
he 0a29d431dc 修改状态
continuous-integration/drone/push Build is passing
2024-01-03 16:58:43 +08:00
he 86562b39e3 Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing
2024-01-03 16:47:51 +08:00
he 86fe43aa93 代码修改 修改阅片状态 2024-01-03 16:47:49 +08:00
hang 082998da09 修改监控导出
continuous-integration/drone/push Build is passing
2024-01-03 15:39:43 +08:00
hang d209a8de4d 修改中心调研导表
continuous-integration/drone/push Build is passing
2024-01-03 15:26:40 +08:00
he b1608812ec Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing
2024-01-03 14:24:57 +08:00
he 20c18d957a 阅片状态修改 2024-01-03 14:24:55 +08:00
hang 7a7011e7ef 打开文件修改监控
continuous-integration/drone/push Build is passing
2024-01-03 13:43:31 +08:00
hang 24a395f8c8 增加真实名字
continuous-integration/drone/push Build is passing
2024-01-03 13:42:01 +08:00
hang df2f179917 xx
continuous-integration/drone/push Build is passing
2024-01-03 13:39:17 +08:00
hang 1bcc831937 不监测修改
continuous-integration/drone/push Build is passing
2024-01-03 13:32:03 +08:00
hang 75bf85997a 禁止热更新
continuous-integration/drone/push Build is passing
2024-01-03 13:20:27 +08:00
hang 074cba906c xx
continuous-integration/drone/push Build is passing
2024-01-03 13:18:11 +08:00
hang 86db676df8 必须在镜像里面修改
continuous-integration/drone/push Build is passing
2024-01-03 13:12:36 +08:00
hang bc67f16735 docker 部署方式解决
continuous-integration/drone/push Build is passing
2024-01-03 12:13:47 +08:00
hang 3e046e24e9 增加上传人
continuous-integration/drone/push Build is passing
2024-01-03 11:43:04 +08:00
hang c971161d31 修改utf-8
continuous-integration/drone/push Build is passing
2024-01-03 11:19:07 +08:00
hang a63904c0bb 暂时屏蔽
continuous-integration/drone/push Build is passing
2024-01-03 11:11:57 +08:00
hang 572d4ea4b8 修改docker-compose 文件打开文件修改跟踪
continuous-integration/drone/push Build is passing
2024-01-03 11:05:19 +08:00
hang ae4345cfcc x 监控文件错误 测试
continuous-integration/drone/push Build is passing
2024-01-03 10:06:30 +08:00
hang a536c33302 自动打包修改
continuous-integration/drone/push Build is passing
2024-01-03 09:29:07 +08:00
hang be5c9b636e 修改国际化邮件代码 2024-01-03 09:23:55 +08:00
hang c71bf65cd9 系统签名文档废除
continuous-integration/drone/push Build encountered an error
2023-12-29 17:36:08 +08:00
he 69c5ce9841 代码统计修改 查询数量 2023-12-29 17:36:00 +08:00
hang 2139193df4 清理裁判任务Id
continuous-integration/drone/push Build encountered an error
2023-12-29 17:35:11 +08:00
he 9aa2f23a67 修改代码 需要发study
continuous-integration/drone/push Build encountered an error
2023-12-28 13:25:02 +08:00
he 531e0fa228 计算小数位修改 需要同步study 2023-12-28 13:24:35 +08:00
hang 250c478687 Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build encountered an error
2023-12-27 11:13:29 +08:00
hang 09ba37ec6d 修改测试环境数据库地址 2023-12-27 11:13:27 +08:00
hang 913b673b72 迁移修改
continuous-integration/drone/push Build is passing
2023-12-23 11:30:15 +08:00
hang 5ee8a3db21 迁移修改数据库连接地址
continuous-integration/drone/push Build is failing
2023-12-22 18:01:29 +08:00
hang 3c41789ba9 修改导表 5 2023-12-20 16:44:40 +08:00
hang d2268f0706 裁判任务失效的时候,清理裁判任务id 需要迁移 2023-12-20 16:44:36 +08:00
hang e8496df81a 修改模板文件位置 4 2023-12-20 16:43:49 +08:00
hang 3e24fe9461 修改路径bug 3 2023-12-20 16:43:45 +08:00
hang d771ab0f6f 修改文档删除2 2023-12-20 16:43:39 +08:00
hang 29dfa03d0f 修改导表时间格式2 2023-12-20 16:43:34 +08:00
hang 44e9b211c2 更新模板的时候,清理之前的文档,需要迁移 2023-12-20 16:43:29 +08:00
hang b1154ea594 修改导表时间格式 2023-12-20 16:43:25 +08:00
he 6dd12b419b 临床数据查询修改
continuous-integration/drone/push Build is passing
2023-12-13 09:57:18 +08:00
he bce7c1cc99 临床数据查询修改
continuous-integration/drone/push Build is failing
2023-12-13 09:51:24 +08:00
he a660eb4f37 临床数据修改 2023-12-13 09:51:17 +08:00
he 3ade13a922 临床数据修改
continuous-integration/drone/push Build is passing
2023-12-13 09:47:51 +08:00
he a5fed78c19 临床数据修改 2023-12-13 09:47:18 +08:00
he 5207fef130 医学审核加是否有临床数据 2023-12-13 09:47:07 +08:00
he b8ad8085cd Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing
2023-12-13 09:45:48 +08:00
hang dc8451f55c windows linux 环境路径修改 迁移
continuous-integration/drone/push Build is passing
2023-12-08 12:45:02 +08:00
hang dd9ec3d8fe 用户登录国际化
continuous-integration/drone/push Build is passing
2023-12-08 09:01:06 +08:00
34 changed files with 489 additions and 195 deletions
@@ -800,7 +800,7 @@ namespace IRaCIS.Core.API.Controllers
templateFileStream.Seek(0, SeekOrigin.Begin);
var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/Check", realFileName);
var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/Check", $"{Guid.NewGuid()}_" + realFileName);
await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
@@ -1024,7 +1024,7 @@ namespace IRaCIS.Core.API.Controllers
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_TemplateUploadData"));
}
var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/SiteSurvey", realFileName);
var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/SiteSurvey", $"{Guid.NewGuid()}_"+ realFileName);
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
+33 -33
View File
@@ -1,4 +1,4 @@
using Autofac;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http.Features;
@@ -53,7 +53,7 @@ namespace IRaCIS.Core.API
containerBuilder.RegisterModule<AutofacModuleSetup>();
#region Test
//containerBuilder.RegisterType<ClinicalDataService>().PropertiesAutowired().InstancePerLifetimeScope();//注册仓储
//containerBuilder.RegisterType<ClinicalDataService>().PropertiesAutowired().InstancePerLifetimeScope();//注册仓储
//var container = containerBuilder.Build();
@@ -75,12 +75,12 @@ namespace IRaCIS.Core.API
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
//健康检查
//健康检查
services.AddHealthChecks();
//本地化
//本地化
services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
services.AddControllers(options =>
{
//options.Filters.Add<LogActionFilter>();
@@ -95,7 +95,7 @@ namespace IRaCIS.Core.API
})
.AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理
.AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理
services.AddOptions().Configure<SystemEmailSendConfig>(_configuration.GetSection("SystemEmailSendConfig"));
services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
@@ -103,62 +103,62 @@ namespace IRaCIS.Core.API
services.AddOptions().Configure<ObjectStoreServiceOptions>(_configuration.GetSection("ObjectStoreService"));
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
services.AddDynamicWebApiSetup();
//AutoMapper
services.AddAutoMapperSetup();
//EF ORM QueryWithNoLock
services.AddEFSetup(_configuration);
//Http 响应压缩
//Http 响应压缩
services.AddResponseCompressionSetup();
//Swagger Api 文档
//Swagger Api 文档
services.AddSwaggerSetup();
//JWT Token 验证
//JWT Token 验证
services.AddJWTAuthSetup(_configuration);
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
// EasyCaching 缓存
// EasyCaching 缓存
services.AddEasyCachingSetup(_configuration);
//services.AddDistributedMemoryCache();
// hangfire 定时任务框架 有界面,更友好~
// hangfire 定时任务框架 有界面,更友好~
services.AddhangfireSetup(_configuration);
// QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好
// QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好
services.AddQuartZSetup(_configuration);
// 保护上传文件
// 保护上传文件
//services.AddStaticFileAuthorizationSetup();
////HttpReports 暂时废弃
////HttpReports 暂时废弃
//services.AddHttpReports().AddHttpTransport();
//Serilog 日志可视化 LogDashboard日志
//Serilog 日志可视化 LogDashboard日志
services.AddLogDashboardSetup();
//上传限制 配置
//上传限制 配置
services.Configure<FormOptions>(options =>
{
options.MultipartBodyLengthLimit = int.MaxValue;
options.ValueCountLimit = int.MaxValue;
options.ValueLengthLimit = int.MaxValue;
});
//IP 限流 可设置白名单 或者黑名单
//IP 限流 可设置白名单 或者黑名单
//services.AddIpPolicyRateLimitSetup(_configuration);
// 用户类型 策略授权
// 用户类型 策略授权
//services.AddAuthorizationPolicySetup(_configuration);
services.AddJsonConfigSetup(_configuration);
//转发头设置 获取真实IP
//转发头设置 获取真实IP
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
});
//Dicom影像渲染图片 跨平台
//Dicom影像渲染图片 跨平台
services.AddDicomSetup();
// 实时应用
// 实时应用
services.AddSignalR();
@@ -175,17 +175,17 @@ namespace IRaCIS.Core.API
{
//app.UsePathBase(PathString.FromUriComponent("/api"));
//本地化
//本地化
app.UseLocalization();
app.UseForwardedHeaders();
//响应压缩
//响应压缩
app.UseResponseCompression();
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
app.UseStaticFiles();
@@ -195,10 +195,10 @@ namespace IRaCIS.Core.API
//hangfire
app.UseHangfireConfig(env);
////暂时废弃
////暂时废弃
//app.UseHttpReports();
////限流 中间件
////限流 中间件
//app.UseIpRateLimiting();
@@ -211,18 +211,18 @@ namespace IRaCIS.Core.API
{
//app.UseHsts();
}
Console.WriteLine("当前环境: " + env.EnvironmentName);
Console.WriteLine("当前环境: " + env.EnvironmentName);
//app.UseMiddleware<AuthMiddleware>();
// 特殊异常处理 比如 404
// 特殊异常处理 比如 404
app.UseStatusCodePagesWithReExecute("/Error/{0}");
SwaggerSetup.Configure(app, env);
////serilog 记录请求的用户信息
////serilog 记录请求的用户信息
app.UseSerilogConfig(env);
app.UseRouting();
@@ -237,7 +237,7 @@ namespace IRaCIS.Core.API
//app.UseJwtBearerQueryString();
app.UseAuthorization();
////文件伺服 必须带Token 访问
////文件伺服 必须带Token 访问
////app.UseIRacisHostStaticFileStore(env);
app.UseEndpoints(endpoints =>
@@ -253,7 +253,7 @@ namespace IRaCIS.Core.API
var hangfireJobService = app.ApplicationServices.GetRequiredService<IIRaCISHangfireJob>();
await hangfireJobService.InitHangfireJobTaskAsync();
//有的时候每调用
//有的时候每调用
//HangfireJobHelper.NotImmediatelyOnceOnlyJob<IIRaCISHangfireJob>(t => t.InitHangfireJobTaskAsync(),TimeSpan.FromSeconds(1));
+2 -2
View File
@@ -30,8 +30,8 @@
},
"ConnectionStrings": {
"RemoteNew": "Server=47.117.165.18,1434;Database=Prod_Study;User ID=sa;Password=WHxckj@2019;TrustServerCertificate=true",
"Hangfire": "Server=47.117.165.18,1434;Database=Prod_Study.hangfire;User ID=sa;Password=WHxckj@2019;TrustServerCertificate=true"
"RemoteNew": "Server=101.132.193.237,1434;Database=Prod_Study;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
"Hangfire": "Server=101.132.193.237,1434;Database=Prod_Study_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
},
"BasicSystemConfig": {
+2 -2
View File
@@ -30,8 +30,8 @@
},
"ConnectionStrings": {
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Test.Study;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true",
"Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Test.Study.hangfire;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
"RemoteNew": "Server=123.56.94.154,1435;Database=Test_Study;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
"Hangfire": "Server=123.56.94.154,1435;Database=Test_Study_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
},
"BasicSystemConfig": {
@@ -16,6 +16,7 @@ using NPOI.HPSF;
using NPOI.HSSF.UserModel;
using NPOI.XSSF.UserModel;
using SkiaSharp;
using System.Collections;
using System.IO;
namespace IRaCIS.Core.Application.Service;
@@ -52,21 +53,24 @@ public static class ExcelExportHelper
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
var dic = data.ConvertToDictionary();
foreach (var key in dic.Keys)
{
//是数组 那么找到对应的属性 进行翻译
if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
{
var newObjList = new List<object>();
var no = 1;
foreach (var item in dic[key] as JArray)
foreach (var item in dic[key] as IList )
{
var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
var itemDic = item.ConvertToDictionary();
foreach (var needTranslateProperty in needTranslatePropertyList)
@@ -74,7 +78,7 @@ public static class ExcelExportHelper
//翻译的属性依赖其他属性
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
{
if (item[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
{
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
@@ -232,29 +236,30 @@ public static class ExcelExportHelper
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
var dic = data.ConvertToDictionary();
//var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
foreach (var key in dic.Keys)
{
//是数组 那么找到对应的属性 进行翻译
if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
{
var newObjList = new List<object>();
var no = 1;
foreach (var item in dic[key] as JArray)
foreach (var item in dic[key] as IList)
//foreach (var item in dic[key] as JArray)
{
var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
var itemDic = item.ConvertToDictionary();
foreach (var needTranslateProperty in needTranslatePropertyList)
{
//翻译的属性依赖其他属性
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
{
if (item[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
{
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
@@ -142,8 +142,9 @@ public static class FileStoreHelper
//API vue 部署目录
public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment)
{
var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName;
return rootPath;
string parentDirectory = Path.GetFullPath(Path.Combine(_hostEnvironment.ContentRootPath, ".."));
return parentDirectory;
}
@@ -163,7 +164,7 @@ public static class FileStoreHelper
{
var rootPath = GetIRaCISRootPath(_hostEnvironment);
var physicalFilePath = Path.Combine(rootPath, relativePath.Trim('/'));
var physicalFilePath = Path.Combine(rootPath, relativePath.TrimStart('/'));
return physicalFilePath;
}
@@ -549,6 +549,7 @@ namespace IRaCIS.Core.Application.Service
var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionId, clinicalDataConfirmList);
var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId);
var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false);
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0)
{
@@ -590,7 +591,8 @@ namespace IRaCIS.Core.Application.Service
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
IsNeedClinicalDataSign = isNeedClinicalDataSign,
IsClinicalDataSign = isClinicalDataSign
IsClinicalDataSign = isClinicalDataSign,
IsFrontTaskNeedSignButNotSign= isFrontTaskNeedSignButNotSign
});
@@ -647,7 +647,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
//Expression<Func<VisitTask, bool>> visitTaskLambda = x => x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId;
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Application.Contracts;
namespace IRaCIS.Core.Application.Service
{
@@ -99,14 +100,36 @@ namespace IRaCIS.Core.Application.Service
//---读取模板内容失败, 请将文件另存为docx格式尝试!
return ResponseOutput.NotOk(_localizer["Document_ TemplateRead"]);
}
}
}
var entity = await _commonDocumentRepository.InsertOrUpdateAsync(addOrEditCommonDocument, true, verifyExp1, verifyExp2);
return ResponseOutput.Ok(entity.Id.ToString());
if (addOrEditCommonDocument.Id == null) //insert
{
var entity = await _commonDocumentRepository.InsertFromDTOAsync(addOrEditCommonDocument, true, verifyExp1, verifyExp2);
return ResponseOutput.Ok(entity.Id.ToString());
}
else //update
{
var dbbeforeEntity = await _commonDocumentRepository.UpdateFromDTOAsync(addOrEditCommonDocument, true, true, verifyExp1, verifyExp2);
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, dbbeforeEntity.Path);
if (File.Exists(filePath))
{
File.Delete(filePath);
}
return ResponseOutput.Ok();
}
}
@@ -114,7 +137,20 @@ namespace IRaCIS.Core.Application.Service
[HttpDelete("{commonDocumentId:guid}")]
public async Task<IResponseOutput> DeleteCommonDocument(Guid commonDocumentId)
{
var find= await _commonDocumentRepository.FirstOrDefaultNoTrackingAsync(t=>t.Id== commonDocumentId);
var success = await _commonDocumentRepository.DeleteFromQueryAsync(t => t.Id == commonDocumentId, true,true);
if (find != null)
{
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, find.Path);
if (File.Exists(filePath))
{
File.Delete(filePath);
}
}
return ResponseOutput.Ok();
}
@@ -158,7 +158,7 @@ namespace IRaCIS.Application.Services
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
//主题
//---[来自展影IRC] 关于重置密码的提醒
messageToSend.Subject = _localizer["Mail_IRCResettingPassword "];
messageToSend.Subject = _localizer["Mail_IRCResettingPassword"];
@@ -178,7 +178,7 @@ namespace IRaCIS.Application.Services
builder.HtmlBody = string.Format(templateInfo,
//---您正在进行邮箱重置密码操作
_localizer["Mail_ResettingPassword "],
_localizer["Mail_ResettingPassword"],
verificationCode
);
}
@@ -658,7 +658,7 @@ namespace IRaCIS.Core.Application.Services
/// <param name="isSystemDoc"></param>
/// <returns></returns>
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId" })]
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
{
if (isSystemDoc)
@@ -298,7 +298,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public T Data { get; set; }
public SignDTO SignInfo { get; set; }
public SignDTO? SignInfo { get; set; }
}
@@ -644,7 +644,8 @@ namespace IRaCIS.Application.Services
{
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId = Guid.Empty, LoginFaildName = userName,LoginPassword=password, OptType = UserOptType.AccountLocked }, true);
throw new BusinessValidationFailedException($"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。");
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
}
var userLoginReturnModel = new LoginReturnDTO();
@@ -547,7 +547,7 @@ namespace IRaCIS.Core.Application.Contracts
[DictionaryTranslateAttribute("YesOrNo")]
public bool IsSuccess { get; set; }
public string Note = string.Empty;
public string Note { get; set; }
}
@@ -1383,6 +1383,10 @@ namespace IRaCIS.Core.Application.Contracts
public DateTime? SubmitTime { get; set; }
public string SubmitUserName { get; set; } = String.Empty;
public string SubmitUserRealName { get; set; } = String.Empty;
public string CurrentActionUserName { get; set; } = String.Empty;
public string PreliminaryAuditUserName { get; set; } = String.Empty;
@@ -364,6 +364,10 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
.ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.Subject.Status))
.ForMember(d => d.StudyCount, u => u.MapFrom(s => s.StudyList.Count()))
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.UserName))
.ForMember(d => d.SubmitUserRealName, u => u.MapFrom(s => s.SubmitUser.FullName))
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.CurrentActionUser.UserName))
.ForMember(d => d.PreliminaryAuditUserName, u => u.MapFrom(s => s.PreliminaryAuditUser.UserName))
.ForMember(d => d.ReviewAuditUserName, u => u.MapFrom(s => s.ReviewAuditUser.UserName))
@@ -523,7 +523,28 @@ namespace IRaCIS.Core.Application.Service
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
inDto.TrialReadingCriterionId = readModule.TrialReadingCriterionId;
}
// 有全局就查全局 有肿瘤学就查肿瘤学
var clinicalDataLevelList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring).Select(x => x.ClinicalDataLevel).Distinct().ToListAsync();
var existsCRCStructuring = clinicalDataLevelList.Any(x=>x== ClinicalLevel.OncologyRead|| x == ClinicalLevel.ImageRead);
ReadingSetType? readingSetType = null;
if (clinicalDataLevelList.Contains(ClinicalLevel.ImageRead) && !clinicalDataLevelList.Contains(ClinicalLevel.OncologyRead))
{
readingSetType = ReadingSetType.ImageReading;
}
else if (clinicalDataLevelList.Contains(ClinicalLevel.OncologyRead) && !clinicalDataLevelList.Contains(ClinicalLevel.ImageRead))
{
readingSetType = ReadingSetType.TumorReading;
}
var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
.Where(x=> existsCRCStructuring)
.WhereIf(inDto.ReadModuleId==null,x=>x.TrialReadingCriterion.IsConfirm)
.WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
.WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm)
.WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm)
@@ -532,6 +553,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
.WhereIf(inDto.StartTime != null, x => x.SubjectVisit.LatestScanDate >= inDto.StartTime)
.WhereIf(inDto.EndTime != null, x => x.SubjectVisit.LatestScanDate <= inDto.EndTime)
.WhereIf(readingSetType != null, x => x.ReadingSetType== readingSetType)
.Select(x => new GetCRCConfirmListOutDto()
{
@@ -395,6 +395,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Arm ArmEnum { get; set; }
public bool IsExistsClinicalData { get; set; }
public MedicalReviewAuditState AuditState { get; set; }
@@ -21,5 +21,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Interface
Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto);
Task<PageOutput<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto);
}
}
@@ -33,6 +33,7 @@ namespace IRaCIS.Core.Application.Service
private readonly IReadingImageTaskService _iReadingImageTaskService;
private readonly IRepository<User> _userTaskRepository;
private readonly IVisitTaskService _visitTaskService;
private readonly IReadingClinicalDataService _readingClinicalDataService;
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
private readonly IRepository<ReadingMedicalReviewDialog> _readingMedicalReviewDialogRepository;
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
@@ -52,6 +53,7 @@ namespace IRaCIS.Core.Application.Service
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
IRepository<User> userTaskRepository,
IVisitTaskService visitTaskService,
IReadingClinicalDataService readingClinicalDataService,
IRepository<TaskMedicalReview> taskMedicalReviewRepository,
IRepository<ReadingMedicalReviewDialog> readingMedicalReviewDialogRepository,
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial,
@@ -71,6 +73,7 @@ namespace IRaCIS.Core.Application.Service
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
this._userTaskRepository = userTaskRepository;
this._visitTaskService = visitTaskService;
this._readingClinicalDataService = readingClinicalDataService;
this._taskMedicalReviewRepository = taskMedicalReviewRepository;
this._readingMedicalReviewDialogRepository = readingMedicalReviewDialogRepository;
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
@@ -109,6 +112,17 @@ namespace IRaCIS.Core.Application.Service
medicalReviewInfo.VisitTaskId = taskInfo.Id;
var clinicalDataList = await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
{
SubjectId = taskInfo.SubjectId,
TrialId = taskInfo.TrialId,
VisitTaskId = taskInfo.Id,
});
medicalReviewInfo.IsExistsClinicalData = clinicalDataList.Count > 0;
medicalReviewInfo.ArmEnum = taskInfo.ArmEnum;
medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate?taskInfo.BlindSubjectCode: taskInfo.Subject.Code;
medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName;
@@ -704,9 +704,9 @@ namespace IRaCIS.Application.Services
{
//await AddDefaultValueToTask(inDto.VisitTaskId);
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id);
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id);
return (result, new
return (result, new
{
ReadingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync()
@@ -824,10 +824,7 @@ namespace IRaCIS.Application.Services
[HttpGet]
public async Task<List<GetTableAnswerRowInfoOutDto>> GetTableAnswerRowInfoList(GetTableAnswerRowInfoInDto inDto)
{
await _readingCalculateService.AddTaskLesionAnswerFromLastTask(new AddTaskLesionAnswerFromLastTaskInDto()
{
VisitTaskId = inDto.VisitTaskId
});
var result = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId)
.WhereIf(inDto.QuestionId != null, x => x.QuestionId == inDto.QuestionId)
.ProjectTo<GetTableAnswerRowInfoOutDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex)
@@ -2092,11 +2089,6 @@ namespace IRaCIS.Application.Services
}
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
{
ReadingTaskState = ReadingTaskState.Reading,
});
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
await this._readingCalculateService.CalculateTask(new CalculateTaskInDto()
{
@@ -2457,6 +2449,15 @@ namespace IRaCIS.Application.Services
task.IsNeedReadClinicalData = clinicalDataList.Where(x => x.ClinicalDataLevel != ClinicalLevel.Subject).Count() > 0;
}
if (visitTaskInfo.ReadingTaskState == ReadingTaskState.WaitReading)
{
await _readingCalculateService.AddTaskLesionAnswerFromLastTask(new AddTaskLesionAnswerFromLastTaskInDto()
{
VisitTaskId = task.VisitTaskId
});
}
// 如果已经签名 就不需要再读了
task.IsNeedReadClinicalData = visitTaskInfo.ReadingTaskState == ReadingTaskState.HaveSigned ? false : task.IsNeedReadClinicalData;
task.DigitPlaces = criterionInfo.DigitPlaces;
@@ -55,11 +55,6 @@ namespace IRaCIS.Application.Services
TrialId = inDto.TrialId
}).ToList();
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
{
ReadingTaskState = ReadingTaskState.Reading,
});
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result);
@@ -191,7 +191,6 @@ namespace IRaCIS.Application.Services
await _readingOncologyTaskInfoRepository.AddRangeAsync(readingOncologies);
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
var result = await _readingOncologyTaskInfoRepository.SaveChangesAsync();
@@ -126,36 +126,35 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
var service = await this.GetService(inDto.VisitTaskId);
var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
if (service != null && visitTaskInfo.SourceSubjectVisitId != null)
var result = new AddTaskLesionAnswerFromLastTaskOutDto();
var readingTaskState = visitTaskInfo.ReadingTaskState;
if (service != null && visitTaskInfo.SourceSubjectVisitId != null)
{
var readingTaskState = visitTaskInfo.ReadingTaskState;
var result = new AddTaskLesionAnswerFromLastTaskOutDto();
if (readingTaskState == ReadingTaskState.WaitReading)
{
result = await service.AddTaskLesionAnswerFromLastTask(inDto);
await service.CalculateTask(new CalculateTaskInDto()
if (visitTaskInfo.ReadingCategory == ReadingCategory.Visit)
{
IsChangeOtherTask = false,
VisitTaskId = inDto.VisitTaskId,
});
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
{
ReadingTaskState = ReadingTaskState.Reading,
});
result = await service.AddTaskLesionAnswerFromLastTask(inDto);
await service.CalculateTask(new CalculateTaskInDto()
{
IsChangeOtherTask = false,
VisitTaskId = inDto.VisitTaskId,
});
}
}
return result;
}
else
{
return new AddTaskLesionAnswerFromLastTaskOutDto();
}
if (readingTaskState == ReadingTaskState.WaitReading)
{
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
{
ReadingTaskState = ReadingTaskState.Reading,
},true);
}
}
return result;
}
/// <summary>
/// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
@@ -711,7 +711,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (valueOfTypes.Contains(item.ValueType))
{
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString();
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
}
}
catch (Exception)
@@ -649,7 +649,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (valueOfTypes.Contains(item.ValueType))
{
item.Answer = decimal.Round(decimal.Parse(item.Answer.IsNullOrEmpty() ? "0": item.Answer), inDto.DigitPlaces).ToString();
item.Answer = decimal.Round(decimal.Parse(item.Answer.IsNullOrEmpty() ? "0": item.Answer), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
}
}
catch (Exception)
@@ -549,7 +549,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (valueOfTypes.Contains(item.ValueType))
{
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString();
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
}
}
catch (Exception)
@@ -545,7 +545,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (valueOfTypes.Contains(item.ValueType))
{
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString();
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
}
}
catch (Exception)
@@ -104,6 +104,8 @@ namespace IRaCIS.Core.Application.Contracts
[DictionaryTranslateAttribute("YesOrNo")]
public bool IsGenerateAccount { get; set; }
[DictionaryTranslateAttribute("SiteSurvey_UserRoles")]
public int TrialRoleCode { get; set; }
public string OrganizationName { get; set; } = string.Empty;
@@ -22,14 +22,14 @@ namespace IRaCIS.Application.Contracts
[DictionaryTranslateAttribute("IsUserExitTrial")]
public bool IsDeleted { get; set; }
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
public DateTime? DeletedTime { get; set; }
public Guid? SiteId { get; set; }
public string Phone { get; set; } = String.Empty;
public DateTime UpdateTime { get; set; }
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
public DateTime CreateTime { get; set; }
@@ -84,7 +84,7 @@ namespace IRaCIS.Application.Contracts
[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
public DateTime CreateTime { get; set; }
@@ -118,7 +118,8 @@ namespace IRaCIS.Application.Contracts
public class ExcelExportInfo : TrialSelectDTO
{
public DateTime CurrentTime { get; set; } = DateTime.Now;
public string CurrentTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
public bool IsEn_US { get; set; }
@@ -1,6 +1,7 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.Service.Reading.Interface;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
@@ -21,11 +22,13 @@ namespace IRaCIS.Core.Application
private readonly IRepository<TrialDocument> _trialDocumentRepository;
private readonly IRepository<SystemDocument> _systemDocumentRepository;
private readonly IRepository<ReadModule> _readModuleRepository;
private readonly IClinicalAnswerService _clinicalAnswerService;
private readonly IRepository<SystemNotice> _systemNoticeRepository;
public PersonalWorkstation(IRepository<Trial> trialRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialDocument> trialDocumentRepository,
IRepository<SystemDocument> systemDocumentRepository,
IRepository<ReadModule> readModuleRepository,
IClinicalAnswerService clinicalAnswerService,
IRepository<SystemNotice> systemNoticeRepository)
{
_trialRepository = trialRepository;
@@ -33,6 +36,7 @@ namespace IRaCIS.Core.Application
_trialDocumentRepository = trialDocumentRepository;
_systemDocumentRepository = systemDocumentRepository;
this._readModuleRepository = readModuleRepository;
this._clinicalAnswerService = clinicalAnswerService;
_systemNoticeRepository = systemNoticeRepository;
}
@@ -429,7 +433,7 @@ namespace IRaCIS.Core.Application
ToBeDealedCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(),
ToBeVisitCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
ToAllCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count(),
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsCRCConfirm).Count(),
}).Where(x => x.ReadModuleCount > 0);
var defalutSortArray = new string[] { nameof(ImageClinicalDataToBeDoneDto.UrgentCount) + " desc", nameof(ImageClinicalDataToBeDoneDto.ToBeDealedCount) + " desc" };
@@ -437,6 +441,22 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
// ReadModuleCount情况太多了 暂时用之前的方法
foreach (var item in result.CurrentPageData)
{
item.ReadModuleCount = (await _clinicalAnswerService.GetCRCConfirmList(new Service.Reading.Dto.GetCRCConfirmListInDto()
{
TrialId = item.TrialId,
IsPMConfirm = false,
PageIndex = 1,
PageSize = 9999,
})).CurrentPageData.Count();
}
result.CurrentPageData = result.CurrentPageData.Where(x => x.ReadModuleCount != 0).ToList();
var toBeDealedCount = _subjectVisitRepository
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count();
@@ -674,7 +694,8 @@ namespace IRaCIS.Core.Application
//待领取量
ToBeClaimedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted).Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count(),
ToBeClaimedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState!=AuditStateEnum.QCPassed)
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count(),
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
@@ -689,7 +710,7 @@ namespace IRaCIS.Core.Application
var toBeClaimedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)&& t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count();
@@ -22,13 +22,13 @@ namespace IRaCIS.Core.Application.Triggers
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
private readonly IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository;
public VisitTaskIsFrontTaskNeedSignButNotSignTrigger(
IRepository<VisitTask> visitTaskRepository, IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository, IRepository<ReadingQuestionTrial> trialReadingQuestionRepository
, IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository)
, IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository, IRepository<ReadingJudgeInfo> readingJudgeInfoRepository)
{
_trialReadingCriterionRepository = trialReadingCriterionRepository;
@@ -36,6 +36,7 @@ namespace IRaCIS.Core.Application.Triggers
_trialReadingQuestionRepository = trialReadingQuestionRepository;
_readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
_readingJudgeInfoRepository = readingJudgeInfoRepository;
}
@@ -98,7 +99,120 @@ namespace IRaCIS.Core.Application.Triggers
}
}
else if (context.ChangeType == ChangeType.Modified)
{
if (visitTask.ReadingCategory == ReadingCategory.Judge && (visitTask.TaskState == TaskState.Adbandon || visitTask.TaskState == TaskState.HaveReturned))
{
var find = _readingJudgeInfoRepository.Where(t => t.JudgeTaskId == visitTask.Id).FirstOrDefault();
if (find != null)
{
var ids = new Guid[] { find.TaskIdOne, find.TaskIdTwo };
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => ids.Contains(t.Id), u => new VisitTask() { JudgeVisitTaskId = null });
}
}
}
#region
// //从未签名状态 改为签名状态时 判断是否进行了附加评估,将附加评估的结果冗余
// if (context.ChangeType == ChangeType.Modified && visitTask.ReadingTaskState == ReadingTaskState.HaveSigned && context.UnmodifiedEntity.ReadingTaskState != ReadingTaskState.HaveSigned)
// {
// var criterion = _trialReadingCriterionRepository.Where(t => t.Id == visitTask.TrialReadingCriterionId).FirstOrDefault();
// //如果是附加评估
// if (criterion.IsAdditionalAssessment)
// {
// if (visitTask.ReadingCategory == ReadingCategory.Visit)
// {
// switch (criterion.CriterionType)
// {
// case CriterionType.RECIST1Point1:
// var isbaseLine = _visitTaskRepository.Where(t => t.Id == visitTask.Id).Select(t => t.SourceSubjectVisit.IsBaseLine).FirstOrDefault();
// if (isbaseLine)
// {
// var currentTaskAdditionarlAnswer = await _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == visitTask.Id &&
// t.ReadingQuestionTrial.IsAdditional == true && t.ReadingQuestionTrial.Type != "group"
// ).Include(t => t.ReadingQuestionTrial).FirstOrDefaultAsync();
// //双重阅片完成了
// if (criterion.ReadingType == ReadingMethod.Double &&
//(_visitTaskRepository.Where(t => t.SubjectId == visitTask.SubjectId && t.TaskName == visitTask.TaskName && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() == 2)
// )
// {
// var otherTaskId = await _visitTaskRepository.Where(t => t.SubjectId == visitTask.SubjectId && t.TaskName == visitTask.TaskName && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.Id != visitTask.Id)
// .Select(t => t.Id).FirstOrDefaultAsync();
// var otherTaskAdditionarlAnswer = await _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == otherTaskId &&
// t.ReadingQuestionTrial.IsAdditional == true && t.ReadingQuestionTrial.Type != "group"
// ).Include(t => t.ReadingQuestionTrial).FirstOrDefaultAsync();
// await _subjectAdditionalEvaluationResultRepository.AddAsync(new SubjectAdditionalEvaluationResult()
// {
// TrialReadingCriterionId = visitTask.TrialReadingCriterionId,
// IsFinalResult = true,
// SubjectId = visitTask.SubjectId,
// TrialReadingQuestionId = currentTaskAdditionarlAnswer.ReadingQuestionTrialId,
// FinalAnswer = currentTaskAdditionarlAnswer.Answer,
// FinalTranslateDictionaryCode = currentTaskAdditionarlAnswer.ReadingQuestionTrial.DictionaryCode,
// });
// }
// if (criterion.ReadingType == ReadingMethod.Single)
// {
// await _subjectAdditionalEvaluationResultRepository.AddAsync(new SubjectAdditionalEvaluationResult()
// {
// TrialReadingCriterionId = visitTask.TrialReadingCriterionId,
// IsFinalResult = true,
// SubjectId = visitTask.SubjectId,
// TrialReadingQuestionId = currentTaskAdditionarlAnswer.ReadingQuestionTrialId,
// FinalAnswer = currentTaskAdditionarlAnswer.Answer,
// FinalTranslateDictionaryCode = currentTaskAdditionarlAnswer.ReadingQuestionTrial.DictionaryCode,
// });
// }
// }
// break;
// default:
// break;
// }
// }
// }
// }
#endregion
}
+2
View File
@@ -82,6 +82,8 @@ namespace IRaCIS.Core.Domain.Models
public DateTime? PreliminaryAuditTime { get; set; }
public Guid? ForwardUserId { get; set; }
public DateTime? ForwardTime { get; set; }
// 质控领取人
public Guid? CurrentActionUserId { get; set; }
public DateTime? CurrentActionUserExpireTime { get; set; }
@@ -1,5 +1,7 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace IRaCIS.Core.Infrastructure.Extention
{
@@ -38,7 +40,38 @@ namespace IRaCIS.Core.Infrastructure.Extention
public static string ToJsonNotIgnoreNull(this object obj)
{
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Include });
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", Formatting = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Include });
}
}
public static Dictionary<string, object> ConvertToDictionary(this object obj)
{
if (obj == null)
{
throw new ArgumentNullException(nameof(obj));
}
Type type = obj.GetType();
PropertyInfo[] properties = type.GetProperties();
Dictionary<string, object> dictionary = new Dictionary<string, object>();
foreach (PropertyInfo property in properties)
{
string propertyName = property.Name;
object propertyValue = property.GetValue(obj);
// 如果属性的类型是枚举,将其值保留为整数
if (property.PropertyType.IsEnum)
{
dictionary.Add(propertyName, (int)propertyValue);
}
else
{
dictionary.Add(propertyName, propertyValue);
}
}
return dictionary;
}
}
}
+87 -53
View File
@@ -2,39 +2,73 @@ kind: pipeline
type: docker
name: irc-netcore-api
steps:
- name: docker-build
image: docker
pull: if-not-exists
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: cached_nuget_packages
path: /drone/nuget_packages
commands:
- date +%H:%M:%S
- pwd
- docker build -t Test_Study .
- date +%H:%M:%S
clone:
disable: true #禁用默认克隆
steps:
- name: clone-repo
image: alpine/git
pull: if-not-exists
volumes:
- name: irc-test-work
path: /work
commands:
- if [ ! -e /work/netcore-repo/.git ]; then
git clone -b Test.IRC http://192.168.3.68:2000/XCKJ/irc-netcore-api.git /work/netcore-repo;
else
cd /work/netcore-repo;
git pull;
fi
- |
if [ ! -e Dockerfile ]; then
echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0
EXPOSE 80
WORKDIR /app
COPY publish .
ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]' > /work/Dockerfile
fi
- name: restore-publish
image: mcr.microsoft.com/dotnet/sdk:6.0
pull: if-not-exists
depends_on:
- clone-repo
volumes:
- name: nuget-packages
path: /root/.nuget/packages
- name: irc-test-work
path: /work
commands:
- cd /work/netcore-repo/IRaCIS.Core.API
- dotnet restore ./IRaCIS.Core.API.csproj
- rm -rf /work/publish
- cd /work/netcore-repo/IRaCIS.Core.API
- dotnet publish ./IRaCIS.Core.API.csproj -c Release --no-restore -o /work/publish
- name: docker-build
image: docker
pull: if-not-exists
depends_on:
- restore-publish
commands:
- cd /work
- docker build -t test-irc:v${DRONE_BUILD_NUMBER} .
volumes:
- name: irc-test-work
path: /work
- name: dockersock
path: /var/run/docker.sock
- name: docker-deploy
image: docker
pull: if-not-exists
depends_on:
- docker-build
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- date +%H:%M:%S
- docker rm -f test-study-container
- docker run -itd -e TZ=Asia/Shanghai -e ASPNETCORE_ENVIRONMENT=Test_Study --restart=always --name test-study-container -p 8030:80 Test_Study
- date +%H:%M:%S
volumes:
- name: cached_nuget_packages
- name: nuget-packages
host:
path: /mnt/d/docker_publish/nuget_packages
path: /opt/cicd/nuget/packages
- name: irc-test-work
host:
path: /opt/cicd/irc-test
- name: dockersock
host:
path: /var/run/docker.sock
@@ -44,63 +78,63 @@ trigger:
- master
---
kind: pipeline
type: ssh
name: ssh-windows-test-study-publish
name: ssh-linux-test-irc-publish
platform:
os: windows
arch: amd64
os: Linux
arch: 386
clone:
disable: true #禁用默认克隆
server:
host: 123.56.94.154
user: Administrator
password: WHxckj2019
user: root
password:
from_secret: test_ssh_pwd
steps:
- name: publish-test-study
- name: publish-test-irc
commands:
#拉取代码 并停止服务
- Start-Process "C:\CICD\Test.Study\netcore_Publish.bat" -Wait
- cd C:\CICD\Test.Study\netcore_repo
- dotnet restore .\IRaCIS.Core.API\IRaCIS.Core.API.csproj --packages C:\Users\Administrator\.nuget\packages
- dotnet publish .\IRaCIS.Core.API\IRaCIS.Core.API.csproj -c Release --no-restore --packages C:\Users\Administrator\.nuget\packages -o D:\Develop\Test_Study_PublishSite\IRaCIS.NetCore.API
- Start-Service -Name "Test_Study_API"
- echo start publish test-irc-api
- cd /opt/1panel/hang/devops/test-irc
- sh test-irc.sh v${DRONE_BUILD_NUMBER}
trigger:
branch:
- Test.Study
- Test.IRC
---
kind: pipeline
type: ssh
name: ssh-windows-test-irc-publish
name: ssh-linux-test-study-publish
platform:
os: windows
arch: amd64
os: Linux
arch: 386
clone:
disable: true #禁用默认克隆
server:
host: 123.56.94.154
user: Administrator
password: WHxckj2019
user: root
password:
from_secret: test_ssh_pwd
steps:
- name: publish-test-irc
- name: publish-test-study
commands:
- Start-Process "C:\CICD\Test.IRC\netcore_Publish.bat" -Wait
- echo start publish test-study-api
- cd /opt/1panel/hang/devops/test-study
- sh test-study.sh v${DRONE_BUILD_NUMBER}
trigger:
branch:
- Test.IRC
- Test.Study