|
@@ -1858,16 +1858,18 @@ public class OrderController : BaseController
|
|
|
if (dto.PageSize > 100)
|
|
|
dto.PageSize = 100;
|
|
|
|
|
|
+ EWorkflowStepStatus[] handleStatuses = Array.Empty<EWorkflowStepStatus>();
|
|
|
+ if (dto.IsHandled.HasValue)
|
|
|
+ handleStatuses = dto.IsHandled.Value
|
|
|
+ ? new[] { EWorkflowStepStatus.Handled }
|
|
|
+ : new[] { EWorkflowStepStatus.WaitForAccept, EWorkflowStepStatus.WaitForHandle };
|
|
|
+
|
|
|
RefAsync<int> total = 0;
|
|
|
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) =>
|
|
|
- dto.IsHandled.Value
|
|
|
- ? s.Status == EWorkflowStepStatus.Handled
|
|
|
- : s.Status != EWorkflowStepStatus.Handled)
|
|
|
+ .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)
|
|
@@ -1877,14 +1879,6 @@ public class OrderController : BaseController
|
|
|
}, true)
|
|
|
.ToPageListAsync(dto.PageIndex, dto.PageSize, total, HttpContext.RequestAborted);
|
|
|
|
|
|
- //var (total, items) = await _orderRepository.Queryable()
|
|
|
- // .OrderBy(d => d.ExpiredTime)
|
|
|
- // .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
-
|
|
|
- //var dtos = _mapper.Map<IReadOnlyList<OrderWaitedDto>>(items);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return new PagedDto<OrderWaitedDto>(total, dtos);
|
|
|
}
|
|
|
|