阅片时间修改
continuous-integration/drone/push Build is passing Details

IRC_NewDev
he 2024-01-12 10:01:37 +08:00
parent ba0b7f33bc
commit 344e8f50ae
6 changed files with 24 additions and 14 deletions

View File

@ -28,6 +28,8 @@ using Aliyun.Acs.Core.Auth.Sts;
using Aliyun.Acs.Core;
using IRaCIS.Core.Application.Helper;
using Microsoft.Extensions.Options;
using IRaCIS.Core.Application.Contracts;
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
namespace IRaCIS.Api.Controllers
{
@ -54,6 +56,7 @@ namespace IRaCIS.Api.Controllers
public async Task<IResponseOutput<DoctorDetailDTO>> GetDoctorDetail([FromServices] IAttachmentService attachmentService, [FromServices] IDoctorService _doctorService,
[FromServices] IEducationService _educationService, [FromServices] ITrialExperienceService _trialExperienceService,
[FromServices] IResearchPublicationService _researchPublicationService, [FromServices] IVacationService _vacationService, Guid doctorId)
{
var education = await _educationService.GetEducation(doctorId);
@ -94,7 +97,10 @@ namespace IRaCIS.Api.Controllers
[HttpPost, Route("user/login")]
[AllowAnonymous]
public async Task<IResponseOutput<LoginReturnDTO>> Login(UserLoginDTO loginUser, [FromServices] IEasyCachingProvider provider, [FromServices] IUserService _userService,
[FromServices] ITokenService _tokenService, [FromServices] IConfiguration configuration)
[FromServices] ITokenService _tokenService,
[FromServices] IReadingImageTaskService readingImageTaskService,
[FromServices] IConfiguration configuration)
{
@ -180,8 +186,9 @@ namespace IRaCIS.Api.Controllers
var userId = returnModel.Data.BasicInfo.Id.ToString();
//provider.Set(userId, userId, TimeSpan.FromMinutes(AppSettings.LoginExpiredTimeSpan));
await provider.SetAsync(userId.ToString(), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
// 验证阅片休息时间
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
await provider.SetAsync(userId.ToString(), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
return returnModel;
}

View File

@ -29,7 +29,7 @@
<param name="doctorId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,Microsoft.Extensions.Configuration.IConfiguration)">
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary> 系统用户登录接口[New] </summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrialInspection(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Application.Contracts.TrialCommand})">

View File

@ -13405,7 +13405,7 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ResetReadingRestTime">
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ResetReadingRestTime(System.Nullable{System.Guid})">
<summary>
重置阅片时间 登录和解锁调用
</summary>

View File

@ -694,9 +694,7 @@ namespace IRaCIS.Application.Services
// 登录 清除缓存
_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
// 阅片时间缓存
await _readingImageTaskService.ResetReadingRestTime();
return ResponseOutput.Ok(userLoginReturnModel);
}

View File

@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
Task ResetReadingRestTime();
Task ResetReadingRestTime(Guid? userId);
}
}

View File

@ -2624,18 +2624,23 @@ namespace IRaCIS.Application.Services
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task ResetReadingRestTime()
public async Task ResetReadingRestTime(Guid? userID)
{
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
if(userID == null)
{
userID = _userInfo.Id;
}
var startReadingTimeKey = userID.ToString() + "StartReadingTime";
var startRestTimeKey = userID.ToString() + "StartRestTime";
//int readingMinute = 120; // 为60整数
int restMinute = 10; //
var startReadingTime = _provider.Get<string>(startReadingTimeKey).Value;
var startRestTime = _provider.Get<string>(startReadingTimeKey).Value;
if (startRestTimeKey != null)
if (startRestTime != null)
{
var cacheStartRestTime = DateTime.Parse(startRestTimeKey!.ToString());
var cacheStartRestTime = DateTime.Parse(startRestTime!.ToString());
int timespanMin = (DateTime.Now - cacheStartRestTime).Minutes;
if (timespanMin > restMinute)
{