|
@@ -23,43 +23,36 @@ namespace Hotline.Application.StatisticalReport
|
|
|
public class OrderReportApplication : IOrderReportApplication, IScopeDependency
|
|
|
{
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
- private readonly IRepository<Hotspot> _hotspotTypeRepository;
|
|
|
- private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
private readonly IRepository<OrderVisitDetail> _orderVisitDetailRepository;
|
|
|
private readonly IRepository<OrderDelay> _orderDelayRepository;
|
|
|
private readonly IMapper _mapper;
|
|
|
- private readonly IRepository<WorkflowCountersign> _workflowCountersignRepository;
|
|
|
- private readonly IRepository<OrderSpecial> _orderSpecialRepository;
|
|
|
- private readonly IRepository<OrderVisit> _orderVisitRepository;
|
|
|
- private readonly IRepository<TrCallRecord> _trCallRecordRepository;
|
|
|
private readonly IRepository<OrderPublish> _orderPublishRepository;
|
|
|
- private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
|
|
|
- private readonly IRepository<AiOrderVisitDetail> _aiOrderVisitDetailRepository;
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
- private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
- private readonly IRepository<OrderSpecialDetail> _orderSpecialDetailRepository;
|
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
private readonly IOrderSecondaryHandlingApplication _orderSecondaryHandlingApplication;
|
|
|
private readonly ITimeLimitDomainService _timeLimitDomainService;
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="orderRepository"></param>
|
|
|
+ /// <param name="orderVisitDetailRepository"></param>
|
|
|
+ /// <param name="orderDelayRepository"></param>
|
|
|
+ /// <param name="mapper"></param>
|
|
|
+ /// <param name="orderPublishRepository"></param>
|
|
|
+ /// <param name="sessionContext"></param>
|
|
|
+ /// <param name="workflowTraceRepository"></param>
|
|
|
+ /// <param name="orderScreenRepository"></param>
|
|
|
+ /// <param name="orderSecondaryHandlingApplication"></param>
|
|
|
+ /// <param name="timeLimitDomainService"></param>
|
|
|
public OrderReportApplication(
|
|
|
IOrderRepository orderRepository,
|
|
|
- IRepository<Hotspot> hotspotTypeRepository,
|
|
|
- ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
|
IRepository<OrderVisitDetail> orderVisitDetailRepository,
|
|
|
IRepository<OrderDelay> orderDelayRepository,
|
|
|
- IRepository<WorkflowCountersign> workflowCountersignRepository,
|
|
|
- IRepository<OrderSpecial> orderSpecialRepository,
|
|
|
IMapper mapper,
|
|
|
- IRepository<OrderVisit> orderVisitRepository,
|
|
|
- IRepository<TrCallRecord> trCallRecordRepository,
|
|
|
IRepository<OrderPublish> orderPublishRepository,
|
|
|
- IRepository<SystemOrganize> systemOrganizeRepository,
|
|
|
- IRepository<AiOrderVisitDetail> aiOrderVisitDetailRepository,
|
|
|
ISessionContext sessionContext,
|
|
|
- ISystemSettingCacheManager systemSettingCacheManager,
|
|
|
- IRepository<OrderSpecialDetail> orderSpecialDetailRepository,
|
|
|
IRepository<WorkflowTrace> workflowTraceRepository,
|
|
|
IRepository<OrderScreen> orderScreenRepository,
|
|
|
IOrderSecondaryHandlingApplication orderSecondaryHandlingApplication,
|
|
@@ -67,25 +60,16 @@ namespace Hotline.Application.StatisticalReport
|
|
|
)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
- _hotspotTypeRepository = hotspotTypeRepository;
|
|
|
- _sysDicDataCacheManager = sysDicDataCacheManager;
|
|
|
_orderVisitDetailRepository = orderVisitDetailRepository;
|
|
|
_orderDelayRepository = orderDelayRepository;
|
|
|
- _workflowCountersignRepository = workflowCountersignRepository;
|
|
|
- _orderSpecialRepository = orderSpecialRepository;
|
|
|
_mapper = mapper;
|
|
|
- _orderVisitRepository = orderVisitRepository;
|
|
|
- _trCallRecordRepository = trCallRecordRepository;
|
|
|
_orderPublishRepository = orderPublishRepository;
|
|
|
- _systemOrganizeRepository = systemOrganizeRepository;
|
|
|
- _aiOrderVisitDetailRepository = aiOrderVisitDetailRepository;
|
|
|
_sessionContext = sessionContext;
|
|
|
- _systemSettingCacheManager = systemSettingCacheManager;
|
|
|
- _orderSpecialDetailRepository = orderSpecialDetailRepository;
|
|
|
_workflowTraceRepository = workflowTraceRepository;
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
_orderSecondaryHandlingApplication = orderSecondaryHandlingApplication;
|
|
|
_timeLimitDomainService = timeLimitDomainService;
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 部门办件统计表---新
|
|
@@ -156,8 +140,8 @@ 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
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -166,7 +150,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
|
|
@@ -174,8 +158,8 @@ 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}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -184,7 +168,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
|
|
@@ -192,8 +176,8 @@ 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}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -203,7 +187,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
|
|
@@ -211,8 +195,8 @@ 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}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -221,7 +205,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
|
|
@@ -354,8 +338,8 @@ 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
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -364,7 +348,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
|
|
@@ -372,8 +356,8 @@ 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}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -382,7 +366,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
|
|
@@ -390,8 +374,8 @@ 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}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -401,7 +385,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
|
|
@@ -409,8 +393,8 @@ 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}
|
|
|
- GROUP BY ""HandlerOrgId"",""o"".""Id""
|
|
|
+ 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 SUBSTRING(""t"".""HandlerOrgId"",1,{3}),""o"".""Id""
|
|
|
)""s"" where ""HandlerOrgId"" IS not NULL {4}
|
|
|
GROUP BY ""HandlerOrgId""
|
|
|
union ALL
|
|
@@ -419,7 +403,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
|
|
@@ -504,10 +488,11 @@ 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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -519,7 +504,8 @@ order by ""su"".""OrgCode""";
|
|
|
&& t.Status < EWorkflowStepStatus.Handled)
|
|
|
.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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -530,7 +516,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && d.DelayState == EDelayState.Pass)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (d, o) => d.ApplyOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", (d, o) => d.ApplyOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (d, o) => d.ApplyOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode == "001" && dto.OrgCode == dto.ParentOrgCode, (d, o) => d.ApplyOrgCode == dto.OrgCode)
|
|
|
.OrderByDescending((d, o) => o.CreationTime)
|
|
|
.Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -539,10 +526,12 @@ 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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -554,7 +543,8 @@ order by ""su"".""OrgCode""";
|
|
|
&& t.Status < EWorkflowStepStatus.Handled && DateTime.Now > t.StepExpiredTime && t.CountersignPosition == ECountersignPosition.None)
|
|
|
.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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -563,10 +553,12 @@ 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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -578,7 +570,8 @@ order by ""su"".""OrgCode""";
|
|
|
&& t.Status < EWorkflowStepStatus.Handled && DateTime.Now > t.StepExpiredTime && t.CountersignPosition > ECountersignPosition.None)
|
|
|
.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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -587,10 +580,12 @@ 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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -600,7 +595,8 @@ order by ""su"".""OrgCode""";
|
|
|
&& t.Status < EWorkflowStepStatus.Handled && DateTime.Now > t.StepExpiredTime && t.CountersignPosition >= ECountersignPosition.None)
|
|
|
.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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -610,10 +606,12 @@ 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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -625,7 +623,8 @@ order by ""su"".""OrgCode""";
|
|
|
&& t.Status < EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None)
|
|
|
.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))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
|
|
|
.GroupBy((t, o) => o.Id)
|
|
|
.Select((t, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
@@ -635,7 +634,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where(o => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Status < EOrderStatus.WaitForAccept)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, o => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.Select(o => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -644,7 +644,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where(o => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Status >= EOrderStatus.Filed)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, o => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.Select(o => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -653,7 +654,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where(o => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Status == EOrderStatus.Filed)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, o => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.Select(o => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -662,7 +664,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where(o => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Status >= EOrderStatus.Published && o.IsPublicity == true)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, o => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.Select(o => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -671,7 +674,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where(o => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Status >= EOrderStatus.Published && o.IsPublicity == false)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, o => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, o => o.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.Select(o => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -681,7 +685,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
.Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -692,7 +697,8 @@ order by ""su"".""OrgCode""";
|
|
|
&& (d.Status == EScreenStatus.Approval || d.Status == EScreenStatus.Apply))
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
.Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -700,9 +706,10 @@ order by ""su"".""OrgCode""";
|
|
|
query = _orderScreenRepository.Queryable()
|
|
|
.LeftJoin<Order>((d, o) => d.OrderId == o.Id)
|
|
|
.Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null && d.Status == EScreenStatus.End)
|
|
|
- .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) =>o.Source == ESource.ProvinceStraight)
|
|
|
+ .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
.Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -712,7 +719,8 @@ order by ""su"".""OrgCode""";
|
|
|
.Where((d, o) => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Id != null && d.Status == EScreenStatus.Refuse)
|
|
|
.WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (d, o) => o.Source == ESource.ProvinceStraight)
|
|
|
.WhereIF(dto.OrgCode == "001", (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
- .WhereIF(dto.OrgCode != "001", (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode != dto.ParentOrgCode, (d, o) => d.CreatorOrgId.StartsWith(dto.OrgCode))
|
|
|
+ .WhereIF(dto.OrgCode != "001" && dto.OrgCode == dto.ParentOrgCode, (d, o) => d.CreatorOrgId == dto.OrgCode)
|
|
|
.Select((d, o) => new SelectOrderId { Id = o.Id })
|
|
|
.MergeTable();
|
|
|
break;
|
|
@@ -1782,5 +1790,58 @@ order by ""su"".""OrgCode""";
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
.MergeTable();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 满意度明细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public ISugarQueryable<OrderVisitDetail> OrgVisitDetailList(OrgVisitDetailListReq dto)
|
|
|
+ {
|
|
|
+ var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
+
|
|
|
+ return _orderVisitDetailRepository.Queryable()
|
|
|
+ .Includes(x => x.OrderVisit, x => x.Order, x => x.OrderScreens)
|
|
|
+ .Includes(x => x.OrderVisit, x => x.Employee)
|
|
|
+ .Where(x => x.OrderVisit.VisitState == EVisitState.Visited && x.VisitTarget == EVisitTarget.Org)
|
|
|
+ .WhereIF(IsCenter == false, x => x.VisitOrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
|
+ .WhereIF(dto.OrgVisitStatisticsType.HasValue, x => x.OrderVisit.Order.ProcessType == (EProcessType)((int)dto.OrgVisitStatisticsType))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.OrgProcessingResults), x => SqlFunc.JsonField(x.OrgProcessingResults, "Key") == dto.OrgProcessingResults)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.VisitUser), x => x.OrderVisit.Employee.Name.Contains(dto.VisitUser))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderVisit.Order.No == dto.No)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.OrderVisit.Order.Title.Contains(dto.Title))
|
|
|
+ .WhereIF(dto.OrgCodes.Any(), x => dto.OrgCodes.Contains(x.VisitOrgCode))
|
|
|
+ .WhereIF(dto.HotspotIds.Any(), x => dto.HotspotIds.Contains(x.OrderVisit.Order.HotspotId))
|
|
|
+ .WhereIF(dto.Channels.Any(), x => dto.Channels.Contains(x.OrderVisit.Order.SourceChannelCode))
|
|
|
+ .WhereIF(dto.CreationTimeStart.HasValue, x => x.OrderVisit.Order.CreationTime >= dto.CreationTimeStart) //受理时间开始
|
|
|
+ .WhereIF(dto.CreationTimeEnd.HasValue, x => x.OrderVisit.Order.CreationTime <= dto.CreationTimeEnd) //受理时间结束
|
|
|
+ .WhereIF(dto.ActualHandleTimeStart.HasValue, x => x.OrderVisit.Order.ActualHandleTime >= dto.ActualHandleTimeStart) //办结时间开始
|
|
|
+ .WhereIF(dto.ActualHandleTimeEnd.HasValue, x => x.OrderVisit.Order.ActualHandleTime <= dto.ActualHandleTimeEnd)
|
|
|
+ .OrderBy(x => x.OrderVisit.VisitTime); //办结时间结束
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 受理类型统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public ISugarQueryable<AcceptTypeStatisticsDto> AcceptTypeStatistics(AcceptTypeStatisticsReq dto)
|
|
|
+ {
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
+ var query = _orderRepository.Queryable()
|
|
|
+ .Where(x => x.CreationTime >= dto.StartTime && x.CreationTime < dto.EndTime)
|
|
|
+ .GroupBy(x => x.AcceptType)
|
|
|
+ .Select(x => new AcceptTypeStatisticsDto
|
|
|
+ {
|
|
|
+ AcceptType = x.AcceptType,
|
|
|
+ SumCount = SqlFunc.AggregateCount(x.AcceptType),
|
|
|
+ CompletionCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed, 1, 0)),
|
|
|
+ VisitCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status == EOrderStatus.Visited, 1, 0))
|
|
|
+ });
|
|
|
+ return query;
|
|
|
+ }
|
|
|
}
|
|
|
}
|