|
@@ -1863,21 +1863,24 @@ public class OrderController : BaseController
|
|
handleStatuses = dto.IsHandled.Value
|
|
handleStatuses = dto.IsHandled.Value
|
|
? new[] { EWorkflowStepStatus.Handled }
|
|
? new[] { EWorkflowStepStatus.Handled }
|
|
: new[] { EWorkflowStepStatus.WaitForAccept, EWorkflowStepStatus.WaitForHandle };
|
|
: new[] { EWorkflowStepStatus.WaitForAccept, EWorkflowStepStatus.WaitForHandle };
|
|
-
|
|
|
|
|
|
+
|
|
RefAsync<int> total = 0;
|
|
RefAsync<int> total = 0;
|
|
var dtos = await _workflowStepRepository.Queryable()
|
|
var dtos = await _workflowStepRepository.Queryable()
|
|
- .InnerJoin<Workflow>((s, w) => s.WorkflowId == w.Id)
|
|
|
|
- .LeftJoin<Order>((s, w, o) => w.ExternalId == o.Id)
|
|
|
|
- .WhereIF(dto.IsProvince.HasValue, (s, w, o) => o.IsProvince == dto.IsProvince)
|
|
|
|
- .WhereIF(dto.IsHandled.HasValue, (s, w, o) => handleStatuses.Contains(s.Status))
|
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
|
|
- (s, w, o) => o.No.Contains(dto.Keyword) || o.Title.Contains(dto.Keyword))
|
|
|
|
- .OrderByDescending((s) => s.StepExpiredTime)
|
|
|
|
- .Select((s, w, o) => new OrderWaitedDto
|
|
|
|
- {
|
|
|
|
- StepExpiredTime = s.StepExpiredTime
|
|
|
|
- }, true)
|
|
|
|
- .ToPageListAsync(dto.PageIndex, dto.PageSize, total, HttpContext.RequestAborted);
|
|
|
|
|
|
+ .InnerJoin<Workflow>((s, w) => s.WorkflowId == w.Id)
|
|
|
|
+ .LeftJoin<Order>((s, w, o) => w.ExternalId == o.Id)
|
|
|
|
+ .Where((s, w, o) => SqlFunc.JsonListObjectAny(s.Handlers, "Key", _sessionContext.RequiredUserId) ||
|
|
|
|
+ SqlFunc.JsonListObjectAny(s.Handlers, "Key", _sessionContext.RequiredOrgId))
|
|
|
|
+ .WhereIF(dto.IsProvince.HasValue, (s, w, o) => o.IsProvince == dto.IsProvince)
|
|
|
|
+ .WhereIF(dto.IsHandled.HasValue, (s, w, o) => handleStatuses.Contains(s.Status))
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
|
|
+ (s, w, o) => o.No.Contains(dto.Keyword) || o.Title.Contains(dto.Keyword))
|
|
|
|
+ .OrderByDescending((s) => s.StepExpiredTime)
|
|
|
|
+ .Select((s, w, o) => new OrderWaitedDto
|
|
|
|
+ {
|
|
|
|
+ StepExpiredTime = s.StepExpiredTime,
|
|
|
|
+ Status = o.Status
|
|
|
|
+ }, true)
|
|
|
|
+ .ToPageListAsync(dto.PageIndex, dto.PageSize, total, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<OrderWaitedDto>(total, dtos);
|
|
return new PagedDto<OrderWaitedDto>(total, dtos);
|
|
}
|
|
}
|