Browse Source

超期列表显示

田爽 8 months ago
parent
commit
ee7ecb8c6c
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/Hotline.Application/Orders/OrderApplication.cs

+ 8 - 1
src/Hotline.Application/Orders/OrderApplication.cs

@@ -48,6 +48,7 @@ using JiebaNet.Segmenter;
 using Microsoft.AspNetCore.Http;
 using WordInfo = PanGu.WordInfo;
 using Hotline.Schedulings;
+using XF.Domain.Entities;
 
 namespace Hotline.Application.Orders;
 
@@ -286,7 +287,13 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         DateTime stTime = _timeLimitDomainService.WorkDay(DateTime.Now);
         var IsCenter = _sessionContext.OrgIsCenter;
 
-        return _orderRepository.Queryable(canView: !IsCenter).Includes(d => d.OrderDelays)
+        return _orderRepository.Queryable().Includes(d => d.OrderDelays)
+		    .Where(d => SqlFunc.Subqueryable<WorkflowStep>()
+			        .Where(step => step.ExternalId == d.Id &&
+			                       ((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) && step.HandlerId == _sessionContext.RequiredUserId) ||
+			                        (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) && step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
+			                        (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) && _sessionContext.Roles.Contains(step.RoleId))))
+			        .Any())
             .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
             //.WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
             .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.No.Contains(dto.No))