修改代码

Uat_Study
hang 2023-04-28 13:45:08 +08:00
parent 466ac5e03e
commit bca9993e68
4 changed files with 111 additions and 23 deletions

View File

@ -1492,6 +1492,13 @@
<returns></returns>
</member>
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetNewLesionAssessment(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)" -->
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetNewLesionIRECSITEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取新病灶评估
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetIRECSITTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)" -->
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)" -->
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetNoTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
@ -1501,6 +1508,13 @@
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetNewLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取新病灶评估
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.PCWG3CalculateService.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
<summary>
删除病灶获取起始病灶序号

View File

@ -8,6 +8,9 @@ using Panda.DynamicWebApi.Attributes;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Caching.Memory;
using IRaCIS.Core.Infra.Common.Cache;
using Microsoft.Identity.Client;
using static IRaCIS.Core.Domain.Share.StaticData;
namespace IRaCIS.Application.Services
{
@ -613,6 +616,38 @@ namespace IRaCIS.Application.Services
[NonDynamicMethod]
public async Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password)
{
//const string cachePrefix = "login-failures:";
//const int maxFailures = 3;
//const int lockoutMinutes = 3;
//// 生成缓存键
//string cacheKey = $"{cachePrefix}{userName}";
//// 从缓存中获取登录失败次数
//int? failCount = _cache.Get<int?>(cacheKey);
//if (failCount != null)
//{
// _cache.Set(cacheKey + ":locked", true, TimeSpan.FromMinutes(lockoutMinutes));
// if (failCount >= maxFailures)
// {
// throw new BusinessValidationFailedException($"账号已被锁定,请等待 {lockoutMinutes} 分钟后再试。");
// }
//}
//if (failCount >= maxFailures)
//{
// // 如果登录失败次数达到了 3 次,则锁定用户
// _cache.Set(cacheKey + ":locked", true, TimeSpan.FromMinutes(lockoutMinutes));
//}
var userLoginReturnModel = new LoginReturnDTO();
@ -620,21 +655,30 @@ namespace IRaCIS.Application.Services
if (loginUser == null)
{
//此处下面 代码 为了支持医生也能登录 而且前端不加选择到底是管理用户 还是医生用户 奇怪的需求 无法理解
var loginDoctor = await _doctorRepository.Where(u => u.Phone == userName && u.Password == password).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
#region 屏蔽代码,现在没用到
////此处下面 代码 为了支持医生也能登录 而且前端不加选择到底是管理用户 还是医生用户 奇怪的需求 无法理解
if (loginDoctor == null)
{
return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new LoginReturnDTO());
//var loginDoctor = await _doctorRepository.Where(u => u.Phone == userName && u.Password == password).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
}
//if (loginDoctor == null)
//{
// return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new LoginReturnDTO());
//}
//userLoginReturnModel.BasicInfo = loginDoctor;
//登录 清除缓存
//_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
//return ResponseOutput.Ok(userLoginReturnModel);
#endregion
return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new LoginReturnDTO());
userLoginReturnModel.BasicInfo = loginDoctor;
// 登录 清除缓存
_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
return ResponseOutput.Ok(userLoginReturnModel);
}
@ -652,5 +696,35 @@ namespace IRaCIS.Application.Services
}
//private bool loginIsLocked(string userName)
//{
// //if (failCount == null)
// //{
// // failCount = 0;
// //}
// //else
// //{
// // failCount++;
// //}
// //// 更新缓存中的登录失败次数
// //_cache.Set(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
// //if (failCount >= maxFailures)
// //{
// // // 如果登录失败次数达到了 3 次,则锁定用户
// // _cache.Set(cacheKey + ":locked", true, TimeSpan.FromMinutes(lockoutMinutes));
// //}
// //return isLocked;
//}
}
}

View File

@ -18,9 +18,9 @@ namespace IRaCIS.Core.Domain.Models
public class SubjectCriteriaEvaluationVisitFilter : Entity, IAuditUpdate, IAuditAdd
{
[JsonIgnore]
//[JsonIgnore]
public List<VisitTask> SubjectCriterionTaskList { get; set; }
//public List<VisitTask> SubjectCriterionTaskList { get; set; }
[JsonIgnore]
[ForeignKey("TrialReadingCriterionId")]
public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }

View File

@ -36,18 +36,18 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
}
}
public class SubjectCriteriaEvaluationVisitFilterConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluationVisitFilter>
{
//public class SubjectCriteriaEvaluationVisitFilterConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluationVisitFilter>
//{
public void Configure(EntityTypeBuilder<SubjectCriteriaEvaluationVisitFilter> builder)
{
builder
.HasMany(s => s.SubjectCriterionTaskList)
.WithOne(c => c.SubjectCriteriaEvaluationVisitFilter)
.HasForeignKey(s => new { s.SubjectId, s.TrialReadingCriterionId })
.HasPrincipalKey(c => new { c.SubjectId, c.TrialReadingCriterionId });
// public void Configure(EntityTypeBuilder<SubjectCriteriaEvaluationVisitFilter> builder)
// {
// builder
// .HasMany(s => s.SubjectCriterionTaskList)
// .WithOne(c => c.SubjectCriteriaEvaluationVisitFilter)
// .HasForeignKey(s => new { s.SubjectId, s.TrialReadingCriterionId })
// .HasPrincipalKey(c => new { c.SubjectId, c.TrialReadingCriterionId });
}
}
// }
//}
}