阅片时间修改到配置文件

This commit is contained in:
he
2024-07-11 17:28:18 +08:00
parent 8c16bc2ac5
commit ded0dbaa2d
3 changed files with 22 additions and 3 deletions
@@ -21,6 +21,7 @@ using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
using AutoMapper.QueryableExtensions;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Domain.Models;
using Microsoft.Extensions.Options;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace IRaCIS.Application.Services
@@ -43,6 +44,7 @@ namespace IRaCIS.Application.Services
private readonly IReadingCalculateService _readingCalculateService;
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
private readonly IRepository<Subject> _subjectRepository;
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
private readonly IRepository<ReadingCriterionPage> _readingCriterionPageRepository;
private readonly IRepository<ReadingTaskRelation> _readingTaskRelationRepository;
@@ -85,6 +87,7 @@ namespace IRaCIS.Application.Services
IReadingCalculateService readingCalculateService,
IRepository<SubjectVisit> subjectVisitRepository,
IRepository<Subject> subjectRepository,
IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig,
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
IRepository<ReadingCriterionPage> readingCriterionPageRepository,
IRepository<ReadingTaskRelation> readingTaskRelationRepository,
@@ -126,6 +129,7 @@ namespace IRaCIS.Application.Services
this._readingCalculateService = readingCalculateService;
this._subjectVisitRepository = subjectVisitRepository;
this._subjectRepository = subjectRepository;
this._verifyConfig = verifyConfig;
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
this._readingCriterionPageRepository = readingCriterionPageRepository;
this._readingTaskRelationRepository = readingTaskRelationRepository;
@@ -2999,8 +3003,8 @@ namespace IRaCIS.Application.Services
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
int readingMinute = 120; // 为60整数
int restMinute = 10; //
int readingMinute = _verifyConfig.CurrentValue.ContinuousReadingTimeMin; // 为60整数
int restMinute = _verifyConfig.CurrentValue.ReadingRestTimeMin; //
var startReadingTime = _provider.Get<string>(startReadingTimeKey).Value;
var startRestTime = _provider.Get<string>(startRestTimeKey).Value;
if (startReadingTime == null && startRestTime == null)