Prechádzať zdrojové kódy

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

田爽 9 mesiacov pred
rodič
commit
3238c50cb5

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

@@ -157,7 +157,7 @@ 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"".""TraceState"" !=10  and ""t"".""Status"">=2   {2} --and ""t"".""CountersignPosition""<=1 
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -166,7 +166,7 @@ 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 
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -175,7 +175,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -184,7 +184,7 @@ 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 (SELECT NOW())>""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -193,7 +193,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0  {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -203,7 +203,7 @@ FROM (
 			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 (SELECT NOW())>""StepExpiredTime"" 
 			and   ""CountersignPosition"">0  {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -212,7 +212,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -221,7 +221,7 @@ 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}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL  {4}
 		GROUP BY ""HandlerOrgId""
 		UNION ALL
@@ -355,7 +355,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2   {2} --and ""t"".""CountersignPosition""<=1 
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -364,7 +364,7 @@ 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 
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -373,7 +373,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -382,7 +382,7 @@ 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 (SELECT NOW())>""StepExpiredTime"" and ""t"".""CountersignPosition""=0   {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -391,7 +391,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""HandleTime"">""StepExpiredTime"" and ""CountersignPosition"">0  {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -401,7 +401,7 @@ FROM (
 			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 (SELECT NOW())>""StepExpiredTime"" 
 			and   ""CountersignPosition"">0  {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -410,7 +410,7 @@ 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"".""TraceState"" !=10 and ""t"".""Status"">=2 and ""CountersignPosition"">0 {2}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL {4}
 		GROUP BY ""HandlerOrgId""
 		union ALL
@@ -419,7 +419,7 @@ 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}
-			GROUP BY ""HandlerOrgId"",""o"".""Id""
+			GROUP BY SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
 		)""s"" where ""HandlerOrgId"" IS not NULL  {4}
 		GROUP BY ""HandlerOrgId""
 		UNION ALL
@@ -532,7 +532,7 @@ order by ""su"".""OrgCode""";
                         .WhereIF(dto.OrgCode == "001", x => x.ApplyOrgCode == dto.OrgCode)
                         .WhereIF(dto.OrgCode != "001", x => x.ApplyOrgCode.StartsWith(dto.OrgCode))
                         .OrderByDescending(x => x.Order.CreationTime)
-                        .Select(x => new SelectOrderId { Id = x.Order.Id })
+                        .Select(x => new SelectOrderId { Id = x.OrderId })
                        .MergeTable();
                     break;
                 case EStatisticsType.YBOverdue://已办超期
@@ -682,7 +682,7 @@ order by ""su"".""OrgCode""";
                        .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
                        .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
                        .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
-                        .Select(x => new SelectOrderId { Id = x.Order.Id })
+                        .Select(x => new SelectOrderId { Id = x.OrderId})
                        .MergeTable();
                     break;
                 case EStatisticsType.ScreenApproval://带甄别
@@ -693,7 +693,7 @@ order by ""su"".""OrgCode""";
                        .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
                        .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
                        .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
-                        .Select(x => new SelectOrderId { Id = x.Order.Id })
+                        .Select(x => new SelectOrderId { Id = x.OrderId})
                        .MergeTable();
                     break;
                 case EStatisticsType.ScreenPass://甄别通过
@@ -703,7 +703,7 @@ order by ""su"".""OrgCode""";
                        .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
                        .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
                        .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
-                        .Select(x => new SelectOrderId { Id = x.Order.Id })
+                        .Select(x => new SelectOrderId { Id = x.OrderId })
                        .MergeTable();
                     break;
                 case EStatisticsType.ScreenNotPass://甄别不通过
@@ -713,7 +713,7 @@ order by ""su"".""OrgCode""";
                       .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.Source == ESource.ProvinceStraight)
                       .WhereIF(dto.OrgCode == "001", x => x.CreatorOrgId == dto.OrgCode)
                       .WhereIF(dto.OrgCode != "001", x => x.CreatorOrgId.StartsWith(dto.OrgCode))
-                       .Select(x => new SelectOrderId { Id = x.Order.Id })
+                       .Select(x => new SelectOrderId { Id = x.OrderId})
                       .MergeTable();
                     break;
                 default: