Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2026-02-12 03:15:56 -05:00
commit ebcf3c95e2
8 changed files with 43 additions and 25 deletions

View File

@ -279,7 +279,7 @@ namespace IRaCIS.Api.Controllers
var isExpire = _tokenService.IsTokenExpired(token);
if (!await _useRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd) || isExpire)
if ( Guid.TryParse(userId,out _) == false || isExpire || !await _useRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd) )
{
decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(I18n.T("UserRedirect_InitializationLinkExpire"))} ";
}

View File

@ -4,7 +4,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:3305",
"applicationUrl": "http://0.0.0.0:3305",
"sslPort": 0
}
},
@ -23,7 +23,7 @@
"ASPNETCORE_ENVIRONMENT": "Test_IRC",
"ASPNETCORE_OpenSwagger": "true"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
},
"IRaCIS.Test_IRC_PGSQL": {
"commandName": "Project",
@ -31,7 +31,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Test_IRC_PGSQL"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
},
"IRaCIS.Event_IRC": {
"commandName": "Project",
@ -39,7 +39,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Event_IRC"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
},
"Docker": {
"commandName": "Docker",
@ -53,7 +53,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Uat_IRC"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
},
"IRaCIS.Prod_IRC": {
"commandName": "Project",
@ -61,7 +61,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Prod_IRC"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
},
"IRaCIS.US_Uat_IRC": {
"commandName": "Project",
@ -69,7 +69,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "US_Uat_IRC"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
},
"IRaCIS.US_Prod_IRC": {
"commandName": "Project",
@ -77,7 +77,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "US_Prod_IRC"
},
"applicationUrl": "http://localhost:6100"
"applicationUrl": "http://0.0.0.0:6100"
}
}

View File

@ -45,7 +45,7 @@ namespace IRaCIS.Core.API
}
else
{
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure());
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure()/*.CommandTimeout(60)*/);
}

View File

@ -471,7 +471,10 @@ namespace IRaCIS.Core.Application.Service.Common
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false) && t.IsDeleted == false)
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP,
t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false)
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserRoleList.Any(t => t.UserRole.IdentityUser.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
.Select(t => new TrialToBeDoneDto()

View File

@ -53,6 +53,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
IDistributedLockProvider _distributedLockProvider,
IRepository<TrialImageDownload> _trialImageDownloadRepository,
IRepository<Subject> _subjectRepository,
IRepository<DicomInstance> _instanceRepository,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IDownloadAndUploadService
{
@ -1141,7 +1142,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var info = await _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).Select(t => new { t.Trial.TrialCode }).FirstOrDefaultAsync();
//有传输语法值的导出 才生成DIR
if (_subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList)).All(c => c.TransferSytaxUID != string.Empty))
//if (_subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList)).All(c => c.TransferSytaxUID != string.Empty))
if (!_instanceRepository.Where(t => inQuery.SubjectVisitId == t.SubjectVisitId).Any(c => c.TransferSytaxUID == string.Empty))
{
var list = _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).SelectMany(t => t.StudyList)
.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false)
@ -2258,8 +2260,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{
#region 在下载前先处理DIR文件
//sql 超时
//_subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id))
// .SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true)))
// .All(c => c.TransferSytaxUID != string.Empty)
//有传输语法值的导出 才生成DIR
if (_subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id)).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true))).All(c => c.TransferSytaxUID != string.Empty))
if (!_instanceRepository.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true)
.Where(t => inCommand.SubjectVisitIdList.Contains(t.SubjectVisitId)).Any(c => c.TransferSytaxUID == string.Empty))
{
var dirInfolist = _subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id)).SelectMany(t => t.StudyList)
.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true))

View File

@ -94,6 +94,10 @@ namespace IRaCIS.Application.Contracts
public string UserCode { get; set; }
public string EMail { get; set; }
public string HiddenEmail { get; set; }
public int Status { get; set; }
public bool IsTestUser { get; set; }
public bool IsZhiZhun { get; set; }

View File

@ -936,11 +936,11 @@ namespace IRaCIS.Core.Application.Service
[AllowAnonymous]
[HttpGet]
public async Task<IResponseOutput> LoginOut(Guid identityUserId, Guid userRoleId)
public async Task<IResponseOutput> LoginOut(Guid identityUserId, Guid? userRoleId)
{
await _fusionCache.RemoveAsync(CacheKeys.UserToken(identityUserId));
if (_identityUserRepository.Any(t => t.Id == identityUserId))
if (_identityUserRepository.Any(t => t.Id == identityUserId) && userRoleId != null)
{
var userName = await _userRoleRepository.Where(t => t.Id == userRoleId).Select(t => t.IdentityUser.UserName).FirstOrDefaultAsync();
@ -1207,7 +1207,7 @@ namespace IRaCIS.Core.Application.Service
var hiddenEmail = IRCEmailPasswordHelper.MaskEmail(email);
userLoginReturnModel.BasicInfo.EMail = hiddenEmail;
userLoginReturnModel.BasicInfo.HiddenEmail = hiddenEmail;
//修改密码 || 90天修改密码再mfa 之前
if (userLoginReturnModel.BasicInfo.IsFirstAdd || userLoginReturnModel.BasicInfo.NeedChangePassWord)
@ -1223,6 +1223,10 @@ namespace IRaCIS.Core.Application.Service
}
}
else
{
userLoginReturnModel.BasicInfo.HiddenEmail = userLoginReturnModel.BasicInfo.EMail;
}
await _fusionCache.SetAsync(CacheKeys.UserToken(identityUserId), userLoginReturnModel.JWTStr, TimeSpan.FromDays(7));

View File

@ -1151,7 +1151,7 @@ namespace IRaCIS.Core.Application
.Where(c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
&& !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null)).Count() > 0).CountAsync();
var needSignSysDocCont = await _systemDocumentRepository.AsQueryable(true)
var needSignSysDocCont = await _systemDocumentRepository.Where(t => t.IsPublish)
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null))
//外部人员 只签署 外部需要签署的
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
@ -1159,19 +1159,19 @@ namespace IRaCIS.Core.Application
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);
//电子阅片声明是否已经签署
var isfirstSysDocNeedSign = await _systemDocumentRepository.AsQueryable(true)
var isfirstSysDocNeedSign = await _systemDocumentRepository.Where(t => t.IsPublish)
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null))
//外部人员 只签署 外部需要签署的
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
.SelectMany(t => t.NeedConfirmedUserTypeList)
.AnyAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId && t.SystemDocument.FileType.Code == "-1");
var signedTrialCount = await _trialDocumentRepository.AsQueryable(true)
var signedTrialCount = await _trialDocumentRepository.Where(t => t.IsPublish)
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.Where(t => t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null)).CountAsync();
var signedSysDocCont = await _systemDocumentRepository.AsQueryable(true)
var signedSysDocCont = await _systemDocumentRepository.Where(t=>t.IsPublish)
.Where(t => t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null))
.SelectMany(t => t.NeedConfirmedUserTypeList)
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);