字段修改

Uat_IRC_Net10
he 2026-08-13 15:16:51 +08:00
parent 416793018f
commit e159f8a82b
5 changed files with 74 additions and 16 deletions

View File

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

View File

@ -33,14 +33,55 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class TrialQuestionVisitJudgeRuleItemDto
{
public Guid ReadingQuestionId { get; set; }
public Guid ReadingQuestionTrialId { get; set; }
public string QuestionName { get; set; } = string.Empty;
public int ShowOrder { get; set; }
public List<string> AnswerGroup { get; set; } = new List<string>();
public List<string> AnswerCombination { get; set; } = new List<string>();
public JudgeTypeEnum JudgeType { get; set; }
public decimal? JudgeDifferenceValue { 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; }
}

View File

@ -55,27 +55,34 @@ namespace IRaCIS.Core.Application.Service
.OrderBy(x => x.ShowOrder)
.Select(x => new TrialQuestionVisitJudgeRuleItemDto
{
ReadingQuestionId = x.Id,
ReadingQuestionTrialId = x.Id,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
ShowOrder = x.ShowOrder,
})
.ToListAsync();
var questionIds = questionList.Select(x => x.ReadingQuestionId).ToList();
var questionIds = questionList.Select(x => x.ReadingQuestionTrialId).ToList();
var ruleList = await _readingQuestionVisitJudgeRuleRepository
.Where(x => x.VisitNum == inDto.VisitNum && questionIds.Contains(x.ReadingQuestionId))
.ToListAsync();
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
{
ReadingQuestionId = question.ReadingQuestionId,
ReadingQuestionTrialId = question.ReadingQuestionTrialId,
QuestionName = question.QuestionName,
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>(),
AnswerCombination = rule?.AnswerCombination ?? new List<string>(),
AnswerCombination = rule?.AnswerCombination ?? new List<AnswerCombinationDto>(),
JudgeType = rule?.JudgeType ?? JudgeTypeEnum.None,
JudgeDifferenceValue = rule?.JudgeDifferenceValue,
JudgeDifferenceType = rule?.JudgeDifferenceType ?? default,
@ -100,10 +107,10 @@ namespace IRaCIS.Core.Application.Service
var rules = inDto.QuestionList.Select(question => new ReadingQuestionVisitJudgeRule
{
Id = NewId.NextGuid(),
ReadingQuestionId = question.ReadingQuestionId,
ReadingQuestionId = question.ReadingQuestionTrialId,
VisitNum = inDto.VisitNum,
AnswerGroup = question.AnswerGroup ?? new List<string>(),
AnswerCombination = question.AnswerCombination ?? new List<string>(),
AnswerCombination = question.AnswerCombination ?? new List<AnswerCombinationDto>(),
JudgeType = question.JudgeType,
JudgeDifferenceValue = question.JudgeDifferenceValue,
JudgeDifferenceType = question.JudgeDifferenceType,

View File

@ -37,7 +37,7 @@ public class ReadingQuestionVisitJudgeRule : BaseAddAuditEntity
/// </summary>
[Comment("答案组合")]
[MaxLength]
public List<string> AnswerCombination { get; set; } = new List<string>();
public List<AnswerCombinationDto> AnswerCombination { get; set; } = new List<AnswerCombinationDto>();
/// <summary>
/// 裁判类型
@ -58,3 +58,10 @@ public class ReadingQuestionVisitJudgeRule : BaseAddAuditEntity
public JudgeDifferenceType JudgeDifferenceType { get; set; }
}
public class AnswerCombinationDto
{
public List<string> AnswerGroupA { get; set; }
public List<string> AnswerGroupB { get; set; }
}

View File

@ -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 配置 暂时屏蔽
//if (base.Database.IsNpgsql())
//{