From 55228dfc26cd5325c38f77077b44ccf909e744f2 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Oct 2022 15:43:48 +0800 Subject: [PATCH] x --- .../Service/Allocation/TaskAllocationRuleService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index b67e0f64..64246141 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -165,9 +165,13 @@ namespace IRaCIS.Core.Application.Service UserCode = user.UserCode, UserName = user.UserName, UserTypeEnum = user.UserTypeRole.UserTypeEnum, - ReadingCategoryList = allocationRule.Enroll.EnrollReadingCategoryList.AsQueryable() - .WhereIf(selectQuery.ReadingCategory != null,t=> t.ReadingCategory == selectQuery.ReadingCategory) - .WhereIf(selectQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId) + + ReadingCategoryList = selectQuery.TrialReadingCriterionId == null ? + allocationRule.Enroll.EnrollReadingCategoryList + .Select(t => t.ReadingCategory).OrderBy(t => t).ToList(): + + allocationRule.Enroll.EnrollReadingCategoryList + .Where( t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId) .Select(t => t.ReadingCategory).OrderBy(t=>t).ToList() };