From 13ef3e69b9a6460ff00e663f39b7af3a66dafdf6 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 23 May 2022 17:31:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/FrontAuditConfigService.cs | 21 +++++++++++++++---- .../Service/WorkLoad/DoctorWorkloadService.cs | 1 + .../Common/Dto/SetDictionaryValueDto.cs | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index 8438efd2f..7fd82db2b 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -24,15 +24,18 @@ namespace IRaCIS.Core.Application.Service private readonly IRepository _frontAuditConfigRepository; private readonly IRepository _qCChallengeDialogRepository; + private readonly IRepository _qCChallengeRepository; private readonly IRepository _checkChallengeDialogRepository; public FrontAuditConfigService(IRepository frontAuditConfigRepository, IRepository qCChallengeDialogRepository, + IRepository qCChallengeRepository, IRepository checkChallengeDialogRepository ) { _frontAuditConfigRepository = frontAuditConfigRepository; this._qCChallengeDialogRepository = qCChallengeDialogRepository; + this._qCChallengeRepository = qCChallengeRepository; this._checkChallengeDialogRepository = checkChallengeDialogRepository; } @@ -55,12 +58,20 @@ namespace IRaCIS.Core.Application.Service public async Task> AccessToDialogue(AccessToDialogueInDto inDto) { List data = new List(); + switch (inDto.Type) { case AccessToDialogueEnum.Question: - - data =await _qCChallengeDialogRepository.Where(x => x.QCChallengeId == inDto.Id && x.CreateTime <= inDto.Createtime.AddSeconds(1)).Include(x => x.CreateUser).Select( + AccessToDialogueOutDto title = (await _qCChallengeRepository.Where(x => x.Id == inDto.Id).Include(x => x.CreateUser).Select(x => new AccessToDialogueOutDto() + { + CreateTime = x.CreateTime, + CreateUserName = x.CreateUser.UserName, + TalkContent = x.Content, + IsTitle = true, + }).FirstOrDefaultAsync())?? new AccessToDialogueOutDto(); + + data =await _qCChallengeDialogRepository.Where(x => x.QCChallengeId == inDto.Id && x.CreateTime <= inDto.Createtime).Include(x => x.CreateUser).Select( x => new AccessToDialogueOutDto() { CreateTime = x.CreateTime, @@ -68,9 +79,12 @@ namespace IRaCIS.Core.Application.Service TalkContent = x.TalkContent } ).OrderBy(x => x.CreateTime).ToListAsync(); + + data.Insert(0, title); + break; case AccessToDialogueEnum.Consistency: - data = await _checkChallengeDialogRepository.Where(x => x.SubjectVisitId == inDto.Id && x.CreateTime <= inDto.Createtime.AddSeconds(1)).Include(x => x.CreateUser).Select( + data = await _checkChallengeDialogRepository.Where(x => x.SubjectVisitId == inDto.Id && x.CreateTime <= inDto.Createtime).Include(x => x.CreateUser).Select( x => new AccessToDialogueOutDto() { CreateTime = x.CreateTime, @@ -138,7 +152,6 @@ namespace IRaCIS.Core.Application.Service maxsort++; fronts.Add(new FrontAuditConfig() { - Sort = maxsort, Code = item.Name, ValueCN = item.Remake, diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs index 11414b0a2..03932caaf 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs @@ -285,6 +285,7 @@ namespace IRaCIS.Application.Services AdjudicationIn48H = workLoad.AdjudicationIn48H, + Training = workLoad.Training, Downtime = workLoad.Downtime, IsLock = workLoad.IsLock diff --git a/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs b/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs index cfd255f05..04c439c9e 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs @@ -34,6 +34,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto public string TalkContent { get; set; } public DateTime CreateTime { get; set; } + + public bool IsTitle { get; set; } } public enum AccessToDialogueEnum