|
@@ -20,6 +20,7 @@ using Hotline.Share.Enums.Settings;
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Tools;
|
|
using Hotline.Tools;
|
|
using MapsterMapper;
|
|
using MapsterMapper;
|
|
|
|
+using Novacode;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Constants;
|
|
using XF.Domain.Constants;
|
|
@@ -466,7 +467,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
.WhereIF(dto.Level == 2, (x, ws) => ws.AcceptorOrgId.StartsWith(_sessionContext.OrgId))
|
|
.WhereIF(dto.Level == 2, (x, ws) => ws.AcceptorOrgId.StartsWith(_sessionContext.OrgId))
|
|
.WhereIF(dto.Signed == 0 ,(x,ws)=>ws.Status == Share.Enums.FlowEngine.EWorkflowStepStatus.WaitForAccept)
|
|
.WhereIF(dto.Signed == 0 ,(x,ws)=>ws.Status == Share.Enums.FlowEngine.EWorkflowStepStatus.WaitForAccept)
|
|
.WhereIF(dto.Signed == 1, (x, ws) => ws.Status == Share.Enums.FlowEngine.EWorkflowStepStatus.WaitForHandle)
|
|
.WhereIF(dto.Signed == 1, (x, ws) => ws.Status == Share.Enums.FlowEngine.EWorkflowStepStatus.WaitForHandle)
|
|
- .Where((x,ws)=>ws.CountersignPosition == Share.Enums.FlowEngine.ECountersignPosition.None)
|
|
|
|
|
|
+ .Where((x,ws)=>ws.CountersignPosition == Share.Enums.FlowEngine.ECountersignPosition.None && x.Status > EOrderStatus.WaitForAccept)
|
|
.OrderByDescending((x,ws) => ws.CreationTime);
|
|
.OrderByDescending((x,ws) => ws.CreationTime);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -486,6 +487,75 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
.Where(d=> d.SourceChannel != null && d.SourceChannel !="");
|
|
.Where(d=> d.SourceChannel != null && d.SourceChannel !="");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 信件来源统计列表
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task<List<OrderSourceTimeVo>> QueryOrderSourceList(QueryOrderSourceRequest dto)
|
|
|
|
+ {
|
|
|
|
+ if (dto.EndTime.HasValue)
|
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
|
+ var Time = await _orderRepository.Queryable()
|
|
|
|
+ .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
|
+ .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
|
+ .WhereIF(dto.IdentityType.HasValue, d => d.IdentityType == dto.IdentityType)
|
|
|
|
+ .Where(d => d.SourceChannel != null && d.SourceChannel != "")
|
|
|
|
+ .GroupBy(d=> d.CreationTime.ToString("yyyy-MM-dd"))
|
|
|
|
+ .Select(d => new OrderSourceTimeVo { Time = d.CreationTime.ToString("yyyy-MM-dd") }).ToListAsync();
|
|
|
|
+ var data = await _orderRepository.Queryable()
|
|
|
|
+ .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
|
+ .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
|
+ .WhereIF(dto.IdentityType.HasValue, d => d.IdentityType == dto.IdentityType)
|
|
|
|
+ .Where(d => d.SourceChannel != null && d.SourceChannel != "")
|
|
|
|
+ .GroupBy(d => new { Time = d.CreationTime.ToString("yyyy-MM-dd"), d.SourceChannel })
|
|
|
|
+ .Select(d => new OrderSourceTimeListVo
|
|
|
|
+ {
|
|
|
|
+ Time = d.CreationTime.ToString("yyyy-MM-dd"),
|
|
|
|
+ Source = d.SourceChannel,
|
|
|
|
+ Num = SqlFunc.AggregateCount(d.Id)
|
|
|
|
+ }).ToListAsync() ;
|
|
|
|
+ foreach (var item in Time)
|
|
|
|
+ {
|
|
|
|
+ List<OrderSourceTimeListVo> list = data.Where(x=>x.Time == item.Time).ToList();
|
|
|
|
+ item.Lists.AddRange(list);
|
|
|
|
+ }
|
|
|
|
+ return Time;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 信件来源统计列表表头
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task<List<OrderSourceHeaderVo>> QueryOrderSourceHeaderList(QueryOrderSourceRequest dto)
|
|
|
|
+ {
|
|
|
|
+ if (dto.EndTime.HasValue)
|
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
|
+ var list = await _orderRepository.Queryable()
|
|
|
|
+ .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
|
+ .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
|
+ .WhereIF(dto.IdentityType.HasValue, d => d.IdentityType == dto.IdentityType)
|
|
|
|
+ .Where(d => d.SourceChannel != null && d.SourceChannel != "")
|
|
|
|
+ .GroupBy(d => d.SourceChannel)
|
|
|
|
+ .Select(d => new OrderSourceHeaderVo { Header = d.SourceChannel,Code = d.SourceChannel }).ToListAsync();
|
|
|
|
+ if (list.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ list.Insert(0, new OrderSourceHeaderVo { Header = "小计",Code = "Subtotal" });
|
|
|
|
+ list.Insert(0, new OrderSourceHeaderVo { Header = "日期",Code = "Time" });
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ISugarQueryable<Order> QueryOrderSourceDetail(QueryOrderSourceDetailRequest dto) {
|
|
|
|
+
|
|
|
|
+ return _orderRepository.Queryable()
|
|
|
|
+ .WhereIF(string.IsNullOrEmpty(dto.SourceChannel),d=>d.SourceChannel == dto.SourceChannel)
|
|
|
|
+ .WhereIF(dto.Time.HasValue,d=>d.CreationTime.ToString("yyyy-MM-dd") == dto.Time.Value.ToString("yyyy-MM-dd"))
|
|
|
|
+ .WhereIF(dto.IdentityType.HasValue, d => d.IdentityType == dto.IdentityType)
|
|
|
|
+ .Where(d => d.SourceChannel != null && d.SourceChannel != "");
|
|
|
|
+ }
|
|
|
|
+
|
|
#region private
|
|
#region private
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|