This commit is contained in:
he
2022-11-15 16:09:45 +08:00
parent 7e2fc35808
commit c07146e1c7
6 changed files with 183 additions and 0 deletions
@@ -272,6 +272,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class ReadingTableQuestionTrialAddOrEdit
{
/// <summary>
/// 自定义计算标记
/// </summary>
public CustomCalculateMark? CustomCalculateMark { get; set; }
/// <summary>
/// 自定义计算标记
/// </summary>
public string CalculateQuestions { get; set; } = "[]";
/// <summary>
/// 数值类型
/// </summary>
@@ -803,6 +814,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 单位
/// </summary>
public ValueUnit? Unit { get; set; }
/// <summary>
/// 自定义计算标记
/// </summary>
public CustomCalculateMark? CustomCalculateMark { get; set; }
/// <summary>
/// 自定义计算标记
/// </summary>
public string CalculateQuestions { get; set; }
}
public class ReadingQuestionSystemView
@@ -1017,8 +1038,36 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public bool IsJudgeQuestion { get; set; }
}
public class GetCalculateQuestionsOutDto
{
public Guid QuestionId { get; set; }
public string QuestionName{ get; set; }
}
public class GetCalculateTableQuestionsOutDto
{
public Guid TableQuestionId { get; set; }
public string TableQuestionName { get; set; }
}
public class GetCalculateTableQuestionsInDto
{
[NotDefault]
public Guid QuestionId { get; set; }
}
public class GetCalculateQuestionsInDto
{
[NotDefault]
public Guid TrialCriterionId { get; set; }
}
public class GetTrialGroupNameListInDto
{
@@ -1449,6 +1498,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 单位
/// </summary>
public ValueUnit? Unit { get; set; }
/// <summary>
/// 自定义计算标记
/// </summary>
public CustomCalculateMark? CustomCalculateMark { get; set; }
/// <summary>
/// 自定义计算标记
/// </summary>
public string CalculateQuestions { get; set; } = "[]";
}
public class GetSystemCriterionSelectDto
@@ -73,7 +73,58 @@ namespace IRaCIS.Application.Services
this._previousPDFRepository = previousPDFRepository;
}
#region
/// <summary>
/// 获取数值问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
public async Task<List<GetCalculateQuestionsOutDto>> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
{
var result =await _readingQuestionTrialRepository
.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialCriterionId)
.Where(x => x.Type == "number")
.OrderBy(x => x.ShowOrder)
.Select(x => new GetCalculateQuestionsOutDto
(){
QuestionId = x.Id,
QuestionName = x.QuestionName
}).ToListAsync();
return result;
}
/// <summary>
/// 获取表格数值问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetCalculateTableQuestionsOutDto>> GetCalculateTableQuestions(GetCalculateTableQuestionsInDto inDto)
{
var result = await _readingTableQuestionTrialRepository
.Where(x => x.ReadingQuestionId == inDto.QuestionId)
.Where(x=>x.Type== "number")
.OrderBy(x => x.ShowOrder)
.Select(x => new GetCalculateTableQuestionsOutDto
()
{
TableQuestionId = x.Id,
TableQuestionName = x.QuestionName
}).ToListAsync();
return result;
}
#endregion
#region