字段修改
parent
416793018f
commit
e159f8a82b
|
|
@ -3000,12 +3000,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class AnswerCombinationDto
|
|
||||||
{
|
|
||||||
public List<string> AnswerGroupA { get; set; }
|
|
||||||
|
|
||||||
public List<string> AnswerGroupB { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TaskAnswerDto
|
public class TaskAnswerDto
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,55 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public class TrialQuestionVisitJudgeRuleItemDto
|
public class TrialQuestionVisitJudgeRuleItemDto
|
||||||
{
|
{
|
||||||
public Guid ReadingQuestionId { get; set; }
|
public Guid ReadingQuestionTrialId { get; set; }
|
||||||
public string QuestionName { get; set; } = string.Empty;
|
public string QuestionName { get; set; } = string.Empty;
|
||||||
public int ShowOrder { get; set; }
|
public int ShowOrder { get; set; }
|
||||||
public List<string> AnswerGroup { get; set; } = new List<string>();
|
public List<string> AnswerGroup { get; set; } = new List<string>();
|
||||||
public List<string> AnswerCombination { get; set; } = new List<string>();
|
|
||||||
public JudgeTypeEnum JudgeType { get; set; }
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
public decimal? JudgeDifferenceValue { get; set; }
|
public decimal? JudgeDifferenceValue { get; set; }
|
||||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public string Type { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public string PageName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string TypeValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题类型
|
||||||
|
/// </summary>
|
||||||
|
public TableQuestionType? QuestionGenre { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 字典code
|
||||||
|
/// </summary>
|
||||||
|
public string DictionaryCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public ValueUnit? Unit { get; set; }
|
||||||
|
|
||||||
|
public string CustomUnit { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案组合
|
||||||
|
/// </summary>
|
||||||
|
public List<AnswerCombinationDto> AnswerCombination { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,27 +55,34 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.OrderBy(x => x.ShowOrder)
|
.OrderBy(x => x.ShowOrder)
|
||||||
.Select(x => new TrialQuestionVisitJudgeRuleItemDto
|
.Select(x => new TrialQuestionVisitJudgeRuleItemDto
|
||||||
{
|
{
|
||||||
ReadingQuestionId = x.Id,
|
ReadingQuestionTrialId = x.Id,
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
||||||
ShowOrder = x.ShowOrder,
|
ShowOrder = x.ShowOrder,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var questionIds = questionList.Select(x => x.ReadingQuestionId).ToList();
|
var questionIds = questionList.Select(x => x.ReadingQuestionTrialId).ToList();
|
||||||
var ruleList = await _readingQuestionVisitJudgeRuleRepository
|
var ruleList = await _readingQuestionVisitJudgeRuleRepository
|
||||||
.Where(x => x.VisitNum == inDto.VisitNum && questionIds.Contains(x.ReadingQuestionId))
|
.Where(x => x.VisitNum == inDto.VisitNum && questionIds.Contains(x.ReadingQuestionId))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return questionList.Select(question =>
|
return questionList.Select(question =>
|
||||||
{
|
{
|
||||||
var rule = ruleList.FirstOrDefault(x => x.ReadingQuestionId == question.ReadingQuestionId);
|
var rule = ruleList.FirstOrDefault(x => x.ReadingQuestionId == question.ReadingQuestionTrialId);
|
||||||
return new TrialQuestionVisitJudgeRuleItemDto
|
return new TrialQuestionVisitJudgeRuleItemDto
|
||||||
{
|
{
|
||||||
ReadingQuestionId = question.ReadingQuestionId,
|
ReadingQuestionTrialId = question.ReadingQuestionTrialId,
|
||||||
QuestionName = question.QuestionName,
|
QuestionName = question.QuestionName,
|
||||||
ShowOrder = question.ShowOrder,
|
ShowOrder = question.ShowOrder,
|
||||||
|
Type = question.Type,
|
||||||
|
PageName = question.PageName,
|
||||||
|
TypeValue = question.TypeValue,
|
||||||
|
QuestionGenre = question.QuestionGenre,
|
||||||
|
DictionaryCode = question.DictionaryCode,
|
||||||
|
Unit = question.Unit,
|
||||||
|
CustomUnit = question.CustomUnit,
|
||||||
AnswerGroup = rule?.AnswerGroup ?? new List<string>(),
|
AnswerGroup = rule?.AnswerGroup ?? new List<string>(),
|
||||||
AnswerCombination = rule?.AnswerCombination ?? new List<string>(),
|
AnswerCombination = rule?.AnswerCombination ?? new List<AnswerCombinationDto>(),
|
||||||
JudgeType = rule?.JudgeType ?? JudgeTypeEnum.None,
|
JudgeType = rule?.JudgeType ?? JudgeTypeEnum.None,
|
||||||
JudgeDifferenceValue = rule?.JudgeDifferenceValue,
|
JudgeDifferenceValue = rule?.JudgeDifferenceValue,
|
||||||
JudgeDifferenceType = rule?.JudgeDifferenceType ?? default,
|
JudgeDifferenceType = rule?.JudgeDifferenceType ?? default,
|
||||||
|
|
@ -100,10 +107,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var rules = inDto.QuestionList.Select(question => new ReadingQuestionVisitJudgeRule
|
var rules = inDto.QuestionList.Select(question => new ReadingQuestionVisitJudgeRule
|
||||||
{
|
{
|
||||||
Id = NewId.NextGuid(),
|
Id = NewId.NextGuid(),
|
||||||
ReadingQuestionId = question.ReadingQuestionId,
|
ReadingQuestionId = question.ReadingQuestionTrialId,
|
||||||
VisitNum = inDto.VisitNum,
|
VisitNum = inDto.VisitNum,
|
||||||
AnswerGroup = question.AnswerGroup ?? new List<string>(),
|
AnswerGroup = question.AnswerGroup ?? new List<string>(),
|
||||||
AnswerCombination = question.AnswerCombination ?? new List<string>(),
|
AnswerCombination = question.AnswerCombination ?? new List<AnswerCombinationDto>(),
|
||||||
JudgeType = question.JudgeType,
|
JudgeType = question.JudgeType,
|
||||||
JudgeDifferenceValue = question.JudgeDifferenceValue,
|
JudgeDifferenceValue = question.JudgeDifferenceValue,
|
||||||
JudgeDifferenceType = question.JudgeDifferenceType,
|
JudgeDifferenceType = question.JudgeDifferenceType,
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class ReadingQuestionVisitJudgeRule : BaseAddAuditEntity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Comment("答案组合")]
|
[Comment("答案组合")]
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public List<string> AnswerCombination { get; set; } = new List<string>();
|
public List<AnswerCombinationDto> AnswerCombination { get; set; } = new List<AnswerCombinationDto>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 裁判类型
|
/// 裁判类型
|
||||||
|
|
@ -58,3 +58,10 @@ public class ReadingQuestionVisitJudgeRule : BaseAddAuditEntity
|
||||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class AnswerCombinationDto
|
||||||
|
{
|
||||||
|
public List<string> AnswerGroupA { get; set; }
|
||||||
|
|
||||||
|
public List<string> AnswerGroupB { get; set; }
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,14 @@ public class IRaCISDBContext : DbContext
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<ReadingQuestionVisitJudgeRule>(entity =>
|
||||||
|
{
|
||||||
|
entity.Property(e => e.AnswerCombination).HasConversion(
|
||||||
|
v => v == null ? null : JsonConvert.SerializeObject(v),
|
||||||
|
v => string.IsNullOrEmpty(v) ? new List<AnswerCombinationDto>() { } : JsonConvert.DeserializeObject<List<AnswerCombinationDto>>(v)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
#region pgsql codefirst 配置 暂时屏蔽
|
#region pgsql codefirst 配置 暂时屏蔽
|
||||||
//if (base.Database.IsNpgsql())
|
//if (base.Database.IsNpgsql())
|
||||||
//{
|
//{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue