Bläddra i källkod

部门办件统计排除退回工单

tangjiang 9 månader sedan
förälder
incheckning
e59c5bf940
1 ändrade filer med 11 tillägg och 7 borttagningar
  1. 11 7
      src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

+ 11 - 7
src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

@@ -42,7 +42,7 @@ namespace Hotline.Application.StatisticalReport
         private readonly IRepository<OrderScreen> _orderScreenRepository;
         private readonly IOrderSecondaryHandlingApplication _orderSecondaryHandlingApplication;
         private readonly ITimeLimitDomainService _timeLimitDomainService;
-        
+
 
         public OrderReportApplication(
             IOrderRepository orderRepository,
@@ -87,7 +87,7 @@ namespace Hotline.Application.StatisticalReport
             _orderScreenRepository = orderScreenRepository;
             _orderSecondaryHandlingApplication = orderSecondaryHandlingApplication;
             _timeLimitDomainService = timeLimitDomainService;
-            
+
         }
         /// <summary>
         /// 部门办件统计表---新
@@ -506,7 +506,7 @@ order by ""su"".""OrgCode""";
                     query = _workflowTraceRepository.Queryable()
                         .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
                          .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
-                         && t.Status >= EWorkflowStepStatus.Handled)
+                         && t.Status >= EWorkflowStepStatus.Handled && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
                          .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                          .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                          .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -544,7 +544,8 @@ order by ""su"".""OrgCode""";
                     query = _workflowTraceRepository.Queryable()
                         .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
                          .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
-                         && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition == ECountersignPosition.None)
+                         && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition == ECountersignPosition.None 
+                         && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
                          .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                          .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                          .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -570,7 +571,8 @@ order by ""su"".""OrgCode""";
                     query = _workflowTraceRepository.Queryable()
                         .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
                          .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
-                         && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition > ECountersignPosition.None)
+                         && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition > ECountersignPosition.None
+                         && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
                          .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                          .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                          .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -596,7 +598,8 @@ order by ""su"".""OrgCode""";
                     var cqybquery = _workflowTraceRepository.Queryable()
                            .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
                             .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
-                            && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition >= ECountersignPosition.None)
+                            && t.Status >= EWorkflowStepStatus.Handled && t.HandleTime > t.StepExpiredTime && t.CountersignPosition >= ECountersignPosition.None 
+                            && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
                             .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                             .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                          .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -621,7 +624,8 @@ order by ""su"".""OrgCode""";
                     query = _workflowTraceRepository.Queryable()
                            .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
                             .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime
-                            && t.Status >= EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None)
+                            && t.Status >= EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None 
+                            && t.TraceState != EWorkflowTraceState.StepRemoveByPrevious)
                             .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                             .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                          .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))