From 2139193df442fbce45bdd61b2b99ba7acc3bb867 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 29 Dec 2023 17:35:11 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E6=B8=85=E7=90=86=E8=A3=81=E5=88=A4?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs b/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs index 221170b56..034dd3c69 100644 --- a/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs @@ -108,7 +108,7 @@ namespace IRaCIS.Core.Application.Triggers if (find != null) { var ids = new Guid[] { find.TaskIdOne, find.TaskIdTwo }; - await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => ids.Contains(t.Id), u => new VisitTask() { JudgeResultTaskId = null }); + await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => ids.Contains(t.Id), u => new VisitTask() { JudgeVisitTaskId = null }); } } } From 69c5ce9841649e894c262662429391fdd0b5a080 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 22 Dec 2023 17:28:48 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=9F=A5=E8=AF=A2=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/PersonalWorkstation.cs | 5 +++-- IRaCIS.Core.Domain/Visit/SubjectVisit.cs | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index e3d943dc5..35a614438 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -694,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() @@ -709,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(); diff --git a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs index e00d65c47..46f1c9370 100644 --- a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs +++ b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs @@ -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; } From c71bf65cd9482456988950970de0f3c3576551ba Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 26 Dec 2023 09:24:29 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=BA=9F=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Document/TrialDocumentService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index c4629983e..403151fc0 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -658,7 +658,7 @@ namespace IRaCIS.Core.Application.Services /// /// [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 UserAbandonDoc(Guid documentId, bool isSystemDoc) { if (isSystemDoc) From be5c9b636e81e68c15fcfa18a6613f38d95a41ca Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 29 Dec 2023 10:19:46 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E9=82=AE=E4=BB=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Common/MailService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index e41a99c63..0b6a254ab 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -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 ); } From a536c33302bccb7594ad030659b497a3caf7877c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 09:29:07 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=93=E5=8C=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- irc_api.drone.yml | 176 +++++++++++++++++++++++++++------------------- 1 file changed, 105 insertions(+), 71 deletions(-) diff --git a/irc_api.drone.yml b/irc_api.drone.yml index 7fc06efa3..2ca805375 100644 --- a/irc_api.drone.yml +++ b/irc_api.drone.yml @@ -2,105 +2,139 @@ 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 trigger: branch: - - master - + - master + +--- +kind: pipeline +type: ssh +name: ssh-linux-test-irc-publish + +platform: + os: Linux + arch: 386 + +clone: + disable: true #禁用默认克隆 + +server: + host: 123.56.94.154 + user: root + password: + from_secret: test_ssh_pwd + +steps: +- name: publish-test-irc + commands: + - echo start publish test-irc-api + - cd /opt/1panel/hang/devops/test-irc + - sh test-irc.sh v${DRONE_BUILD_NUMBER} + +trigger: + branch: + - Test.IRC + --- kind: pipeline type: ssh -name: ssh-windows-test-study-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-study +- name: publish-test-study 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-study-api + - cd /opt/1panel/hang/devops/test-study + - sh test-study.sh v${DRONE_BUILD_NUMBER} trigger: branch: - Test.Study - ---- - - -kind: pipeline -type: ssh -name: ssh-windows-test-irc-publish - -platform: - os: windows - arch: amd64 - -clone: - disable: true #禁用默认克隆 - -server: - host: 123.56.94.154 - user: Administrator - password: WHxckj2019 - -steps: -- name: publish-test-irc - commands: - - Start-Process "C:\CICD\Test.IRC\netcore_Publish.bat" -Wait - -trigger: - branch: - - Test.IRC \ No newline at end of file + \ No newline at end of file From ae4345cfccada17dca16ad7141566c867b9c7fcf Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 10:06:30 +0800 Subject: [PATCH 06/18] =?UTF-8?q?x=20=E7=9B=91=E6=8E=A7=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 49f697756..9c4f50792 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - watcher.EnableRaisingEvents = true; + //watcher.EnableRaisingEvents = true; } From 572d4ea4b88f632e3b9286036f6ac836e2c1fca2 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 11:05:19 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker-compose=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=89=93=E5=BC=80=E6=96=87=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=B7=9F=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 9c4f50792..49f697756 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - //watcher.EnableRaisingEvents = true; + watcher.EnableRaisingEvents = true; } From a63904c0bbdb726540f14527c25390cc66bfbb98 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 11:11:57 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 49f697756..9c4f50792 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - watcher.EnableRaisingEvents = true; + //watcher.EnableRaisingEvents = true; } From c971161d314d6ba9fec1b30f6dc89a64d85fe335 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 11:19:07 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9utf-8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Startup.cs | 66 +++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index f7ef89e47..9d7a01577 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -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(); #region Test - //containerBuilder.RegisterType().PropertiesAutowired().InstancePerLifetimeScope();//עִ + //containerBuilder.RegisterType().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(); @@ -95,7 +95,7 @@ namespace IRaCIS.Core.API }) - .AddNewtonsoftJsonSetup(); // NewtonsoftJson л + .AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理 services.AddOptions().Configure(_configuration.GetSection("SystemEmailSendConfig")); services.AddOptions().Configure(_configuration.GetSection("BasicSystemConfig")); @@ -103,62 +103,62 @@ namespace IRaCIS.Core.API services.AddOptions().Configure(_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()); - // 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(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(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(); - // 쳣 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(); await hangfireJobService.InitHangfireJobTaskAsync(); - //еʱÿ + //有的时候每调用 //HangfireJobHelper.NotImmediatelyOnceOnlyJob(t => t.InitHangfireJobTaskAsync(),TimeSpan.FromSeconds(1)); From 3e046e24e904a069c1a099755e68d1aedff59e15 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 11:43:04 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs | 2 ++ IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 61e990f2a..39171ec85 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -1383,6 +1383,8 @@ namespace IRaCIS.Core.Application.Contracts public DateTime? SubmitTime { get; set; } + public string SubmitUserName { get; set; } = String.Empty; + public string CurrentActionUserName { get; set; } = String.Empty; public string PreliminaryAuditUserName { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 07f3b8df1..3bc114d24 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -364,6 +364,8 @@ 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.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)) From bc67f167350c67368a72eebc159806777cfb8327 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 12:13:47 +0800 Subject: [PATCH 11/18] =?UTF-8?q?docker=20=E9=83=A8=E7=BD=B2=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 9c4f50792..49f697756 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - //watcher.EnableRaisingEvents = true; + watcher.EnableRaisingEvents = true; } From 86db676df827b8b234165a708df2c66c3ced506f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:12:36 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=9C=A8=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E9=87=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 49f697756..ebe020864 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - watcher.EnableRaisingEvents = true; + watcher.EnableRaisingEvents = false; } From 074cba906c8d102e59d7aa9c4ce131d746b25244 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:18:11 +0800 Subject: [PATCH 13/18] xx --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index ebe020864..ca7d63bb5 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - watcher.EnableRaisingEvents = false; + //watcher.EnableRaisingEvents = false; } From 75bf85997a950af65b0320c11f3078b4a554a4db Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:20:27 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=83=AD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.API/Program.cs b/IRaCIS.Core.API/Program.cs index 38f1a2ee5..ddb3fea85 100644 --- a/IRaCIS.Core.API/Program.cs +++ b/IRaCIS.Core.API/Program.cs @@ -49,8 +49,8 @@ namespace IRaCIS.Core.API { //Console.WriteLine(hostContext.HostingEnvironment.EnvironmentName); - config.AddJsonFile("appsettings.json", false, true) - .AddJsonFile($"appsettings.{enviromentName}.json", false, true); + config.AddJsonFile("appsettings.json", false, false) + .AddJsonFile($"appsettings.{enviromentName}.json", false, false); }) .Build(); From 1bcc8319376e6fb4b154273e7e1fff2c3d24009e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:32:03 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E4=B8=8D=E7=9B=91=E6=B5=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index ca7d63bb5..56ac85e0c 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -124,8 +124,8 @@ namespace IRaCIS.Application.Services.BackGroundJob throw new BusinessValidationFailedException(StaticData.International("IRaCISCHangfireJob_FileNotFound")); } - FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); - watcher.Changed += (sender, e) => LoadJsonFile(filePath); + //FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); + //watcher.Changed += (sender, e) => LoadJsonFile(filePath); //watcher.EnableRaisingEvents = false; } From df2f179917d4413c3898b51b6c16cf821745573a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:39:17 +0800 Subject: [PATCH 16/18] xx --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 56ac85e0c..ebe020864 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -124,9 +124,9 @@ namespace IRaCIS.Application.Services.BackGroundJob throw new BusinessValidationFailedException(StaticData.International("IRaCISCHangfireJob_FileNotFound")); } - //FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); - //watcher.Changed += (sender, e) => LoadJsonFile(filePath); - //watcher.EnableRaisingEvents = false; + FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); + watcher.Changed += (sender, e) => LoadJsonFile(filePath); + watcher.EnableRaisingEvents = false; } From 24a395f8c879ad675982797905067a6e42d3faed Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:42:01 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs | 2 ++ IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 39171ec85..160b08806 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -1385,6 +1385,8 @@ namespace IRaCIS.Core.Application.Contracts 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; diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 3bc114d24..6ab146a12 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -366,6 +366,8 @@ namespace IRaCIS.Core.Application.Service .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)) From 7a7011e7ef89664bd15ad74e27e9381a8f5d407c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 3 Jan 2024 13:43:31 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E6=89=93=E5=BC=80=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Program.cs | 4 ++-- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.API/Program.cs b/IRaCIS.Core.API/Program.cs index ddb3fea85..38f1a2ee5 100644 --- a/IRaCIS.Core.API/Program.cs +++ b/IRaCIS.Core.API/Program.cs @@ -49,8 +49,8 @@ namespace IRaCIS.Core.API { //Console.WriteLine(hostContext.HostingEnvironment.EnvironmentName); - config.AddJsonFile("appsettings.json", false, false) - .AddJsonFile($"appsettings.{enviromentName}.json", false, false); + config.AddJsonFile("appsettings.json", false, true) + .AddJsonFile($"appsettings.{enviromentName}.json", false, true); }) .Build(); diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index ebe020864..49f697756 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services.BackGroundJob FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); watcher.Changed += (sender, e) => LoadJsonFile(filePath); - watcher.EnableRaisingEvents = false; + watcher.EnableRaisingEvents = true; }