|
@@ -6048,7 +6048,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.Where(x => x.State == ESendBackAuditState.End && x.ApplyOrgId != OrgSeedData.CenterId && x.SendBackOrgId == OrgSeedData.CenterId)
|
|
|
.WhereIF(dto.StartTime.HasValue && dto.EndTime.HasValue, x => x.AuditTime >= dto.StartTime && x.AuditTime <= dto.EndTime)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgId), x => x.ApplyOrgId == dto.OrgId)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No!))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Order.Title.Contains(dto.Title!))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgId), x => x.ApplyOrgId == dto.OrgId)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.AcceptType), x => x.Order.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
@@ -6148,13 +6148,25 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
if (dto.StatisticsType == "sendOrderNum")
|
|
|
{
|
|
|
var query = _orderRepository.Queryable().Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
- .Where(x => SqlFunc.Subqueryable<WorkflowTrace>().Where(wt => wt.ExternalId == x.Id && wt.HandlerOrgId != OrgSeedData.CenterId && (wt.PrevStepName == "班长审批" || wt.PrevStepName == "派单组")).Any())
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Title.Contains(dto.Title!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), x => x.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Hotspot),
|
|
|
+ x => x.HotspotSpliceName != null && x.HotspotSpliceName.Contains(dto.Hotspot)) //热点分类
|
|
|
+ .Where(x => SqlFunc.Subqueryable<WorkflowTrace>().Where(wt => wt.ExternalId == x.Id && wt.HandlerOrgId != OrgSeedData.CenterId && (wt.PrevStepName == "班长审批" || wt.PrevStepName == "派单组")).Any())
|
|
|
.Select(x=> new OrderDto() { Id = x.Id.SelectAll() });
|
|
|
return query;
|
|
|
}
|
|
|
else if(dto.StatisticsType == "sendOrderBackNum")
|
|
|
{
|
|
|
var query = _orderRepository.Queryable().Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Title.Contains(dto.Title!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), x => x.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Hotspot),
|
|
|
+ x => x.HotspotSpliceName != null && x.HotspotSpliceName.Contains(dto.Hotspot)) //热点分类
|
|
|
.Where(x => SqlFunc.Subqueryable<OrderSendBackAudit>().Where(os => os.OrderId == x.Id && os.ApplyOrgId != OrgSeedData.CenterId && (os.SendBackStepName == "班长审批" || os.SendBackStepName == "派单组")).Any())
|
|
|
.Select(x => new OrderDto() { Id = x.Id.SelectAll() });
|
|
|
return query;
|
|
@@ -6163,6 +6175,12 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
{
|
|
|
var query = _orderRepository.Queryable()
|
|
|
.LeftJoin<OrderSendBackAudit>((x, os) => x.Id == os.OrderId && os.ApplyOrgId != OrgSeedData.CenterId && (os.SendBackStepName == "班长审批" || os.SendBackStepName == "派单组"))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), (x, os) => x.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), (x, os) => x.Title.Contains(dto.Title!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), (x, os) => x.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Channel), (x, os) => x.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Hotspot),
|
|
|
+ (x, os) => x.HotspotSpliceName != null && x.HotspotSpliceName.Contains(dto.Hotspot)) //热点分类
|
|
|
.Where((x, os) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
.Select((x, os) => new OrderDto() { Id = x.Id.SelectAll(), SendBackOpinion = os.Content, SendBackAuditTime = os.AuditTime });
|
|
|
return query;
|
|
@@ -6170,19 +6188,37 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
else if (dto.StatisticsType == "centreFileNum")
|
|
|
{
|
|
|
var query = _orderRepository.Queryable().Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
- .Where(x => x.Status >= EOrderStatus.Filed && x.FileOrgIsCenter == true).Select(x => new OrderDto() { Id = x.Id.SelectAll() });
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Title.Contains(dto.Title!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), x => x.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Hotspot),
|
|
|
+ x => x.HotspotSpliceName != null && x.HotspotSpliceName.Contains(dto.Hotspot)) //热点分类
|
|
|
+ .Where(x => x.Status >= EOrderStatus.Filed && x.FileOrgIsCenter == true).Select(x => new OrderDto() { Id = x.Id.SelectAll() });
|
|
|
return query;
|
|
|
}
|
|
|
else if (dto.StatisticsType == "centreFileBackNum")
|
|
|
{
|
|
|
var query = _orderRepository.Queryable().Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
- .Where(x => SqlFunc.Subqueryable<OrderSpecial>().Where(os => os.OrderId == x.Id && os.SpecialType == ESpecialType.SendBack && os.NextStepCode == "start").Any())
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Title.Contains(dto.Title!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), x => x.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Hotspot),
|
|
|
+ x => x.HotspotSpliceName != null && x.HotspotSpliceName.Contains(dto.Hotspot)) //热点分类
|
|
|
+ .Where(x => SqlFunc.Subqueryable<OrderSpecial>().Where(os => os.OrderId == x.Id && os.SpecialType == ESpecialType.SendBack && os.NextStepCode == "start").Any())
|
|
|
.Select(x => new OrderDto() { Id = x.Id.SelectAll() });
|
|
|
return query;
|
|
|
}
|
|
|
else if (dto.StatisticsType == "centreFileBackNumber")
|
|
|
{
|
|
|
var query = _orderRepository.Queryable().LeftJoin<OrderSpecial>((x, os) => x.Id == os.OrderId && os.SpecialType == ESpecialType.SendBack && os.NextStepCode == "start")
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), (x, os) => x.No.Contains(dto.No!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), (x, os) => x.Title.Contains(dto.Title!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), (x, os) => x.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Channel), (x, os) => x.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Hotspot),
|
|
|
+ (x, os) => x.HotspotSpliceName != null && x.HotspotSpliceName.Contains(dto.Hotspot)) //热点分类
|
|
|
.Where((x, os) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
.Select((x, os) => new OrderDto() { Id = x.Id.SelectAll() , SendBackOpinion = os.Reason , SendBackAuditTime = os.CreationTime });
|
|
|
return query;
|