|
@@ -132,7 +132,7 @@ namespace Hotline.Application.StatisticalReport
|
|
|
{
|
|
|
OrgCode = it.OrgCode,
|
|
|
// OrderCountNum = SqlFunc.AggregateCount(it.OrgCode),//总量
|
|
|
- YBOrderCountNum = 0,// SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed, 1, 0)),//已办// SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed, 1, 0)),//已办
|
|
|
+ YBOrderCountNum = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed, 1, 0)),//已办// SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed, 1, 0)),//已办
|
|
|
ZBOrderCountNum = 0, //ZBOrderCountNum = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status < EOrderStatus.Filed, 1, 0)),//在办
|
|
|
Archived = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed, 1, 0)),//已归档
|
|
|
ToBeArchived = 0,
|
|
@@ -809,19 +809,30 @@ namespace Hotline.Application.StatisticalReport
|
|
|
#region 工单已办
|
|
|
if (stye == "0")
|
|
|
{
|
|
|
+ var ybQuery = _orderRepository.Queryable()
|
|
|
+ .Where(it => it.CreationTime >= dto.StartDate && it.CreationTime <= dto.EndDate && it.Status > EOrderStatus.WaitForAccept)
|
|
|
+ .WhereIF(dto.OrgCode == "001", it => it.ActualHandleOrgCode == dto.OrgCode)
|
|
|
+ .WhereIF(dto.OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.StatisticsType == EStatisticsType.YBOrderCountNum, it => it.Status >= EOrderStatus.Filed)//已办
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, it => it.Source == ESource.ProvinceStraight)
|
|
|
+ .Select(it => new SelectOrderId { Id = it.Id })
|
|
|
+ .MergeTable();
|
|
|
+
|
|
|
+ //var hqybquery = _workflowStepHandleRepository.Queryable()
|
|
|
+ // .LeftJoin<WorkflowTrace>((x, o) => x.WorkflowStepId == o.StepId)
|
|
|
var hqybquery = _workflowTraceRepository.Queryable()
|
|
|
.LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
|
|
|
.Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartDate && t.CreationTime <= dto.EndDate)
|
|
|
.WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
- .WhereIF(dto.StatisticsType == EStatisticsType.YBOrderCountNum, (t, o) => t.Status >= EWorkflowStepStatus.Handled)//查询所有已办工单 && t.CountersignPosition > ECountersignPosition.None
|
|
|
+ .WhereIF(dto.StatisticsType == EStatisticsType.YBOrderCountNum, (t, o) => t.Status >= EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None)//会签已办
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
- .MergeTable()
|
|
|
- .GroupBy(p => p.Id)
|
|
|
.MergeTable();
|
|
|
|
|
|
- return hqybquery;
|
|
|
+ var queryData = _orderRepository.OrderListUnionAll(ybQuery, hqybquery).GroupBy(p=>p.Id);
|
|
|
+
|
|
|
+ return queryData;
|
|
|
}
|
|
|
#endregion
|
|
|
|