study去掉疲劳阅片
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
88f015183d
commit
eb1d90e304
|
@ -2498,51 +2498,51 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task VerifyReadingRestTime()
|
public async Task VerifyReadingRestTime()
|
||||||
{
|
{
|
||||||
var cacheKey = _userInfo.Id.ToString() + "RestTime";
|
//var cacheKey = _userInfo.Id.ToString() + "RestTime";
|
||||||
|
|
||||||
|
|
||||||
var value = _provider.Get<string>(cacheKey).Value;
|
//var value = _provider.Get<string>(cacheKey).Value;
|
||||||
if (value == null)
|
//if (value == null)
|
||||||
{
|
//{
|
||||||
_provider.Set(cacheKey, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(5));
|
// _provider.Set(cacheKey, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(5));
|
||||||
// _cache.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
// // _cache.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
#region 两小时
|
// #region 两小时
|
||||||
var cacheDate = DateTime.Parse(value.ToString());
|
// var cacheDate = DateTime.Parse(value.ToString());
|
||||||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
// int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
if (timespanMin > 120 && timespanMin < 140)
|
// if (timespanMin > 120 && timespanMin < 140)
|
||||||
{
|
// {
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
// throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
||||||
}
|
// }
|
||||||
else if (timespanMin > 140)
|
// else if (timespanMin > 140)
|
||||||
{
|
// {
|
||||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140))) * 140);
|
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140))) * 140);
|
||||||
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// _provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// // _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
}
|
// }
|
||||||
#endregion
|
// #endregion
|
||||||
|
|
||||||
#region 测试用的5分钟
|
// #region 测试用的5分钟
|
||||||
//var cacheDate = DateTime.Parse(value.ToString());
|
// //var cacheDate = DateTime.Parse(value.ToString());
|
||||||
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
// //int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
//if (timespanMin >= 5 && timespanMin <= 10)
|
// //if (timespanMin >= 5 && timespanMin <= 10)
|
||||||
//{
|
// //{
|
||||||
// throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
// // throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
||||||
//}
|
// //}
|
||||||
//else if (timespanMin > 10)
|
// //else if (timespanMin > 10)
|
||||||
//{
|
// //{
|
||||||
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
// // cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
||||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// // _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
//}
|
// //}
|
||||||
#endregion
|
// #endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue