|
@@ -1050,13 +1050,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
var query = _orderRepository.Queryable();
|
|
|
if (!isCenter)
|
|
|
{
|
|
|
- //todo 可优化
|
|
|
- query.Where(d => SqlFunc.Subqueryable<WorkflowTrace>()
|
|
|
+ query.Where(d => SqlFunc.Subqueryable<WorkflowStep>()
|
|
|
.Where(step => step.ExternalId == d.Id &&
|
|
|
!string.IsNullOrEmpty(step.HandlerOrgId) &&
|
|
|
- step.HandlerOrgId.StartsWith(_sessionContextProvider.SessionContext.RequiredOrgId) &&
|
|
|
- step.TraceState != EWorkflowTraceState.StepRemoveByPrevious &&
|
|
|
- step.TraceState != EWorkflowTraceState.StepRemoveByRecall).Any());
|
|
|
+ step.HandlerOrgId.StartsWith(_sessionContextProvider.SessionContext.RequiredOrgId)).Any());
|
|
|
}
|
|
|
|
|
|
return query
|