|
@@ -2224,14 +2224,12 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
{
|
|
|
var itemsHandled = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Workflow>((x, w) => x.WorkflowId == w.Id)
|
|
|
- //.LeftJoin<WorkflowStepHandler>((x, w, wsh) => x.StepId == wsh.WorkflowStepId && wsh.IsActualHandler == true)
|
|
|
.InnerJoin<SchedulingUser>((x, w, su) => x.HandlerId == su.UserId)
|
|
|
.Where((x, w, su) => w.ModuleCode == "OrderHandle" && x.BusinessType == EBusinessType.Send && x.Status == EWorkflowStepStatus.Handled)
|
|
|
.Where((x, w, su) => x.CreationTime >= dto.StartTime.Value)
|
|
|
.Where((x, w, su) => x.CreationTime <= dto.EndTime.Value)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserName), (x, w, su) => su.UserName == dto.UserName)
|
|
|
.GroupBy((x, w, su) => new { su.UserId, su.UserName })
|
|
|
- //.Having((x, w, wsh, su) => SqlFunc.AggregateCount(x.WorkflowId) == 1)
|
|
|
.Select((x, w, su) => new BiOrderSendVo
|
|
|
{
|
|
|
UserId = su.UserId,
|
|
@@ -2241,14 +2239,12 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
});
|
|
|
var itemsNo = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Workflow>((x, w) => x.WorkflowId == w.Id)
|
|
|
- //.LeftJoin<WorkflowStepHandler>((x, w, wsh) => x.StepId == wsh.WorkflowStepId && wsh.IsActualHandler == true)
|
|
|
.InnerJoin<SchedulingUser>((x, w, su) => x.HandlerId == su.UserId)
|
|
|
.Where((x, w, su) => w.ModuleCode == "OrderHandle" && x.BusinessType == EBusinessType.Send && x.Status != EWorkflowStepStatus.Handled)
|
|
|
.Where((x, w, su) => x.CreationTime >= dto.StartTime.Value)
|
|
|
.Where((x, w, su) => x.CreationTime <= dto.EndTime.Value)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserName), (x, w, su) => su.UserName == dto.UserName)
|
|
|
.GroupBy((x, w, su) => new { su.UserId, su.UserName })
|
|
|
- //.Having((x, w, wsh, su) => SqlFunc.AggregateCount(x.WorkflowId) == 1)
|
|
|
.Select((x, w, su) => new BiOrderSendVo
|
|
|
{
|
|
|
UserId = su.UserId,
|
|
@@ -2257,7 +2253,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
NoSendOrderNum = SqlFunc.AggregateDistinctCount(w.ExternalId),
|
|
|
});
|
|
|
var items = await itemsHandled.LeftJoin(itemsNo, (hand, nohand) => hand.UserId == nohand.UserId)
|
|
|
- .GroupBy((hand, nohand) => hand.UserId)
|
|
|
+ .GroupBy((hand, nohand) => new { hand.UserId , hand.UserName } )
|
|
|
.Select((hand, nohand) => new BiOrderSendVo
|
|
|
{
|
|
|
UserId = hand.UserId,
|