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
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2369,16 +2369,15 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// CDISC 导出 和自定义导出 都会配置到表格问题层级,随意配置,所见即所得
|
||||
else /*if (inQuery.ReadingExportType == ExportResult.CDISC)*/
|
||||
// 非肿瘤标准 包括自定义,以及系统非肿瘤 会配置到表格层级 问题名称是 表格名称_表格子问题名
|
||||
else if (
|
||||
criterion.CriterionGroup == CriterionGroup.Nontumorous && inQuery.ReadingExportType != ExportResult.CDISC
|
||||
)
|
||||
{
|
||||
|
||||
// 配置在外层问题 或者表格问题上
|
||||
var taskList = await query.ProjectTo<CommonLessionExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
@@ -2402,18 +2401,31 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
{
|
||||
if (item.LesionList.Count > 0)
|
||||
//有病灶,并且至少配置了一个病灶问题
|
||||
if (item.LesionList.Count > 0 && item.LesionList.SelectMany(t => t.LessionAnswerList).Any())
|
||||
{
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
//病灶配置了问题 才进行导出
|
||||
if (lession.LessionAnswerList.Count > 0)
|
||||
{
|
||||
var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault();
|
||||
var addLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Table Name" : "表格名称", QuestionValue = firstLessionAnser.TableQuestionName });
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.TableQuestionName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
//有三部分组成 外层问题+ 固定列表格名称 + 动态的表格问题
|
||||
var dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
//有三部分组成 外层问题+ 没有配置病灶编号和类型+ 动态的表格问题
|
||||
var dynamicLessionInfoList = item.QuestionAnswerList.Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2425,6 +2437,20 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// CDISC 导出 只管到 外层问题层级 和阅片结果表是保持一致
|
||||
else if (inQuery.ReadingExportType == ExportResult.CDISC)
|
||||
{
|
||||
list = await query.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
{
|
||||
readingExportType = inQuery.ReadingExportType,
|
||||
criterionType = criterion.CriterionType,
|
||||
arbitrationRule = criterion.ArbitrationRule,
|
||||
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||
isEn_Us = _userInfo.IsEn_Us
|
||||
}).ToListAsync();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -24,7 +24,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public string TargetIdentityUserName { get; set; }
|
||||
|
||||
public bool IsLoginUncommonly { get; set; }
|
||||
|
||||
|
||||
public string JsonObj { get; set; }
|
||||
|
||||
public string IPRegion { get; set; }
|
||||
@@ -60,6 +62,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public Guid? IdentityUserId { get; set; }
|
||||
|
||||
public bool? IsLoginUncommonly { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -782,7 +782,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
//检查数据库是否存在该验证码
|
||||
if (verificationRecord == null)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALoginFail }, true);
|
||||
//---验证码错误。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_WrongVerificationCode"]);
|
||||
}
|
||||
@@ -791,7 +790,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
//检查验证码是否失效
|
||||
if (verificationRecord.ExpirationTime < DateTime.Now)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALoginFail }, true);
|
||||
//---验证码已经过期。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
|
||||
}
|
||||
@@ -930,6 +928,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
||||
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
||||
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
||||
.WhereIf(inQuery.IsLoginUncommonly != null, t => t.IsLoginUncommonly == inQuery.IsLoginUncommonly)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.ActionUserName.Contains(inQuery.LoginUserName!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.ActionUserName.Contains(inQuery.LoginFaildName!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
|
||||
@@ -997,9 +996,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _fusionCache.SetAsync<int?>(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
|
||||
var userLog = new UserLog();
|
||||
|
||||
if (failCount >= maxFailures)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.AccountLocked }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.TempLockLogin }, true);
|
||||
|
||||
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
|
||||
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
|
||||
@@ -1025,16 +1026,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
}
|
||||
|
||||
if (loginUser.Status == 0)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = userName, OptType = UserOptType.LoginLockedAccount }, true);
|
||||
//登录用户是系统用户的时候,就要要记录异地登录
|
||||
|
||||
#region 处理用户状态
|
||||
|
||||
//---该用户已经被禁用。
|
||||
return ResponseOutput.NotOk(_localizer["User_Disabled"], new IRCLoginReturnDTO());
|
||||
}
|
||||
|
||||
//登录成功 清除缓存
|
||||
await _fusionCache.SetAsync(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
var ipinfo = _searcher.Search(_userInfo.IP);
|
||||
|
||||
var iPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
|
||||
@@ -1047,20 +1043,33 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (loginUser.LastLoginIP != string.Empty)
|
||||
{
|
||||
// 与上一次IP不一致
|
||||
if (SplitAndConcatenate(loginUser.LastLoginIP) !=SplitAndConcatenate(iPRegion))
|
||||
// 与上一次区域不一致
|
||||
if (SplitAndConcatenate(loginUser.LastLoginIP) != SplitAndConcatenate(iPRegion))
|
||||
{
|
||||
loginUser.LoginState = 2;
|
||||
}
|
||||
}
|
||||
|
||||
//超过90天没修改密码
|
||||
if (_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
|
||||
{
|
||||
loginUser.LoginState = 1;
|
||||
}
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, OptType = UserOptType.Login }, true);
|
||||
#endregion
|
||||
|
||||
if (loginUser.Status == 0)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = userName, OptType = UserOptType.LoginLockedAccount, IsLoginUncommonly = (loginUser.LoginState == 2) }, true);
|
||||
|
||||
//---该用户已经被禁用。
|
||||
return ResponseOutput.NotOk(_localizer["User_Disabled"], new IRCLoginReturnDTO());
|
||||
}
|
||||
|
||||
//登录成功 清除缓存
|
||||
await _fusionCache.SetAsync(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, OptType = UserOptType.Login, IsLoginUncommonly = (loginUser.LoginState == 2) }, true);
|
||||
|
||||
userLoginReturnModel.BasicInfo = loginUser;
|
||||
|
||||
|
||||
@@ -1269,20 +1269,34 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public class CommonLessionQuestionAnswerInfo
|
||||
{
|
||||
#region 肿瘤评估标准的时候需要
|
||||
public string LessionCode { get; set; }
|
||||
|
||||
public string LessionType { get; set; }
|
||||
|
||||
|
||||
public QuestionMark? QuestionMark { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region CDISC导出
|
||||
|
||||
public string CDISCCode { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 自定义表格名 特殊处理
|
||||
|
||||
public string TableQuestionName { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
public string QuestionValue { get; set; }
|
||||
|
||||
public string TranslateDicName { get; set; }
|
||||
|
||||
public string CDISCCode { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
u.Subject.ReadModuleList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.ReadingSetType == ReadingSetType.ImageReading).Select(c => c.SubjectVisit.VisitNum)))
|
||||
|
||||
.ForMember(o => o.ResearchProgramNo, t => t.MapFrom(u => u.Trial.ResearchProgramNo))
|
||||
.ForMember(o => o.VisitName, t => t.MapFrom(u => u.SourceSubjectVisit.VisitName))
|
||||
.ForMember(o => o.VisitName, t => t.MapFrom(u => u.SourceSubjectVisit.VisitName))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.LatestScanDate, t => t.MapFrom(u => u.SourceSubjectVisit.LatestScanDate))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
@@ -286,7 +286,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<VisitTask, CommonLessionExport>()
|
||||
.IncludeBase<VisitTask, CommonEvaluationExport>()
|
||||
.ForMember(o => o.LesionList, t => t.MapFrom(u => u.LesionList.Where(c => c.ReadingQuestionTrial.ExportResultStr.Contains(((int)readingExportType).ToString()))));
|
||||
.ForMember(o => o.LesionList, t => t.MapFrom(u => u.LesionList/*.Where(c => c.ReadingQuestionTrial.ExportResultStr.Contains(((int)readingExportType).ToString()))*/ ));
|
||||
|
||||
CreateMap<ReadingTableAnswerRowInfo, CommonLessionInfo>()
|
||||
.ForMember(o => o.LessionCode, t => t.MapFrom(u => u.RowMark))
|
||||
@@ -299,7 +299,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.QuestionMark, t => t.MapFrom(u => u.ReadingTableQuestionTrial.QuestionMark))
|
||||
.ForMember(o => o.QuestionName, t => t.MapFrom(u => isEn_Us ? u.ReadingTableQuestionTrial.QuestionEnName : u.ReadingTableQuestionTrial.QuestionName))
|
||||
.ForMember(o => o.QuestionValue, t => t.MapFrom(u => u.Answer))
|
||||
.ForMember(o => o.CDISCCode, t => t.MapFrom(u => u.ReadingTableQuestionTrial.CDISCCode))
|
||||
.ForMember(o => o.CDISCCode, t => t.MapFrom(u => u.ReadingTableQuestionTrial.CDISCCode))
|
||||
.ForMember(o => o.TableQuestionName, t => t.MapFrom(u => isEn_Us ? u.ReadingQuestionTrial.QuestionEnName : u.ReadingQuestionTrial.QuestionName))
|
||||
.ForMember(o => o.TranslateDicName, t => t.MapFrom(u => u.ReadingTableQuestionTrial.DictionaryCode))
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user