修改
	
		
			
	
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
					Details
				
			
		
	
				
					
				
			
				
	
				continuous-integration/drone/push Build is passing
				
					Details
				
			
		
	
							parent
							
								
									74e0765d7a
								
							
						
					
					
						commit
						84f76c09f7
					
				| 
						 | 
					@ -1573,7 +1573,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public Guid? QuestionId { get; set; }
 | 
					        public Guid? QuestionId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool IsHaveChange { get; set; } = false;
 | 
							/// <summary>
 | 
				
			||||||
 | 
							/// 裁判百分比或绝对值的相差值
 | 
				
			||||||
 | 
							/// </summary>
 | 
				
			||||||
 | 
							public decimal? JudgeDifferenceValue { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public bool IsHaveChange { get; set; } = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string VisitAnswer { get; set; } = string.Empty;
 | 
					        public string VisitAnswer { get; set; } = string.Empty;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2267,7 +2272,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public Guid QuestionId { get; set; }
 | 
					        public Guid QuestionId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string AnswerGroup { get; set; }
 | 
							/// <summary>
 | 
				
			||||||
 | 
							/// 裁判百分比或绝对值的相差值
 | 
				
			||||||
 | 
							/// </summary>
 | 
				
			||||||
 | 
							public decimal? JudgeDifferenceValue { get; set; }
 | 
				
			||||||
 | 
							public string AnswerGroup { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string AnswerCombination { get; set; }
 | 
					        public string AnswerCombination { get; set; }
 | 
				
			||||||
| 
						 | 
					@ -2311,7 +2320,12 @@ 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; }
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public class GetSystemReadingQuestionPageDto
 | 
					    public class GetSystemReadingQuestionPageDto
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -250,7 +250,9 @@ namespace IRaCIS.Application.Services
 | 
				
			||||||
                  .Select(y => new GlobalQuestionInfo()
 | 
					                  .Select(y => new GlobalQuestionInfo()
 | 
				
			||||||
                  {
 | 
					                  {
 | 
				
			||||||
                     
 | 
					                     
 | 
				
			||||||
                      QuestionId = y.ReadingQuestionTrialId,
 | 
					                      JudgeDifferenceValue= y.ReadingQuestionTrial.JudgeDifferenceValue,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										  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,
 | 
				
			||||||
                      AnswerGroup = y.ReadingQuestionTrial.AnswerGroup,
 | 
					                      AnswerGroup = y.ReadingQuestionTrial.AnswerGroup,
 | 
				
			||||||
| 
						 | 
					@ -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,7 +376,8 @@ 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()
 | 
				
			||||||
                      ),
 | 
					                      ),
 | 
				
			||||||
                      VisitAnswer = lr.question.Answer,
 | 
					                      JudgeDifferenceValue= lr.question.JudgeDifferenceValue,
 | 
				
			||||||
 | 
										  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,
 | 
				
			||||||
                      QuestionName = lr.question.QuestionName.LanguageName(lr.question.QuestionEnName, _userInfo.IsEn_Us),
 | 
					                      QuestionName = lr.question.QuestionName.LanguageName(lr.question.QuestionEnName, _userInfo.IsEn_Us),
 | 
				
			||||||
| 
						 | 
					@ -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,14 +703,15 @@ 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(),
 | 
				
			||||||
                                        }).ToList();
 | 
																JudgeDifferenceValue= x.Key.JudgeDifferenceValue,
 | 
				
			||||||
 | 
															}).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);
 | 
				
			||||||
| 
						 | 
					@ -924,7 +930,42 @@ namespace IRaCIS.Application.Services
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                });
 | 
					                                });
 | 
				
			||||||
                                break;
 | 
					                                break;
 | 
				
			||||||
                            default:
 | 
					                            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;
 | 
				
			||||||
 | 
												default:
 | 
				
			||||||
                                noteEqual = false;
 | 
					                                noteEqual = false;
 | 
				
			||||||
                                break;
 | 
					                                break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue