浏览代码

Merge branch 'release/yibin' of http://110.188.24.182:10023/Fengwo/hotline into release/yibin

田爽 9 月之前
父节点
当前提交
889c83605a
共有 1 个文件被更改,包括 13 次插入13 次删除
  1. 13 13
      src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

+ 13 - 13
src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

@@ -156,7 +156,7 @@ FROM (
 		select  ""HandlerOrgId"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"",0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"" ,0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"" ,0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"",0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2   {2} --and ""t"".""CountersignPosition""<=1 
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10  and ""t"".""Status"">=2   {2} --and ""t"".""CountersignPosition""<=1 
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -174,7 +174,7 @@ FROM (
 		select  ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -192,7 +192,7 @@ FROM (
 		select  ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0  {2}
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0  {2}
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -211,7 +211,7 @@ FROM (
 		select  ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""DelayEnd"",0 ""DelayWait"" ,0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -354,7 +354,7 @@ FROM (
 		select  ""HandlerOrgId"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"",0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"" ,0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"" ,0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"",0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2   {2} --and ""t"".""CountersignPosition""<=1 
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2   {2} --and ""t"".""CountersignPosition""<=1 
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -372,7 +372,7 @@ FROM (
 		select  ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -390,7 +390,7 @@ FROM (
 		select  ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""HqybOverdue"",0 ""HqzbOverdue"",0 ""DelayEnd"",0 ""DelayWait"",0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0  {2}
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0  {2}
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -409,7 +409,7 @@ FROM (
 		select  ""HandlerOrgId"",0 ""YbOrderCountNum"",0 ""ZbOrderCountNum"",0 ""YbOverdue"" ,0 ""ZbOverdue"",0 ""HqybOverdue"",0 ""HqzbOverdue"",SUM(( CASE  WHEN ( ""HandlerOrgId"" IS NOT NULL ) THEN 1  ELSE 0 END )) AS ""DelayEnd"",0 ""DelayWait"" ,0""Archived"",0 ""ToBeArchived"",0 ""WaitPublished"",0 ""PublishedOpen"",0 ""PublishedNoOpen"",0 ""OrderDelayCount"",0 ""ScreenCount"",0 ""ScreenApproval"", 0 ""ScreenPass"" , 0 ""ScreenNotPass"" ,0 ""SatisfactionCount"", 0 ""NotSatisfactionCount"" from(
 		 select ""o"".""Id"",SUBSTRING(""t"".""HandlerOrgId"",1,{3}) ""HandlerOrgId"" from ""workflow_trace"" ""t""
 			left join ""order"" ""o"" on ""o"".""Id""=""t"".""ExternalId""
-			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
+			where ""o"".""CreationTime"">='{0}' and ""o"".""CreationTime""<='{1}'  and ""t"".""ModuleCode""='OrderHandle' and ""t"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
 			GROUP BY ""HandlerOrgId"",""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
@@ -504,7 +504,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", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -539,7 +539,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.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", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -563,7 +563,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.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", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -587,7 +587,7 @@ 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", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -610,7 +610,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.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", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))