修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
74e0765d7a
commit
84f76c09f7
|
@ -1573,6 +1573,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid? QuestionId { get; set; }
|
public Guid? QuestionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 裁判百分比或绝对值的相差值
|
||||||
|
/// </summary>
|
||||||
|
public decimal? JudgeDifferenceValue { get; set; }
|
||||||
|
|
||||||
public bool IsHaveChange { get; set; } = false;
|
public bool IsHaveChange { get; set; } = false;
|
||||||
|
|
||||||
public string VisitAnswer { get; set; } = string.Empty;
|
public string VisitAnswer { get; set; } = string.Empty;
|
||||||
|
@ -2267,6 +2272,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid QuestionId { get; set; }
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 裁判百分比或绝对值的相差值
|
||||||
|
/// </summary>
|
||||||
|
public decimal? JudgeDifferenceValue { get; set; }
|
||||||
public string AnswerGroup { get; set; }
|
public string AnswerGroup { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -2311,6 +2320,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public string AnswerCombination { get; set; }
|
public string AnswerCombination { get; set; }
|
||||||
|
|
||||||
public JudgeTypeEnum JudgeType { get; set; }
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 裁判百分比或绝对值的相差值
|
||||||
|
/// </summary>
|
||||||
|
public decimal? JudgeDifferenceValue { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,8 @@ namespace IRaCIS.Application.Services
|
||||||
.Select(y => new GlobalQuestionInfo()
|
.Select(y => new GlobalQuestionInfo()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
JudgeDifferenceValue= y.ReadingQuestionTrial.JudgeDifferenceValue,
|
||||||
|
|
||||||
QuestionId = y.ReadingQuestionTrialId,
|
QuestionId = y.ReadingQuestionTrialId,
|
||||||
QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us),
|
QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us),
|
||||||
QuestionEnName=y.ReadingQuestionTrial.QuestionEnName,
|
QuestionEnName=y.ReadingQuestionTrial.QuestionEnName,
|
||||||
|
@ -290,6 +292,7 @@ namespace IRaCIS.Application.Services
|
||||||
x.BeforeQuestionList.Add(new GlobalQuestionInfo()
|
x.BeforeQuestionList.Add(new GlobalQuestionInfo()
|
||||||
{
|
{
|
||||||
QuestionId = y.Id,
|
QuestionId = y.Id,
|
||||||
|
JudgeDifferenceValue=y.JudgeDifferenceValue,
|
||||||
QuestionName = y.QuestionName.LanguageName(y.QuestionEnName, _userInfo.IsEn_Us),
|
QuestionName = y.QuestionName.LanguageName(y.QuestionEnName, _userInfo.IsEn_Us),
|
||||||
QuestionEnName = y.QuestionEnName,
|
QuestionEnName = y.QuestionEnName,
|
||||||
AnswerGroup = y.AnswerGroup,
|
AnswerGroup = y.AnswerGroup,
|
||||||
|
@ -373,6 +376,7 @@ namespace IRaCIS.Application.Services
|
||||||
(lr.global.Select(x => x.Answer).FirstOrDefault().IsNullOrEmpty() && inDto.UsingOriginalData ?
|
(lr.global.Select(x => x.Answer).FirstOrDefault().IsNullOrEmpty() && inDto.UsingOriginalData ?
|
||||||
lr.question.Answer : lr.global.Select(x => x.Answer).FirstOrDefault()
|
lr.question.Answer : lr.global.Select(x => x.Answer).FirstOrDefault()
|
||||||
),
|
),
|
||||||
|
JudgeDifferenceValue= lr.question.JudgeDifferenceValue,
|
||||||
VisitAnswer = lr.question.Answer,
|
VisitAnswer = lr.question.Answer,
|
||||||
IsHaveChange = lr.global.Any(x=>x.QuestionId!=null&&!x.Answer.IsNullOrEmpty()) ? true : false,
|
IsHaveChange = lr.global.Any(x=>x.QuestionId!=null&&!x.Answer.IsNullOrEmpty()) ? true : false,
|
||||||
QuestionId = lr.question.QuestionId,
|
QuestionId = lr.question.QuestionId,
|
||||||
|
@ -507,6 +511,7 @@ namespace IRaCIS.Application.Services
|
||||||
.Select(x => new CriterionDictionaryInfo()
|
.Select(x => new CriterionDictionaryInfo()
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
|
|
||||||
DictionaryId = x.DictionaryId,
|
DictionaryId = x.DictionaryId,
|
||||||
ChildGroup = x.Dictionary.ChildGroup,
|
ChildGroup = x.Dictionary.ChildGroup,
|
||||||
IsBaseLineUse=x.IsBaseLineUse,
|
IsBaseLineUse=x.IsBaseLineUse,
|
||||||
|
|
|
@ -616,6 +616,7 @@ namespace IRaCIS.Application.Services
|
||||||
AnswerCombination = question.AnswerCombination,
|
AnswerCombination = question.AnswerCombination,
|
||||||
JudgeType = question.JudgeType,
|
JudgeType = question.JudgeType,
|
||||||
QuestionId = question.Id,
|
QuestionId = question.Id,
|
||||||
|
JudgeDifferenceValue=question.JudgeDifferenceValue,
|
||||||
VisitTaskId = questionAnswer.VisitTaskId,
|
VisitTaskId = questionAnswer.VisitTaskId,
|
||||||
};
|
};
|
||||||
var globalVisitAnswerlist = await globalVisitQuestionQuery.ToListAsync();
|
var globalVisitAnswerlist = await globalVisitQuestionQuery.ToListAsync();
|
||||||
|
@ -624,12 +625,13 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
foreach (var item in taskNums)
|
foreach (var item in taskNums)
|
||||||
{
|
{
|
||||||
List<GroupTaskAnswerDto> groupTasks = globalVisitAnswerlist.Where(x => x.VisitTaskNum == item).GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
List<GroupTaskAnswerDto> groupTasks = globalVisitAnswerlist.Where(x => x.VisitTaskNum == item).GroupBy(x => new {x.JudgeDifferenceValue, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
||||||
{
|
{
|
||||||
QuestionId = x.Key.QuestionId,
|
QuestionId = x.Key.QuestionId,
|
||||||
AnswerGroup = x.Key.AnswerGroup,
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
AnswerCombination = x.Key.AnswerCombination,
|
AnswerCombination = x.Key.AnswerCombination,
|
||||||
JudgeType = x.Key.JudgeType,
|
JudgeType = x.Key.JudgeType,
|
||||||
|
JudgeDifferenceValue=x.Key.JudgeDifferenceValue,
|
||||||
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
noteEqual = noteEqual || ComputeJudgeResult(groupTasks);
|
noteEqual = noteEqual || ComputeJudgeResult(groupTasks);
|
||||||
|
@ -647,17 +649,19 @@ namespace IRaCIS.Application.Services
|
||||||
AnswerCombination = question.AnswerCombination,
|
AnswerCombination = question.AnswerCombination,
|
||||||
JudgeType = question.JudgeType,
|
JudgeType = question.JudgeType,
|
||||||
QuestionId = question.Id,
|
QuestionId = question.Id,
|
||||||
|
JudgeDifferenceValue=question.JudgeDifferenceValue,
|
||||||
VisitTaskId = questionAnswet.VisitTaskId,
|
VisitTaskId = questionAnswet.VisitTaskId,
|
||||||
};
|
};
|
||||||
var questionAnswerlist = await query.ToListAsync();
|
var questionAnswerlist = await query.ToListAsync();
|
||||||
|
|
||||||
// 将答案进行分组
|
// 将答案进行分组
|
||||||
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new {x.JudgeDifferenceValue, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
||||||
{
|
{
|
||||||
QuestionId = x.Key.QuestionId,
|
QuestionId = x.Key.QuestionId,
|
||||||
AnswerGroup = x.Key.AnswerGroup,
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
AnswerCombination = x.Key.AnswerCombination,
|
AnswerCombination = x.Key.AnswerCombination,
|
||||||
JudgeType = x.Key.JudgeType,
|
JudgeType = x.Key.JudgeType,
|
||||||
|
JudgeDifferenceValue=x.Key.JudgeDifferenceValue,
|
||||||
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
noteEqual = ComputeJudgeResult(groupTasks);
|
noteEqual = ComputeJudgeResult(groupTasks);
|
||||||
|
@ -699,13 +703,14 @@ namespace IRaCIS.Application.Services
|
||||||
twoItem.AfterQuestionList.Where(x => x.QuestionId != null && x.IsJudgeQuestion).ToList()
|
twoItem.AfterQuestionList.Where(x => x.QuestionId != null && x.IsJudgeQuestion).ToList()
|
||||||
).ToList();
|
).ToList();
|
||||||
|
|
||||||
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination,x.JudgeDifferenceValue }).Select(x => new GroupTaskAnswerDto
|
||||||
{
|
{
|
||||||
QuestionId = x.Key.QuestionId!.Value,
|
QuestionId = x.Key.QuestionId!.Value,
|
||||||
AnswerGroup = x.Key.AnswerGroup,
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
AnswerCombination = x.Key.AnswerCombination,
|
AnswerCombination = x.Key.AnswerCombination,
|
||||||
JudgeType = x.Key.JudgeType,
|
JudgeType = x.Key.JudgeType,
|
||||||
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
||||||
|
JudgeDifferenceValue= x.Key.JudgeDifferenceValue,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks);
|
noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks);
|
||||||
}
|
}
|
||||||
|
@ -749,7 +754,7 @@ namespace IRaCIS.Application.Services
|
||||||
AnswerCombination = question.AnswerCombination,
|
AnswerCombination = question.AnswerCombination,
|
||||||
JudgeType = question.JudgeType,
|
JudgeType = question.JudgeType,
|
||||||
QuestionId = question.Id,
|
QuestionId = question.Id,
|
||||||
|
JudgeDifferenceValue=question.JudgeDifferenceValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
var visitTaskQuestions = await query.ToListAsync();
|
var visitTaskQuestions = await query.ToListAsync();
|
||||||
|
@ -758,12 +763,13 @@ namespace IRaCIS.Application.Services
|
||||||
lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
|
lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
|
||||||
).ToList();
|
).ToList();
|
||||||
|
|
||||||
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new {x.JudgeDifferenceValue, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
||||||
{
|
{
|
||||||
QuestionId = x.Key.QuestionId!.Value,
|
QuestionId = x.Key.QuestionId!.Value,
|
||||||
AnswerGroup = x.Key.AnswerGroup,
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
AnswerCombination = x.Key.AnswerCombination,
|
AnswerCombination = x.Key.AnswerCombination,
|
||||||
JudgeType = x.Key.JudgeType,
|
JudgeType = x.Key.JudgeType,
|
||||||
|
JudgeDifferenceValue=x.Key.JudgeDifferenceValue,
|
||||||
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks);
|
noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks);
|
||||||
|
@ -923,6 +929,41 @@ namespace IRaCIS.Application.Services
|
||||||
noteEqual = true;
|
noteEqual = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
|
case JudgeTypeEnum.DifferenceAbsoluteValue:
|
||||||
|
var deffaultValue = taskAnswer1.IsNullOrEmptyReturn0() - taskAnswer2.IsNullOrEmptyReturn0();
|
||||||
|
if (deffaultValue < 0)
|
||||||
|
{
|
||||||
|
deffaultValue =0 -deffaultValue;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (deffaultValue >= item.JudgeDifferenceValue)
|
||||||
|
{
|
||||||
|
noteEqual = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case JudgeTypeEnum.PercentageDifference:
|
||||||
|
var value1 = taskAnswer1.IsNullOrEmptyReturn0();
|
||||||
|
var value2 = taskAnswer2.IsNullOrEmptyReturn0();
|
||||||
|
if (value1 == 0 || value2 == 0)
|
||||||
|
{
|
||||||
|
noteEqual = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (value1 < value2)
|
||||||
|
{
|
||||||
|
noteEqual = (value2 - value1) / value1 >= item.JudgeDifferenceValue;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
noteEqual = (value1 - value2) / value2 >= item.JudgeDifferenceValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
noteEqual = false;
|
noteEqual = false;
|
||||||
|
|
Loading…
Reference in New Issue