|
@@ -65,6 +65,7 @@ using Hotline.Share.Tools;
|
|
|
using Hotline.EventBus;
|
|
|
using Hotline.Orders.Notifications;
|
|
|
using Hotline.OrderTranspond;
|
|
|
+using XF.Utility.EnumExtensions;
|
|
|
using Newtonsoft.Json;
|
|
|
using static NPOI.SS.Format.CellNumberFormatter;
|
|
|
|
|
@@ -436,7 +437,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
var seg = new Segment();
|
|
|
ICollection<WordInfo> splitWords = seg.DoSegment(inputStr);
|
|
|
var words = new List<string>();
|
|
|
- for (int i = 0; i < splitWords.Count; i++)
|
|
|
+ for (int i = 0;i < splitWords.Count;i++)
|
|
|
{
|
|
|
var word = splitWords.ElementAt(i);
|
|
|
if (word is { WordType: WordType.SimplifiedChinese, Word.Length: > 1 })
|
|
@@ -663,7 +664,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
visit.VisitTime = dto.VisitTime;
|
|
|
visit.VisitType = dto.VisitType;
|
|
|
|
|
|
- for (int i = 0; i < visit.OrderVisitDetails.Count; i++)
|
|
|
+ for (int i = 0;i < visit.OrderVisitDetails.Count;i++)
|
|
|
{
|
|
|
var detail = visit.OrderVisitDetails[i];
|
|
|
var detaildto = dto.OrderVisitDetailDto.FirstOrDefault(x => x.Id == detail.Id);
|
|
@@ -861,7 +862,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
visit.JudgeState = EJudgeState.Judging;
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < visit.OrderVisitDetails.Count; i++)
|
|
|
+ for (int i = 0;i < visit.OrderVisitDetails.Count;i++)
|
|
|
{
|
|
|
var detail = visit.OrderVisitDetails[i];
|
|
|
var detaildto = dto.VisitDetails.FirstOrDefault(x => x.Id == detail.Id);
|
|
@@ -1347,9 +1348,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
if (IsCenter && list != null)
|
|
|
{
|
|
|
data = await list.GroupBy(x => new
|
|
|
- {
|
|
|
- VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
|
|
|
- })
|
|
|
+ {
|
|
|
+ VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
|
|
|
+ })
|
|
|
.Select(x => new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
|
OrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
|
|
@@ -1398,9 +1399,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
else
|
|
|
{
|
|
|
data = await list.GroupBy(x => new
|
|
|
- {
|
|
|
- x.VisitOrgCode
|
|
|
- })
|
|
|
+ {
|
|
|
+ x.VisitOrgCode
|
|
|
+ })
|
|
|
.Select(x => new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
|
OrgCode = x.VisitOrgCode,
|
|
@@ -1664,10 +1665,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
dt.Columns.Remove("Column1");
|
|
|
|
|
|
//计算小计
|
|
|
- for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ for (int i = 0;i < dt.Rows.Count;i++)
|
|
|
{
|
|
|
int sumcount = 0;
|
|
|
- for (int j = 1; j < dt.Columns.Count - 1; j++)
|
|
|
+ for (int j = 1;j < dt.Columns.Count - 1;j++)
|
|
|
{
|
|
|
sumcount += Convert.ToInt32(dt.Rows[i][j].ToString());
|
|
|
}
|
|
@@ -1679,10 +1680,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
DataRow totalRow = dt.NewRow();
|
|
|
if (dt.Columns[0].ColumnName == "HotspotName") totalRow["HotspotName"] = "合计";
|
|
|
else totalRow["一级热点"] = "合计";
|
|
|
- for (int i = 1; i < dt.Columns.Count; i++)
|
|
|
+ for (int i = 1;i < dt.Columns.Count;i++)
|
|
|
{
|
|
|
int sumcount = 0;
|
|
|
- for (int j = 0; j < dt.Rows.Count; j++)
|
|
|
+ for (int j = 0;j < dt.Rows.Count;j++)
|
|
|
{
|
|
|
sumcount += Convert.ToInt32(dt.Rows[j][i].ToString());
|
|
|
}
|
|
@@ -1836,10 +1837,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
if (IsCenter && list != null)
|
|
|
{
|
|
|
data = await list.GroupBy((x, h) => new
|
|
|
- {
|
|
|
- HotspotName = h.HotSpotName,
|
|
|
- HotspotId = h.Id
|
|
|
- })
|
|
|
+ {
|
|
|
+ HotspotName = h.HotSpotName,
|
|
|
+ HotspotId = h.Id
|
|
|
+ })
|
|
|
.Select((x, h) => new VisitAndHotspotSatisfactionStatisticsDto()
|
|
|
{
|
|
|
HotspotName = h.HotSpotName,
|
|
@@ -1874,10 +1875,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
else
|
|
|
{
|
|
|
data = await list.GroupBy((x, h) => new
|
|
|
- {
|
|
|
- HotspotName = h.HotSpotName,
|
|
|
- HotspotId = h.Id
|
|
|
- })
|
|
|
+ {
|
|
|
+ HotspotName = h.HotSpotName,
|
|
|
+ HotspotId = h.Id
|
|
|
+ })
|
|
|
.Select((x, h) => new VisitAndHotspotSatisfactionStatisticsDto()
|
|
|
{
|
|
|
HotspotName = h.HotSpotName,
|
|
@@ -2492,20 +2493,20 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
}).ToListAsync();
|
|
|
|
|
|
var res = (from t1 in items
|
|
|
- join t2 in items2 on t1.UserId equals t2.UserId into t1_t2
|
|
|
- from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new SendOrderReportOutDto
|
|
|
- {
|
|
|
- UserId = t1.UserId,
|
|
|
- UserName = t1.UserName,
|
|
|
- SendOrderNum = t1.SendOrderNum,
|
|
|
- NoSendOrderNum = t1.NoSendOrderNum,
|
|
|
- ReSendOrderNum = t1_t2.Select(x => x.ReSendOrderNum).FirstOrDefault(),
|
|
|
- ChainRate = t1_t2.Select(x => x.ReSendOrderNum).FirstOrDefault() > 0
|
|
|
- ? ((double.Parse(t1.SendOrderNum.ToString()) - double.Parse(t1_t2.Select(x => x.ReSendOrderNum).FirstOrDefault().ToString())) /
|
|
|
- double.Parse(t1.SendOrderNum.ToString()) * 100).ToString("F2") + "%"
|
|
|
- : "100.00%",
|
|
|
- }).ToList();
|
|
|
+ join t2 in items2 on t1.UserId equals t2.UserId into t1_t2
|
|
|
+ from item in t1_t2.DefaultIfEmpty()
|
|
|
+ select new SendOrderReportOutDto
|
|
|
+ {
|
|
|
+ UserId = t1.UserId,
|
|
|
+ UserName = t1.UserName,
|
|
|
+ SendOrderNum = t1.SendOrderNum,
|
|
|
+ NoSendOrderNum = t1.NoSendOrderNum,
|
|
|
+ ReSendOrderNum = t1_t2.Select(x => x.ReSendOrderNum).FirstOrDefault(),
|
|
|
+ ChainRate = t1_t2.Select(x => x.ReSendOrderNum).FirstOrDefault() > 0
|
|
|
+ ? ((double.Parse(t1.SendOrderNum.ToString()) - double.Parse(t1_t2.Select(x => x.ReSendOrderNum).FirstOrDefault().ToString())) /
|
|
|
+ double.Parse(t1.SendOrderNum.ToString()) * 100).ToString("F2") + "%"
|
|
|
+ : "100.00%",
|
|
|
+ }).ToList();
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -2598,7 +2599,62 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.WhereIF(dto.StartTime.HasValue && dto.EndTime.HasValue, d => d.Order.StartTime >= dto.StartTime && d.Order.StartTime <= dto.EndTime)
|
|
|
.OrderByDescending(d => d.CreationTime);
|
|
|
|
|
|
- }
|
|
|
- #endregion
|
|
|
+ public ISugarQueryable<OrderListOutDto> QueryWaitedForSeat(QueryOrderWaitedDto dto)
|
|
|
+ {
|
|
|
+ EOrderStatus[] handleStatuses = EnumExts.GetFields<EOrderStatus>().Select(d => (EOrderStatus)d.Key).ToArray();
|
|
|
+ handleStatuses = handleStatuses.WhereIF(dto.IsHandled.HasValue,
|
|
|
+ d => dto.IsHandled!.Value
|
|
|
+ ? d is not EOrderStatus.WaitForAccept and not EOrderStatus.BackToUnAccept and not EOrderStatus.SpecialToUnAccept and not EOrderStatus.HandOverToUnAccept
|
|
|
+ : d is EOrderStatus.WaitForAccept or EOrderStatus.BackToUnAccept or EOrderStatus.SpecialToUnAccept or EOrderStatus.HandOverToUnAccept)
|
|
|
+ .ToArray();
|
|
|
+
|
|
|
+ var query = _orderRepository.Queryable();
|
|
|
+ if (dto.IsHandled.HasValue)
|
|
|
+ {
|
|
|
+ var hasHandled = dto.IsHandled.Value;
|
|
|
+ query = query.Where(d => SqlFunc.Subqueryable<WorkflowTrace>()
|
|
|
+ .Where(step => step.ExternalId == d.Id &&
|
|
|
+ (hasHandled || step.Status != EWorkflowStepStatus.Handled) &&
|
|
|
+ (!hasHandled || step.Status == EWorkflowStepStatus.Handled &&
|
|
|
+ step.TraceState != EWorkflowTraceState.StepRemoveByPrevious) &&
|
|
|
+ ((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) &&
|
|
|
+ step.HandlerId == _sessionContext.RequiredUserId) ||
|
|
|
+ (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) &&
|
|
|
+ step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
|
|
|
+ (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) &&
|
|
|
+ _sessionContext.Roles.Contains(step.RoleId)))).Any() ||
|
|
|
+ (string.IsNullOrEmpty(d.WorkflowId) &&
|
|
|
+ (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId))
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
+ return query
|
|
|
+ // 交办件:已派单其他节点的工单,该选项卡下工单若办结就不显示
|
|
|
+ .WhereIF(dto.TypeCode.HasValue && dto.TypeCode == 1, d => d.ProcessType == EProcessType.Jiaoban && d.Status < EOrderStatus.Filed)
|
|
|
+ // 办结件:当前登录坐席作为最初受理人已办结的工单
|
|
|
+ .WhereIF(dto.TypeCode.HasValue && dto.TypeCode == 2, d=> d.Status >= EOrderStatus.Filed && d.AcceptorId == _sessionContext.RequiredUserId)
|
|
|
+ .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
|
|
|
+ .WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.StartsWith(dto.Keyword!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No == dto.No)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AreaCode), d => d.AreaCode == dto.AreaCode)
|
|
|
+ .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == true, d => d.CounterSignType.HasValue)
|
|
|
+ .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == false, d => d.CounterSignType == null)
|
|
|
+ .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == true,
|
|
|
+ d => (d.ExpiredTime < DateTime.Now && d.Status < EOrderStatus.Filed) ||
|
|
|
+ (d.ExpiredTime < d.ActualHandleTime && d.Status >= EOrderStatus.Filed)) //超期 未办
|
|
|
+ .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == false,
|
|
|
+ d => d.NearlyExpiredTime < DateTime.Now && d.ExpiredTime > DateTime.Now) //即将超期 未办
|
|
|
+ .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
+ .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
+ //.Where(d => (string.IsNullOrEmpty(d.WorkflowId) && (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)))
|
|
|
+ //.Where(d => string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)
|
|
|
+ .WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
|
|
|
+ .Where(x => x.Source < ESource.MLSQ || x.Source > ESource.WZSC)
|
|
|
+ .Where(x => x.Status != EOrderStatus.BackToProvince && x.Status < EOrderStatus.Filed)
|
|
|
+ .OrderBy(d => d.Status)
|
|
|
+ .OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
|
|
|
+ .OrderByIF(dto.IsHandled == false, d => new { IsUrgent = d.IsUrgent, CreationTime = d.CreationTime }, OrderByType.Desc)
|
|
|
+ .Select<OrderListOutDto>();
|
|
|
+ }
|
|
|
}
|