修改一版
parent
1eb5cabd3e
commit
83909a58ed
|
@ -1377,35 +1377,35 @@ namespace IRaCIS.Application.Services
|
|||
else
|
||||
{
|
||||
#region 两小时
|
||||
//var cacheDate = DateTime.Parse(value.ToString());
|
||||
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||
//if (timespanMin > 120 && timespanMin < 140)
|
||||
//{
|
||||
// throw new BusinessValidationFailedException("您已连续阅片两个小时,请休息一会!");
|
||||
//}
|
||||
//else if (timespanMin > 140)
|
||||
//{
|
||||
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140)))*140);
|
||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 测试用的5分钟
|
||||
var cacheDate = DateTime.Parse(value.ToString());
|
||||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||
if (timespanMin > 5 && timespanMin < 10)
|
||||
if (timespanMin > 120 && timespanMin < 140)
|
||||
{
|
||||
throw new BusinessValidationFailedException("您已连续阅片两个小时,请休息一会!");
|
||||
throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
||||
}
|
||||
else if (timespanMin > 10)
|
||||
else if (timespanMin > 140)
|
||||
{
|
||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140))) * 140);
|
||||
_cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 测试用的5分钟
|
||||
//var cacheDate = DateTime.Parse(value.ToString());
|
||||
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||
//if (timespanMin >= 5 && timespanMin <= 10)
|
||||
//{
|
||||
// throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
||||
//}
|
||||
//else if (timespanMin > 10)
|
||||
//{
|
||||
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue