Uat_Study
he 2022-08-11 15:19:57 +08:00
parent ea435f94b1
commit 3563e5e383
4 changed files with 65 additions and 5 deletions

View File

@ -49,6 +49,11 @@ namespace IRaCIS.Core.Application.ViewModel
/// 是否启用 /// 是否启用
/// </summary> /// </summary>
public bool IsEnable { get; set; } public bool IsEnable { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }
///<summary>ReadingMedicineSystemQuestionQuery 列表查询参数模型</summary> ///<summary>ReadingMedicineSystemQuestionQuery 列表查询参数模型</summary>
@ -59,6 +64,11 @@ namespace IRaCIS.Core.Application.ViewModel
public string QuestionName { get; set; } = string.Empty; public string QuestionName { get; set; } = string.Empty;
public string TypeValue { get; set; } = string.Empty; public string TypeValue { get; set; } = string.Empty;
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory? ReadingCategory { get; set; }
} }
@ -72,6 +82,11 @@ namespace IRaCIS.Core.Application.ViewModel
/// 类型值 /// 类型值
/// </summary> /// </summary>
public string TypeValue { get; set; } public string TypeValue { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }
public class DeleteReadingMedicineTrialQuestion public class DeleteReadingMedicineTrialQuestion
@ -114,6 +129,11 @@ namespace IRaCIS.Core.Application.ViewModel
public Guid? Id { get; set; } public Guid? Id { get; set; }
public int? ShowOrder { get; set; } public int? ShowOrder { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory? ReadingCategory { get; set; }
} }
@ -161,6 +181,11 @@ namespace IRaCIS.Core.Application.ViewModel
/// 是否启用 /// 是否启用
/// </summary> /// </summary>
public bool IsEnable { get; set; } public bool IsEnable { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }
public class ReadingMedicineTrialQuestionView public class ReadingMedicineTrialQuestionView
@ -182,12 +207,22 @@ namespace IRaCIS.Core.Application.ViewModel
public bool? IsConfirm { get; set; } public bool? IsConfirm { get; set; }
public int? ParentShowOrder { get; set; } public int? ParentShowOrder { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }
public class GetMedicineQuestionPreviewInDto public class GetMedicineQuestionPreviewInDto
{ {
public Guid TrialId { get; set; } public Guid TrialId { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory? ReadingCategory { get; set; }
} }
@ -270,6 +305,11 @@ namespace IRaCIS.Core.Application.ViewModel
public string TypeValue { get; set; } = string.Empty; public string TypeValue { get; set; } = string.Empty;
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }
///<summary> ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型</summary> ///<summary> ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型</summary>
@ -288,6 +328,11 @@ namespace IRaCIS.Core.Application.ViewModel
public int ShowOrder { get; set; } public int ShowOrder { get; set; }
public Guid? ParentId { get; set; } public Guid? ParentId { get; set; }
public bool? IsConfirm { get; set; } public bool? IsConfirm { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }

View File

@ -46,6 +46,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue))
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
.WhereIf(inDto.ReadingCategory!=null, x => x.ReadingCategory==inDto.ReadingCategory)
.ProjectTo<ReadingMedicineSystemQuestionView>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder); .ProjectTo<ReadingMedicineSystemQuestionView>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder);
return await query.ToListAsync(); return await query.ToListAsync();
} }
@ -105,6 +106,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue))
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
.WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory)
.ProjectTo<ReadingMedicineTrialQuestionView>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder); .ProjectTo<ReadingMedicineTrialQuestionView>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder);
@ -125,6 +127,7 @@ namespace IRaCIS.Core.Application.Service
public async Task<List<GetMedicineQuestionPreviewOutDto>> GetMedicineQuestionPreview(GetMedicineQuestionPreviewInDto inDto) public async Task<List<GetMedicineQuestionPreviewOutDto>> GetMedicineQuestionPreview(GetMedicineQuestionPreviewInDto inDto)
{ {
var trialQuestionList = await _readingMedicineTrialQuestionRepository.Where(x=>x.TrialId==inDto.TrialId) var trialQuestionList = await _readingMedicineTrialQuestionRepository.Where(x=>x.TrialId==inDto.TrialId)
.WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory)
.ProjectTo<GetMedicineQuestionPreviewOutDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync(); .ProjectTo<GetMedicineQuestionPreviewOutDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
List<GetMedicineQuestionPreviewOutDto> readingQuestionList = trialQuestionList.Where(x => x.ParentId == null).ToList(); List<GetMedicineQuestionPreviewOutDto> readingQuestionList = trialQuestionList.Where(x => x.ParentId == null).ToList();
@ -188,12 +191,13 @@ namespace IRaCIS.Core.Application.Service
.Where(x => types.Contains(x.Type)) .Where(x => types.Contains(x.Type))
.WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id)
.WhereIf(inDto.ShowOrder != null, x => x.ShowOrder <inDto.ShowOrder) .WhereIf(inDto.ShowOrder != null, x => x.ShowOrder <inDto.ShowOrder)
.WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory)
.Select(x => new GetReadingMedicineTrialOtherQuestionOutDto() .Select(x => new GetReadingMedicineTrialOtherQuestionOutDto()
{ {
Id = x.Id, Id = x.Id,
QuestionName = x.QuestionName, QuestionName = x.QuestionName,
TypeValue=x.TypeValue, TypeValue=x.TypeValue,
ReadingCategory=x.ReadingCategory,
}).ToListAsync(); }).ToListAsync();
return questionList; return questionList;
@ -217,6 +221,7 @@ namespace IRaCIS.Core.Application.Service
IsRequired = x.IsRequired, IsRequired = x.IsRequired,
QuestionName = x.QuestionName, QuestionName = x.QuestionName,
Type = x.Type, Type = x.Type,
ReadingCategory=x.ReadingCategory,
TypeValue = x.TypeValue, TypeValue = x.TypeValue,
TrialId=inDto.TrialId, TrialId=inDto.TrialId,
}).ToList(); }).ToList();

View File

@ -76,5 +76,10 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public bool IsEnable { get; set; } public bool IsEnable { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
} }
} }

View File

@ -86,6 +86,11 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public bool IsConfirm { get; set; } public bool IsConfirm { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public ReadingCategory ReadingCategory { get; set; }
[ForeignKey("ParentId")] [ForeignKey("ParentId")]
public ReadingMedicineTrialQuestion ParentQuestion { get; set; } public ReadingMedicineTrialQuestion ParentQuestion { get; set; }