|
@@ -1,8 +1,10 @@
|
|
using Hotline.Caching.Interfaces;
|
|
using Hotline.Caching.Interfaces;
|
|
using Hotline.CallCenter.Calls;
|
|
using Hotline.CallCenter.Calls;
|
|
|
|
+using Hotline.FlowEngine.WorkflowModules;
|
|
using Hotline.FlowEngine.Workflows;
|
|
using Hotline.FlowEngine.Workflows;
|
|
using Hotline.Orders;
|
|
using Hotline.Orders;
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
|
+using Hotline.Repository.SqlSugar.System;
|
|
using Hotline.Settings;
|
|
using Hotline.Settings;
|
|
using Hotline.Settings.Hotspots;
|
|
using Hotline.Settings.Hotspots;
|
|
using Hotline.Share.Dtos;
|
|
using Hotline.Share.Dtos;
|
|
@@ -46,6 +48,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
private readonly ISessionContext _sessionContext;
|
|
private readonly ISessionContext _sessionContext;
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
private readonly IRepository<OrderSpecialDetail> _orderSpecialDetailRepository;
|
|
private readonly IRepository<OrderSpecialDetail> _orderSpecialDetailRepository;
|
|
|
|
+ private readonly IRepository<WorkflowStepHandler> _workflowStepHandler;
|
|
|
|
|
|
public BiOrderController(
|
|
public BiOrderController(
|
|
IOrderRepository orderRepository,
|
|
IOrderRepository orderRepository,
|
|
@@ -63,7 +66,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
IRepository<AiOrderVisitDetail> aiOrderVisitDetailRepository,
|
|
IRepository<AiOrderVisitDetail> aiOrderVisitDetailRepository,
|
|
ISessionContext sessionContext,
|
|
ISessionContext sessionContext,
|
|
ISystemSettingCacheManager systemSettingCacheManager,
|
|
ISystemSettingCacheManager systemSettingCacheManager,
|
|
- IRepository<OrderSpecialDetail> orderSpecialDetailRepository
|
|
|
|
|
|
+ IRepository<OrderSpecialDetail> orderSpecialDetailRepository,
|
|
|
|
+ IRepository<WorkflowStepHandler> workflowStepHandler
|
|
)
|
|
)
|
|
{
|
|
{
|
|
_orderRepository = orderRepository;
|
|
_orderRepository = orderRepository;
|
|
@@ -82,21 +86,40 @@ namespace Hotline.Api.Controllers.Bi
|
|
_sessionContext = sessionContext;
|
|
_sessionContext = sessionContext;
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
_orderSpecialDetailRepository = orderSpecialDetailRepository;
|
|
_orderSpecialDetailRepository = orderSpecialDetailRepository;
|
|
|
|
+ _workflowStepHandler = workflowStepHandler;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//public async Task OrgDataListDetail([FromQuery] OrgDataListDetailRequest dto)
|
|
//public async Task OrgDataListDetail([FromQuery] OrgDataListDetailRequest dto)
|
|
//{
|
|
//{
|
|
- // dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
+ // dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
- // await _orderRepository.Queryable()
|
|
|
|
- // .Where(x => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
|
|
|
|
|
|
+ // var queryOrder = _orderRepository.Queryable()
|
|
|
|
+ // .Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
// .WhereIF(dto.QueryType == 1, x => x.Status >= EOrderStatus.Filed && x.ExpiredTime < x.FiledTime) //业务已办超期
|
|
// .WhereIF(dto.QueryType == 1, x => x.Status >= EOrderStatus.Filed && x.ExpiredTime < x.FiledTime) //业务已办超期
|
|
// //.WhereIF(dto.QueryType== 2,) //会签已办超期
|
|
// //.WhereIF(dto.QueryType== 2,) //会签已办超期
|
|
// .WhereIF(dto.QueryType == 3, x => x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate()) //业务待办超期
|
|
// .WhereIF(dto.QueryType == 3, x => x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate()) //业务待办超期
|
|
// //.WhereIF(dto.QueryType ==4,) //会签待办超期
|
|
// //.WhereIF(dto.QueryType ==4,) //会签待办超期
|
|
- // .ToPageListAsync(dto.PageIndex, dto.PageSize);
|
|
|
|
-
|
|
|
|
|
|
+ // .MergeTable();
|
|
|
|
+ // //.ToPageListAsync(dto.PageIndex, dto.PageSize);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // var queryCountersign = _workflowCountersignRepository.Queryable()
|
|
|
|
+ // .LeftJoin<WorkflowCountersignMember>((x, o) => x.Id == o.WorkflowCountersignId)
|
|
|
|
+ // .Where( x => x.CreationTime >= dto.StartTime)
|
|
|
|
+ // .Where( x => x.CreationTime <= dto.EndTime)
|
|
|
|
+ // .MergeTable();
|
|
|
|
+
|
|
|
|
+ // var query = queryOrder.LeftJoin(queryCountersign, (or, co) => or.Id == co.w)
|
|
|
|
+ // .Select((or, co) => new OrderBiOrgDataListVo
|
|
|
|
+ // {
|
|
|
|
+ // OrgName = or.OrgName,
|
|
|
|
+ // OrgId = or.OrgId,
|
|
|
|
+ // HandlerExtendedNum = or.HandlerExtendedNum,
|
|
|
|
+ // NoHandlerExtendedNum = or.NoHandlerExtendedNum,
|
|
|
|
+ // CounterHandlerExtendedNum = co.CounterHandlerExtendedNum,
|
|
|
|
+ // CounterNoHandlerExtendedNum = co.CounterNoHandlerExtendedNum
|
|
|
|
+ // }).MergeTable();
|
|
//}
|
|
//}
|
|
|
|
|
|
|
|
|
|
@@ -114,19 +137,37 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
|
- var queryOrder = _orderRepository.Queryable(false, false, false)
|
|
|
|
- .LeftJoin<SystemOrganize>((x, o) => x.ActualHandleOrgCode == o.Id)
|
|
|
|
- .WhereIF(dto.StartTime.HasValue, (x, o) => x.CreationTime >= dto.StartTime)
|
|
|
|
- .WhereIF(dto.EndTime.HasValue, (x, o) => x.CreationTime <= dto.EndTime)
|
|
|
|
- .WhereIF(IsCenter == false, (x, o) => x.ActualHandleOrgCode == _sessionContext.RequiredOrgId)
|
|
|
|
- .GroupBy((x, o) => new { x.ActualHandleOrgCode, o.Name })
|
|
|
|
|
|
+
|
|
|
|
+ var queryOrder = _systemOrganizeRepository.Queryable()
|
|
|
|
+ .LeftJoin<Order>((x,o)=> x.Id == o.ActualHandleOrgCode)
|
|
|
|
+ .WhereIF(dto.StartTime.HasValue, (x, o) => o.CreationTime >= dto.StartTime)
|
|
|
|
+ .WhereIF(dto.EndTime.HasValue, (x, o) => o.CreationTime <= dto.EndTime)
|
|
|
|
+ .WhereIF(IsCenter == false, (x, o) => o.ActualHandleOrgCode == _sessionContext.RequiredOrgId)
|
|
|
|
+ .GroupBy((x,o) => new { x.Id, x.Name })
|
|
.Select((x, o) => new OrderBiOrgDataListVo
|
|
.Select((x, o) => new OrderBiOrgDataListVo
|
|
{
|
|
{
|
|
- OrgName = o.Name,
|
|
|
|
- OrgId = x.ActualHandleOrgCode,
|
|
|
|
- HandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime < x.FiledTime, 1, 0)),
|
|
|
|
- NoHandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate(), 1, 0)),
|
|
|
|
|
|
+ OrgName = x.Name,
|
|
|
|
+ OrgId = x.Id,
|
|
|
|
+ HandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(o.Status >= EOrderStatus.Filed && o.ExpiredTime < o.FiledTime, 1, 0)),
|
|
|
|
+ NoHandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(o.Status < EOrderStatus.Filed && o.ExpiredTime < SqlFunc.GetDate(), 1, 0)),
|
|
}).MergeTable();
|
|
}).MergeTable();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //var queryOrder = _orderRepository.Queryable(false, false, false)
|
|
|
|
+ // .LeftJoin<SystemOrganize>((x, o) => x.ActualHandleOrgCode == o.Id)
|
|
|
|
+ // .WhereIF(dto.StartTime.HasValue, (x, o) => x.CreationTime >= dto.StartTime)
|
|
|
|
+ // .WhereIF(dto.EndTime.HasValue, (x, o) => x.CreationTime <= dto.EndTime)
|
|
|
|
+ // .WhereIF(IsCenter == false, (x, o) => x.ActualHandleOrgCode == _sessionContext.RequiredOrgId)
|
|
|
|
+ // .GroupBy((x, o) => new { x.ActualHandleOrgCode, o.Name })
|
|
|
|
+ // .Select((x, o) => new OrderBiOrgDataListVo
|
|
|
|
+ // {
|
|
|
|
+ // OrgName = o.Name,
|
|
|
|
+ // OrgId = x.ActualHandleOrgCode,
|
|
|
|
+ // HandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime < x.FiledTime, 1, 0)),
|
|
|
|
+ // NoHandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status < EOrderStatus.Filed && x.ExpiredTime < SqlFunc.GetDate(), 1, 0)),
|
|
|
|
+ // }).MergeTable();
|
|
|
|
+
|
|
var queryCountersign = _workflowCountersignRepository.Queryable()
|
|
var queryCountersign = _workflowCountersignRepository.Queryable()
|
|
.LeftJoin<WorkflowCountersignMember>((x, o) => x.Id == o.WorkflowCountersignId)
|
|
.LeftJoin<WorkflowCountersignMember>((x, o) => x.Id == o.WorkflowCountersignId)
|
|
.WhereIF(dto.StartTime.HasValue, x => x.CreationTime >= dto.StartTime)
|
|
.WhereIF(dto.StartTime.HasValue, x => x.CreationTime >= dto.StartTime)
|
|
@@ -765,13 +806,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
{
|
|
{
|
|
VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
|
|
VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
|
|
})
|
|
})
|
|
- .GroupByIF(IsCenter == false, x => new
|
|
|
|
- {
|
|
|
|
- VisitOrgCode = x.VisitOrgCode
|
|
|
|
- })
|
|
|
|
.Select(x => new VisitAndOrgSatisfactionStatisticsDto()
|
|
.Select(x => new VisitAndOrgSatisfactionStatisticsDto()
|
|
{
|
|
{
|
|
- OrgCode = SqlFunc.IIF(IsCenter, x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")), x.VisitOrgCode),
|
|
|
|
|
|
+ OrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
|
|
TotalSumCount = SqlFunc.AggregateCount(x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))),
|
|
TotalSumCount = SqlFunc.AggregateCount(x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))),
|
|
VerySatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "5", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "5", 1, 0))),//非常满意数
|
|
VerySatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "5", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "5", 1, 0))),//非常满意数
|
|
SatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "4", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "4", 1, 0))), //满意数
|
|
SatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "4", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "4", 1, 0))), //满意数
|