脾脏验证
This commit is contained in:
+23
-23
@@ -2586,34 +2586,34 @@ namespace IRaCIS.Application.Services
|
||||
else
|
||||
{
|
||||
#region 两小时
|
||||
//var cacheDate = DateTime.Parse(value.ToString());
|
||||
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||
//if (timespanMin > 120 && timespanMin < 130)
|
||||
//{
|
||||
// throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
||||
//}
|
||||
//else if (timespanMin > 130)
|
||||
//{
|
||||
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 130))) * 130);
|
||||
// _provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
// // _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
var cacheDate = DateTime.Parse(value.ToString());
|
||||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||
if (timespanMin > 120 && timespanMin < 130)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 10]);
|
||||
}
|
||||
else if (timespanMin > 130)
|
||||
{
|
||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 130))) * 130);
|
||||
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
// _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 >= 1 && timespanMin <= 100)
|
||||
{
|
||||
throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
||||
}
|
||||
else if (timespanMin > 10)
|
||||
{
|
||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
||||
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(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);
|
||||
// _provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
|
||||
}
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user