Compare commits
5 Commits
8fedcdaf00
...
85a303171c
Author | SHA1 | Date |
---|---|---|
|
85a303171c | |
|
4026eca656 | |
|
74aec46a94 | |
|
49e21a6342 | |
|
0e0dd0c7d3 |
|
@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
||||||
|
|
||||||
Task ResetReadingRestTime(Guid? userId);
|
Task<bool> ResetReadingRestTime(Guid? userId);
|
||||||
|
|
||||||
Task<List<GetReadingPastResultListOutDto>> GetReadingPastResultList(GetReadingPastResultListInDto inDto);
|
Task<List<GetReadingPastResultListOutDto>> GetReadingPastResultList(GetReadingPastResultListInDto inDto);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ using AutoMapper.QueryableExtensions;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using System.Linq;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
|
@ -2705,6 +2707,31 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置跳过阅片的缓存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<bool> SetSkipReadingCache(SetSkipReadingCacheInDto inDto )
|
||||||
|
{
|
||||||
|
var clearSkipReadingCacheKey = _userInfo.Id.ToString() + "SkipReadingCache";
|
||||||
|
var clearSkipReadingCache = _provider.Get<string>(clearSkipReadingCacheKey).Value;
|
||||||
|
if (clearSkipReadingCache == null|| clearSkipReadingCache==string.Empty)
|
||||||
|
{
|
||||||
|
List<Guid> cacheIds = new List<Guid>();
|
||||||
|
cacheIds.Add(inDto.VisitTaskId);
|
||||||
|
|
||||||
|
_provider.Set(clearSkipReadingCacheKey, JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<Guid>? cacheIds=JsonConvert.DeserializeObject<List<Guid>>(clearSkipReadingCache);
|
||||||
|
cacheIds.Add(inDto.VisitTaskId);
|
||||||
|
_provider.Set(clearSkipReadingCacheKey, JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2770,14 +2797,20 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var subjectIndex = subjectTaskList.Where(x => x.SubjectId == inDto.SubjectId && x.SubjectCode == inDto.SubjectCode).Select(x => x.Index).FirstOrDefault();
|
var subjectIndex = subjectTaskList.Where(x => x.SubjectId == inDto.SubjectId && x.SubjectCode == inDto.SubjectCode).Select(x => x.Index).FirstOrDefault();
|
||||||
|
|
||||||
var currentSubject = subjectTaskList.Where(x => x.Index >= subjectIndex && !x.ExistReadingApply).OrderBy(x => x.Index).FirstOrDefault();
|
|
||||||
|
var currentSubject = subjectTaskList.Where(x => x.Index >= subjectIndex && !x.ExistReadingApply)
|
||||||
|
// 排除跳过的
|
||||||
|
.Where(x=> x.UnReadCanReadTaskList.Select(y => y.Id).Intersect(cacheSkipIds).Count()==0)
|
||||||
|
.OrderBy(x => x.Index).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
if (currentSubject == null)
|
if (currentSubject == null)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto()
|
task = currentSubject.UnReadCanReadTaskList
|
||||||
|
.Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
ReadingCategory = x.ReadingCategory,
|
ReadingCategory = x.ReadingCategory,
|
||||||
SubjectCode = currentSubject.SubjectCode,
|
SubjectCode = currentSubject.SubjectCode,
|
||||||
|
@ -2806,12 +2839,25 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
})).CurrentPageData;
|
})).CurrentPageData;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (subjectTaskList.Count() == 0)
|
if (subjectTaskList.Count() == 0)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
var taskList = subjectTaskList.FirstOrDefault()!.UnReadCanReadTaskList;
|
var taskList = subjectTaskList.FirstOrDefault()!.UnReadCanReadTaskList;
|
||||||
|
// 排除跳过的
|
||||||
|
List<Guid> remainingItems = taskList.Select(x => x.Id).Except(cacheSkipIds).ToList();
|
||||||
|
|
||||||
|
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).ToList();
|
||||||
|
if (taskList.Count() == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
|
}
|
||||||
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
//返回的范围是 0- taskList.Count-1
|
//返回的范围是 0- taskList.Count-1
|
||||||
|
@ -2995,12 +3041,12 @@ namespace IRaCIS.Application.Services
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task VerifyReadingRestTime()
|
public async Task<bool> VerifyReadingRestTime()
|
||||||
{
|
{
|
||||||
var userTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt;
|
var userTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt;
|
||||||
if (userTypeEnum != UserTypeEnum.IndependentReviewer)
|
if (userTypeEnum != UserTypeEnum.IndependentReviewer)
|
||||||
{
|
{
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
|
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
|
||||||
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
|
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
|
||||||
|
@ -3045,6 +3091,8 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3052,7 +3100,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task ResetReadingRestTime(Guid? userID)
|
public async Task<bool> ResetReadingRestTime(Guid? userID)
|
||||||
{
|
{
|
||||||
if (userID == null)
|
if (userID == null)
|
||||||
{
|
{
|
||||||
|
@ -3079,6 +3127,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
_provider.Set(startReadingTimeKey, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
_provider.Set(startReadingTimeKey, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue