|
@@ -44,6 +44,9 @@ using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Authentications;
|
|
|
using MediatR;
|
|
|
using Hotline.Share.Mq;
|
|
|
+using JiebaNet.Segmenter;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
+using WordInfo = PanGu.WordInfo;
|
|
|
|
|
|
namespace Hotline.Application.Orders;
|
|
|
|
|
@@ -131,8 +134,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
order.TimeLimitUnit = expiredTimeConfig.TimeType;
|
|
|
order.ExpiredTime = expiredTimeConfig.ExpiredTime;
|
|
|
order.NearlyExpiredTime = expiredTimeConfig.NearlyExpiredTime;
|
|
|
- //发送即将超期(延时发送)
|
|
|
- _capPublisher.PublishDelay(expiredTimeConfig.NearlyExpiredTime - DateTime.Now, EventNames.HotlineOrderNearlyExpiredTimeSms,new PublishNearlyExpiredTimeSmsDto() { OrderId= order.Id }) ;
|
|
|
+ //TODO发送短信即将超期
|
|
|
+ //_capPublisher.PublishDelay(expiredTimeConfig.NearlyExpiredTime - DateTime.Now, EventNames.HotlineOrderNearlyExpiredTimeSms, new PublishNearlyExpiredTimeSmsDto() { OrderId = order.Id });
|
|
|
if (IsProDelay)
|
|
|
{
|
|
|
order.ExpiredTimeProvince = expiredTimeConfig.ExpiredTime;
|
|
@@ -334,6 +337,12 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
if (vector != null && vector.Any()) await _repositoryts.UpdateVectorAsync(orderId, words, cancellationToken);
|
|
|
else await _repositoryts.AddVectorAsync(orderId, time, words, cancellationToken);
|
|
|
}
|
|
|
+ // 结巴分词
|
|
|
+ //var segmenter = new JiebaSegmenter();
|
|
|
+ //var segments1 = segmenter.Cut(inputStr, cutAll: true);
|
|
|
+ //var b = segments1;
|
|
|
+
|
|
|
+
|
|
|
//var words = await _orderWrodRepository.Queryable().Where(x => x.IsEnable == 1 && x.Classify.Contains("普通标签")).Select(x => x.Tag).ToListAsync(cancellationToken);
|
|
|
//var res = new List<string>();
|
|
|
//if (words.Any()) res = ParticipleTool.SegMMDouble(inputStr, ref words);
|
|
@@ -500,7 +509,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.ProvinceNo), d => d.ProvinceNo == dto.ProvinceNo) //省本地编号
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No == dto.No) //工单编码
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType)//受理类型
|
|
|
- //.WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptTypeCode)) //受理类型
|
|
|
+ //.WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptTypeCode)) //受理类型
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel)
|
|
|
//.WhereIF(dto.Channels.Any(), d => dto.Channels.Contains(d.SourceChannelCode)) //来源渠道
|
|
|
//.WhereIF(dto.HotspotIds.Any(), d => dto.HotspotIds.Contains(d.HotspotId)) //热点类型
|
|
@@ -820,8 +829,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.Where(x => x.OrderVisit.VisitTime >= dto.StartTime.Value && x.OrderVisit.VisitTime <= dto.EndTime.Value && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
|
|
|
.WhereIF(string.IsNullOrEmpty(dto.OrgName) == false, x => x.VisitOrgName.Contains(dto.OrgName))
|
|
|
.WhereIF(string.IsNullOrEmpty(dto.LineNum) == false, x => x.OrderVisit.Order.CallRecord.Gateway.Contains(dto.LineNum))
|
|
|
- .WhereIF(dto.TypeId != null && dto.TypeId == 1, x => x.OrderVisit.Order.IdentityType == EIdentityType.Citizen)
|
|
|
- .WhereIF(dto.TypeId != null && dto.TypeId == 2, x => x.OrderVisit.Order.IdentityType == EIdentityType.Enterprise)
|
|
|
+ .WhereIF(dto.TypeCode != null && dto.TypeCode == 1, x => x.OrderVisit.Order.IdentityType == EIdentityType.Citizen)
|
|
|
+ .WhereIF(dto.TypeCode != null && dto.TypeCode == 2, x => x.OrderVisit.Order.IdentityType == EIdentityType.Enterprise)
|
|
|
.WhereIF(IsCenter == false, x => x.VisitOrgCode.StartsWith(_sessionContext.OrgId));
|
|
|
|
|
|
var data = new List<VisitAndOrgSatisfactionStatisticsDto>();
|
|
@@ -917,8 +926,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.WhereIF(dto.OrgCode == "001", (x, it) => it.VisitOrgCode == dto.OrgCode)
|
|
|
.WhereIF(dto.OrgCode != "001", (x, it) => it.VisitOrgCode.StartsWith(dto.OrgCode))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.LineNum), (x, it) => it.OrderVisit.Order.CallRecord.Gateway.Contains(dto.LineNum))
|
|
|
- .WhereIF(dto.TypeId != null && dto.TypeId == 1, (x, it) => it.OrderVisit.Order.IdentityType == EIdentityType.Citizen)
|
|
|
- .WhereIF(dto.TypeId != null && dto.TypeId == 2, (x, it) => it.OrderVisit.Order.IdentityType == EIdentityType.Enterprise)
|
|
|
+ .WhereIF(dto.TypeCode != null && dto.TypeCode == 1, (x, it) => it.OrderVisit.Order.IdentityType == EIdentityType.Citizen)
|
|
|
+ .WhereIF(dto.TypeCode != null && dto.TypeCode == 2, (x, it) => it.OrderVisit.Order.IdentityType == EIdentityType.Enterprise)
|
|
|
.WhereIF(IsCenter == false, (x, it) => it.VisitOrgCode.StartsWith(_sessionContext.OrgId))
|
|
|
.GroupBy((x, it) => new
|
|
|
{
|
|
@@ -969,8 +978,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.Includes(x => x.OrderVisit, o => o.Order, d => d.CallRecord)
|
|
|
.Where(x => x.OrderVisit.VisitTime >= dto.StartTime && x.OrderVisit.VisitTime <= dto.EndTime && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited)
|
|
|
.WhereIF(dto.OrgCode == "001", x => x.VisitOrgCode == dto.OrgCode)
|
|
|
- .WhereIF(dto.TypeId != null && dto.TypeId == 1, x=> x.OrderVisit.Order.IdentityType == EIdentityType.Citizen)
|
|
|
- .WhereIF(dto.TypeId != null && dto.TypeId == 2, x => x.OrderVisit.Order.IdentityType == EIdentityType.Enterprise)
|
|
|
+ .WhereIF(dto.TypeCode != null && dto.TypeCode == 1, x => x.OrderVisit.Order.IdentityType == EIdentityType.Citizen)
|
|
|
+ .WhereIF(dto.TypeCode != null && dto.TypeCode == 2, x => x.OrderVisit.Order.IdentityType == EIdentityType.Enterprise)
|
|
|
//.WhereIF(dto.OrgCode != "001", x => x.VisitOrgCode == dto.OrgCode).
|
|
|
.WhereIF(dto.IsOnlyMy == true, x => x.VisitOrgCode == dto.OrgCode)
|
|
|
.WhereIF(IsCenter == true && dto.IsOnlyMy == true, x => x.VisitOrgCode == dto.OrgCode)
|
|
@@ -1288,8 +1297,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.Where(x => x.OrderVisit.VisitTime >= dto.StartTime.Value && x.OrderVisit.VisitTime <= dto.EndTime.Value && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
|
|
|
.WhereIF(string.IsNullOrEmpty(dto.HotspotName) == false, (x, h) => h.HotSpotName == dto.HotspotName)
|
|
|
.WhereIF(IsCenter == false, x => x.VisitOrgCode.StartsWith(_sessionContext.OrgId))
|
|
|
- .WhereIF(dto.TypeId == 1 ,x=>x.OrgProcessingResults != null)
|
|
|
- .WhereIF(dto.TypeId == 2, x => x.OrgHandledAttitude != null);
|
|
|
+ .WhereIF(dto.TypeId == 1, x => x.OrgProcessingResults != null)
|
|
|
+ .WhereIF(dto.TypeId == 2, x => x.OrgHandledAttitude != null);
|
|
|
|
|
|
var data = new List<VisitAndHotspotSatisfactionStatisticsDto>();
|
|
|
|
|
@@ -1385,6 +1394,66 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.WhereIF(dto.TypeId is 1, x => SqlFunc.JsonField(x.OrgProcessingResults, "Key") == key)
|
|
|
.WhereIF(dto.TypeId is 2, x => SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == key);
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 话务员办件统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public ISugarQueryable<OrderBiCentreDataListVo> CentreDataList(ReportPagedRequest dto)
|
|
|
+ {
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue) throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
+
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
+
|
|
|
+ var query = _orderRepository.Queryable(false, false, false)
|
|
|
+ .WhereIF(dto.StartTime.HasValue, it => it.CreationTime >= dto.StartTime)
|
|
|
+ .WhereIF(dto.EndTime.HasValue, it => it.CreationTime <= dto.EndTime)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword), it => it.SignerName.Contains(dto.Keyword!))
|
|
|
+ .GroupBy(it => new { it.SignerId, it.SignerName })
|
|
|
+ .Select(it => new OrderBiCentreDataListVo
|
|
|
+ {
|
|
|
+ UserName = it.SignerName,
|
|
|
+ UserId = it.SignerId,
|
|
|
+ //Subtotal = SqlFunc.AggregateCount(x.AcceptorId),
|
|
|
+ CentreArchive = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban && it.AcceptType != "无效", 1, 0)), //中心归档件
|
|
|
+ //CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && (it.FileUserRole == EFileUserType.Org || it.FileUserRole == EFileUserType.Dispatch), 1, 0)), //转办信件
|
|
|
+ CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType != "无效" && (it.ProcessType == EProcessType.Jiaoban || (it.ActualHandleStepName == "派单组" && it.Status < EOrderStatus.Filed) || (it.ActualHandleStepName == "班长审批" && it.Status < EOrderStatus.Filed)), 1, 0)),
|
|
|
+ NoCentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType != "无效" && (it.Status <= EOrderStatus.SpecialToUnAccept), 1, 0)), //坐席待办 //中心领导?市领导? 是否在统计条件中
|
|
|
+ //CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Jiaoban, 1, 0)),
|
|
|
+ //NoCentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF((int)x.Status < 300 && x.ExpiredTime > x.FiledTime, 1, 0)),
|
|
|
+ Invalid = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType == "无效", 1, 0)),
|
|
|
+ Repeat = SqlFunc.AggregateSum(SqlFunc.IIF(it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0, 1, 0)),
|
|
|
+ Subtotal = SqlFunc.AggregateSum(SqlFunc.IIF((it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban && it.AcceptType != "无效") || (it.AcceptType != "无效" && (it.ProcessType == EProcessType.Jiaoban || (it.ActualHandleStepName == "派单组" && it.Status < EOrderStatus.Filed) || (it.ActualHandleStepName == "班长审批" && it.Status < EOrderStatus.Filed))) || (it.Status <= EOrderStatus.SpecialToUnAccept) || it.AcceptType == "无效" || (it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0), 1, 0))
|
|
|
+ }).MergeTable();
|
|
|
+ switch (dto.SortField)
|
|
|
+ {
|
|
|
+ case "centreArchive":
|
|
|
+ query = dto.SortRule is 0 ? query.OrderBy(x => x.CentreArchive) : query.OrderByDescending(x => x.CentreArchive);
|
|
|
+ break;
|
|
|
+ case "centreCareOf":
|
|
|
+ query = dto.SortRule is 0 ? query.OrderBy(x => x.CentreCareOf) : query.OrderByDescending(x => x.CentreCareOf);
|
|
|
+ break;
|
|
|
+ case "noCentreCareOf":
|
|
|
+ query = dto.SortRule is 0 ? query.OrderBy(x => x.NoCentreCareOf) : query.OrderByDescending(x => x.NoCentreCareOf);
|
|
|
+ break;
|
|
|
+ case "invalid":
|
|
|
+ query = dto.SortRule is 0 ? query.OrderBy(x => x.Invalid) : query.OrderByDescending(x => x.Invalid);
|
|
|
+ break;
|
|
|
+ case "repeat":
|
|
|
+ query = dto.SortRule is 0 ? query.OrderBy(x => x.Repeat) : query.OrderByDescending(x => x.Repeat);
|
|
|
+ break;
|
|
|
+ case "subtotal":
|
|
|
+ query = dto.SortRule is 0 ? query.OrderBy(x => x.Subtotal) : query.OrderByDescending(x => x.Subtotal);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(dto.SortField))
|
|
|
+ {
|
|
|
+ query = query.OrderByDescending(x => x.Subtotal);
|
|
|
+ }
|
|
|
+ return query;
|
|
|
+ }
|
|
|
#region private
|
|
|
|
|
|
/// <summary>
|