阅片时间修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ba0b7f33bc
commit
344e8f50ae
|
@ -28,6 +28,8 @@ using Aliyun.Acs.Core.Auth.Sts;
|
||||||
using Aliyun.Acs.Core;
|
using Aliyun.Acs.Core;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||||
|
|
||||||
namespace IRaCIS.Api.Controllers
|
namespace IRaCIS.Api.Controllers
|
||||||
{
|
{
|
||||||
|
@ -54,6 +56,7 @@ namespace IRaCIS.Api.Controllers
|
||||||
|
|
||||||
public async Task<IResponseOutput<DoctorDetailDTO>> GetDoctorDetail([FromServices] IAttachmentService attachmentService, [FromServices] IDoctorService _doctorService,
|
public async Task<IResponseOutput<DoctorDetailDTO>> GetDoctorDetail([FromServices] IAttachmentService attachmentService, [FromServices] IDoctorService _doctorService,
|
||||||
[FromServices] IEducationService _educationService, [FromServices] ITrialExperienceService _trialExperienceService,
|
[FromServices] IEducationService _educationService, [FromServices] ITrialExperienceService _trialExperienceService,
|
||||||
|
|
||||||
[FromServices] IResearchPublicationService _researchPublicationService, [FromServices] IVacationService _vacationService, Guid doctorId)
|
[FromServices] IResearchPublicationService _researchPublicationService, [FromServices] IVacationService _vacationService, Guid doctorId)
|
||||||
{
|
{
|
||||||
var education = await _educationService.GetEducation(doctorId);
|
var education = await _educationService.GetEducation(doctorId);
|
||||||
|
@ -94,7 +97,10 @@ namespace IRaCIS.Api.Controllers
|
||||||
[HttpPost, Route("user/login")]
|
[HttpPost, Route("user/login")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput<LoginReturnDTO>> Login(UserLoginDTO loginUser, [FromServices] IEasyCachingProvider provider, [FromServices] IUserService _userService,
|
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();
|
var userId = returnModel.Data.BasicInfo.Id.ToString();
|
||||||
//provider.Set(userId, userId, TimeSpan.FromMinutes(AppSettings.LoginExpiredTimeSpan));
|
//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;
|
return returnModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<param name="doctorId"></param>
|
<param name="doctorId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</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>
|
<summary> 系统用户登录接口[New] </summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrialInspection(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Application.Contracts.TrialCommand})">
|
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrialInspection(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Application.Contracts.TrialCommand})">
|
||||||
|
|
|
@ -13405,7 +13405,7 @@
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ResetReadingRestTime">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ResetReadingRestTime(System.Nullable{System.Guid})">
|
||||||
<summary>
|
<summary>
|
||||||
重置阅片时间 登录和解锁调用
|
重置阅片时间 登录和解锁调用
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -694,9 +694,7 @@ namespace IRaCIS.Application.Services
|
||||||
// 登录 清除缓存
|
// 登录 清除缓存
|
||||||
_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
|
_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
|
||||||
|
|
||||||
// 阅片时间缓存
|
|
||||||
|
|
||||||
await _readingImageTaskService.ResetReadingRestTime();
|
|
||||||
return ResponseOutput.Ok(userLoginReturnModel);
|
return ResponseOutput.Ok(userLoginReturnModel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
||||||
|
|
||||||
Task ResetReadingRestTime();
|
Task ResetReadingRestTime(Guid? userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2624,18 +2624,23 @@ namespace IRaCIS.Application.Services
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task ResetReadingRestTime()
|
public async Task ResetReadingRestTime(Guid? userID)
|
||||||
{
|
{
|
||||||
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
|
if(userID == null)
|
||||||
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
|
{
|
||||||
|
userID = _userInfo.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
var startReadingTimeKey = userID.ToString() + "StartReadingTime";
|
||||||
|
var startRestTimeKey = userID.ToString() + "StartRestTime";
|
||||||
//int readingMinute = 120; // 为60整数
|
//int readingMinute = 120; // 为60整数
|
||||||
int restMinute = 10; //
|
int restMinute = 10; //
|
||||||
|
|
||||||
var startReadingTime = _provider.Get<string>(startReadingTimeKey).Value;
|
var startReadingTime = _provider.Get<string>(startReadingTimeKey).Value;
|
||||||
var startRestTime = _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;
|
int timespanMin = (DateTime.Now - cacheStartRestTime).Minutes;
|
||||||
if (timespanMin > restMinute)
|
if (timespanMin > restMinute)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue