diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index bfab7b26a..e2515a030 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -13524,7 +13524,7 @@ 生成的阅片模块(在大列表上展示的) 阅片期 - + 生成的阅片模块(在大列表上展示的) 阅片期 diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 4a78f3e06..9dc3e07ea 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -3135,22 +3135,26 @@ namespace IRaCIS.Core.Application.Service Random random = new Random(); var skipcount = 0; - - var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime); - if (maxReadingTime != null) - { - query = query.Where(x => x.FirstReadingTime == maxReadingTime); - skipcount = 0; - } - + var minRandomOrder = query.Where(t => t.RandomOrder != null).Select(t => t.RandomOrder).MinOrDefault(); - //阅片中的可能没序号,以阅片中优先先给IR - if (minRandomOrder != null && maxReadingTime == null) + //以随机序号优先,阅片中优先先给IR + if (minRandomOrder != null) { query = query.Where(x => x.RandomOrder == minRandomOrder); skipcount = 0; } + else + { + //没有随机序号的,那么就按照阅片中最新的时间给 + var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime); + if (maxReadingTime != null) + { + query = query.Where(x => x.FirstReadingTime == maxReadingTime); + skipcount = 0; + } + } + var count = await query.CountAsync();