修改一版

Uat_Study
he 2022-05-23 17:31:25 +08:00
parent beb85f9909
commit 13ef3e69b9
3 changed files with 20 additions and 4 deletions

View File

@ -24,15 +24,18 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository<FrontAuditConfig> _frontAuditConfigRepository;
private readonly IRepository<QCChallengeDialog> _qCChallengeDialogRepository;
private readonly IRepository<QCChallenge> _qCChallengeRepository;
private readonly IRepository<CheckChallengeDialog> _checkChallengeDialogRepository;
public FrontAuditConfigService(IRepository<FrontAuditConfig> frontAuditConfigRepository,
IRepository<QCChallengeDialog> qCChallengeDialogRepository,
IRepository<QCChallenge> qCChallengeRepository,
IRepository<CheckChallengeDialog> checkChallengeDialogRepository
)
{
_frontAuditConfigRepository = frontAuditConfigRepository;
this._qCChallengeDialogRepository = qCChallengeDialogRepository;
this._qCChallengeRepository = qCChallengeRepository;
this._checkChallengeDialogRepository = checkChallengeDialogRepository;
}
@ -55,12 +58,20 @@ namespace IRaCIS.Core.Application.Service
public async Task<List<AccessToDialogueOutDto>> AccessToDialogue(AccessToDialogueInDto inDto)
{
List<AccessToDialogueOutDto> data = new List<AccessToDialogueOutDto>();
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,

View File

@ -285,6 +285,7 @@ namespace IRaCIS.Application.Services
AdjudicationIn48H = workLoad.AdjudicationIn48H,
Training = workLoad.Training,
Downtime = workLoad.Downtime,
IsLock = workLoad.IsLock

View File

@ -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