Compare commits
13 Commits
af77d5be56
...
85897f990d
| Author | SHA1 | Date |
|---|---|---|
|
|
85897f990d | |
|
|
be477818d7 | |
|
|
41bbb75407 | |
|
|
fd9fdcb8be | |
|
|
0e8ecdaf46 | |
|
|
81b033885e | |
|
|
fca2a81c66 | |
|
|
353f5df217 | |
|
|
4874533804 | |
|
|
025a8e7af1 | |
|
|
79c5824051 | |
|
|
39d9cefda9 | |
|
|
2c0d1cdc82 |
|
|
@ -17,7 +17,7 @@ namespace IRaCIS.Core.API
|
|||
app.UseSerilogRequestLogging(opts
|
||||
=>
|
||||
{
|
||||
opts.MessageTemplate = "{TokenUserRealName} {TokenUserType} {ClientIp} {RequestIP} {Host} {Protocol} {RequestMethod} {RequestPath} {RequestBody} responded {StatusCode} in {Elapsed:0.0000} ms";
|
||||
opts.MessageTemplate = "{TokenUserRealName} {TokenUserTypeShortName} {ClientIp} {LocalIP} {Host} {Protocol} {RequestMethod} {RequestPath} {RequestBody} responded {StatusCode} in {Elapsed:0.0000} ms";
|
||||
opts.EnrichDiagnosticContext = SerilogHelper.EnrichFromRequest;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Serilog;
|
||||
using System;
|
||||
|
|
@ -41,9 +42,9 @@ namespace IRaCIS.Core.API
|
|||
// Set the content-type of the Response at this point
|
||||
diagnosticContext.Set("ContentType", httpContext.Response.ContentType);
|
||||
|
||||
diagnosticContext.Set("TokenUserRealName", httpContext?.User?.FindFirst("realName")?.Value);
|
||||
diagnosticContext.Set("TokenUserRealName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.RealName)?.Value);
|
||||
|
||||
diagnosticContext.Set("TokenUserType", httpContext?.User?.FindFirst("userTypeEnumName")?.Value);
|
||||
diagnosticContext.Set("TokenUserTypeShortName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value);
|
||||
|
||||
// Retrieve the IEndpointFeature selected for the request
|
||||
var endpoint = httpContext.GetEndpoint();
|
||||
|
|
|
|||
|
|
@ -26,24 +26,26 @@ namespace IRaCIS.Core.API
|
|||
|
||||
//控制台 方便调试 问题 我们显示记录日志 时 获取上下文的ip 和用户名 用户类型
|
||||
.WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Warning,
|
||||
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3} ] {LocalIP} {ClientIp} {TokenUserRealName} {TokenUserType} {Message:lj} {Properties:j}{NewLine} {Exception}")
|
||||
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}")
|
||||
|
||||
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,
|
||||
outputTemplate: "{Timestamp:HH:mm:ss} || {Level} || {SourceContext:l} || {Message} ||{Exception} ||end {NewLine}");
|
||||
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}");
|
||||
|
||||
//.WriteTo.MSSqlServer("Data Source=DESKTOP-4TU9A6M;Initial Catalog=CoreFrame;User ID=sa;Password=123456", "logs", autoCreateSqlTable: true, restrictedToMinimumLevel: LogEventLevel.Information)//从左至右四个参数分别是数据库连接字符串、表名、如果表不存在是否创建、最低等级。Serilog会默认创建一些列。
|
||||
|
||||
if (environment == "Production")
|
||||
{
|
||||
config.WriteTo.Email(new EmailConnectionInfo()
|
||||
{
|
||||
EmailSubject = "系统警告,请速速查看!",//邮件标题
|
||||
FromEmail = "test@extimaging.com",//发件人邮箱
|
||||
MailServer = "smtp.qiye.aliyun.com",//smtp服务器地址
|
||||
NetworkCredentials = new NetworkCredential("test@extimaging.com", "SHzyyl2021"),//两个参数分别是发件人邮箱与客户端授权码
|
||||
Port = 465,//端口号
|
||||
ToEmail = "872297557@qq.com"//收件人
|
||||
}, restrictedToMinimumLevel: LogEventLevel.Error,
|
||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [ {Level} {ClientIp} {ClientAgent} {TokenUserRealName} {TokenUserType} ] || [path: {RequestPath} arguments: {RequestBody}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine})");
|
||||
}
|
||||
//if (environment == "Production")
|
||||
//{
|
||||
// config.WriteTo.Email(new EmailConnectionInfo()
|
||||
// {
|
||||
// EmailSubject = "系统警告,请速速查看!",//邮件标题
|
||||
// FromEmail = "test@extimaging.com",//发件人邮箱
|
||||
// MailServer = "smtp.qiye.aliyun.com",//smtp服务器地址
|
||||
// NetworkCredentials = new NetworkCredential("test@extimaging.com", "SHzyyl2021"),//两个参数分别是发件人邮箱与客户端授权码
|
||||
// Port = 465,//端口号
|
||||
// ToEmail = "872297557@qq.com"//收件人
|
||||
// }, restrictedToMinimumLevel: LogEventLevel.Error,
|
||||
// outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [ {Level} {ClientIp} {ClientAgent} {TokenUserRealName} {TokenUserType} ] || [path: {RequestPath} arguments: {RequestBody}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine})");
|
||||
//}
|
||||
|
||||
//扩展方法 获取上下文的ip 用户名 用户类型
|
||||
Log.Logger = config.Enrich.WithHttpContextInfo(serviceProvider).CreateLogger();
|
||||
|
|
|
|||
|
|
@ -163,7 +163,8 @@ namespace IRaCIS.Core.Application.Helper
|
|||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithStreamData(memoryStream);
|
||||
.WithStreamData(memoryStream)
|
||||
.WithObjectSize(memoryStream.Length);
|
||||
|
||||
await minioClient.PutObjectAsync(putObjectArgs);
|
||||
}
|
||||
|
|
@ -179,7 +180,8 @@ namespace IRaCIS.Core.Application.Helper
|
|||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithStreamData(memoryStream);
|
||||
.WithStreamData(memoryStream)
|
||||
.WithObjectSize(memoryStream.Length);
|
||||
|
||||
await minioClient.PutObjectAsync(putObjectArgs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12413,6 +12413,12 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TestService.OldLocalImageResizeJpg(IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)">
|
||||
<summary>
|
||||
维护OSS 影像数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Application.Contracts.DoctorSearchDTO">
|
||||
<summary>
|
||||
Reviewer 列表查询参数
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.Include(t => t.TrialEmailNoticeUserList).Include(t => t.TrialEmailBlackUserList).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false)
|
||||
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false || trialEmailConfig.IsEnable==false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -477,7 +477,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.Include(t => t.TrialEmailNoticeUserList).Include(t => t.TrialEmailBlackUserList).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false)
|
||||
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false || trialEmailConfig.IsEnable==false)
|
||||
{
|
||||
return (null, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,16 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public string[]? VisitPlanArray { get; set; }
|
||||
|
||||
}
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
|
||||
public bool? IsDicom { get; set; }
|
||||
|
||||
public string? Uploader { get; set; }
|
||||
|
||||
public bool? IsSuccess { get; set; }
|
||||
|
||||
public string? StudyCode { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class PreArchiveDicomStudyCommand
|
||||
|
|
@ -215,6 +224,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public int FailedFileCount { get; set; }
|
||||
|
||||
public string RecordPath { get; set; }
|
||||
|
||||
public AddOrUpdateStudyDto Study { get; set; }
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
studyMonitor.UploadFinishedTime = DateTime.Now;
|
||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||
studyMonitor.IsSuccess = true;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount==0;
|
||||
studyMonitor.RecordPath=incommand.RecordPath;
|
||||
|
||||
//上传
|
||||
if (studyMonitor.IsDicomReUpload == false)
|
||||
|
|
@ -209,6 +210,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
//前端传递的数量不准,上传的时候,把失败的也加进来了,以实际数组的数字为准
|
||||
series.InstanceCount = seriesItem.InstanceList.Count;
|
||||
|
||||
await _dicomSeriesRepository.AddAsync(series);
|
||||
|
||||
foreach (var instanceItem in seriesItem.InstanceList)
|
||||
|
|
@ -241,6 +245,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
var study = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
||||
|
||||
//重传的时候也要赋值检查Id
|
||||
studyMonitor.StudyId = study.Id;
|
||||
|
||||
//特殊处理逻辑
|
||||
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Union(study.Modalities.Split("、", StringSplitOptions.RemoveEmptyEntries)).Distinct());
|
||||
|
|
@ -457,6 +463,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom )
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
|
||||
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.StudyCode), t => t.StudyCode.Contains(studyQuery.StudyCode))
|
||||
.Select(t => new UnionStudyMonitorModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
||||
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t=>t.FailedFileCount>0)))
|
||||
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct()) ));
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
siteCommand.Code = await _siteRepository.Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1;
|
||||
|
||||
siteCommand.SiteCode = AppSettings.GetCodeStr(siteCommand.Code, nameof(User));
|
||||
siteCommand.SiteCode = AppSettings.GetCodeStr(siteCommand.Code, nameof(Site));
|
||||
}
|
||||
|
||||
var site = await _siteRepository.InsertOrUpdateAsync(siteCommand, true, exp);
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
|
||||
public string ModalityForEdit { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public bool IsHaveUploadFailed { get; set; }
|
||||
}
|
||||
|
||||
public class QASeriesInfoDto
|
||||
|
|
|
|||
|
|
@ -1099,6 +1099,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public int? Age { get; set; }
|
||||
public string Sex { get; set; } = string.Empty;
|
||||
|
||||
public bool IsHaveUploadFailed { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -395,6 +395,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|| t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count() > 0)
|
||||
|| t.PreviousSurgeryList.Any()))
|
||||
|
||||
.ForMember(d => d.IsHaveUploadFailed, u => u.MapFrom(t => t.StudyList.SelectMany(c=>c.DicomStudyMonitorList).Any(h => h.FailedFileCount>0) ))
|
||||
|
||||
//.ForMember(d => d.VisitName, u => u.MapFrom(t =>t.InPlan? t.VisitStage.VisitName : t.VisitName))
|
||||
//.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitNum : t.VisitNum))
|
||||
//.ForMember(d => d.VisitDay, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitDay : t.VisitDay))
|
||||
|
|
|
|||
|
|
@ -85,7 +85,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public bool IsSuccess { get; set; }
|
||||
|
||||
public string Note = string.Empty;
|
||||
public string Note { get; set; } = string.Empty;
|
||||
|
||||
public string RecordPath { get; set; }=string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue