Переглянути джерело

市州通用-【通话时段分析-通话时段明细表】增加导出等功能

田爽 2 місяців тому
батько
коміт
88c42a07f8

+ 2 - 14
src/Hotline.Api/Controllers/Bi/BiCallController.cs

@@ -479,20 +479,8 @@ public class BiCallController : BaseController
     [HttpGet("hourcall_list")]
     public async Task<PagedDto<BiSeatSwitchDto>> QueryCallList([FromQuery] QueryCallListDto dto)
     {
-        var(total, items) =  await _callReportApplication.GetCallListAsync(dto, HttpContext.RequestAborted).ToPagedListAsync(dto);
-        return new PagedDto<BiSeatSwitchDto>(total, items);
-    }
-        
-
-    /// <summary>
-    /// 通话时段统计明细导出
-    /// </summary>
-    /// <param name="dto"></param>
-    /// <returns></returns>
-    [HttpGet("hourcall_list/export")]
-    public async Task<FileStreamResult> GetCallListExport([FromBody]ExportExcelDto<QueryCallListDto> dto)
-    {
-        return null;
+        var res =  await _callReportApplication.GetCallListAsync(dto, HttpContext.RequestAborted);
+        return new PagedDto<BiSeatSwitchDto>(res.Total, res.Data);
     }
 
     /// <summary>

+ 8 - 8
src/Hotline.Application/StatisticalReport/CallReport/CallReportApplicationBase.cs

@@ -59,15 +59,15 @@ public abstract class CallReportApplicationBase : ICallReportApplication
         return await _callNativeRepository.GetCallHourList(dto.StartTime, dto.EndTime, noConnectByeTimes, effectiveTimes, connectByeTimes, dto.Source);
     }
 
-    public virtual ISugarQueryable<BiSeatSwitchDto> GetCallListAsync(QueryCallListDto dto, CancellationToken requestAborted)
-    {
-        int noConnectByeTimes = _systemSettingCacheManager.NoConnectByeTimes;
-        int effectiveTimes = _systemSettingCacheManager.EffectiveTimes;
-        int connectByeTimes = _systemSettingCacheManager.ConnectByeTimes;
-        return _callNativeRepository.GetCallList(dto, noConnectByeTimes, effectiveTimes, connectByeTimes);
-    }
+	public virtual async Task<TotalData<BiSeatSwitchDto>> GetCallListAsync(QueryCallListDto dto, CancellationToken requestAborted)
+	{
+		int noConnectByeTimes = _systemSettingCacheManager.NoConnectByeTimes;
+		int effectiveTimes = _systemSettingCacheManager.EffectiveTimes;
+		int connectByeTimes = _systemSettingCacheManager.ConnectByeTimes;
+		return await _callNativeRepository.GetCallList(dto, noConnectByeTimes, effectiveTimes, connectByeTimes);
+	}
 
-    public virtual async Task<List<QueryCallDateStatisticsDetailResp>> QueryCallDateStatisticsDetail(QueryCallDateStatisticsDetailDto dto)
+	public virtual async Task<List<QueryCallDateStatisticsDetailResp>> QueryCallDateStatisticsDetail(QueryCallDateStatisticsDetailDto dto)
     {
         throw new NotImplementedException();
     }

+ 1 - 1
src/Hotline.Application/StatisticalReport/CallReport/YiBinCallReportApplication.cs

@@ -242,7 +242,7 @@ public class YiBinCallReportApplication : CallReportApplicationBase, ICallReport
         return await _trCallRecordRepositoryEx.GetCallHotLineList(dto.StartTime, dto.EndTime, dto.Gateway, noConnectByeTimes, effectiveTimes, connectByeTimes, ringTims); ;
     }
 
-    public override ISugarQueryable<BiSeatSwitchDto> GetCallListAsync(QueryCallListDto dto, CancellationToken requestAborted)
+    public override Task<TotalData<BiSeatSwitchDto>> GetCallListAsync(QueryCallListDto dto, CancellationToken requestAborted)
     {
         //获取配置
         int noConnectByeTimes = _systemSettingCacheManager.NoConnectByeTimes;

+ 1 - 1
src/Hotline.Application/StatisticalReport/ICallReportApplication.cs

@@ -36,7 +36,7 @@ namespace Hotline.Application.StatisticalReport
         Task<List<QueryCallsDetailDto>> QueryCallsHourDetailAsync(BiQueryCallsDto dto, CancellationToken cancellationToken);
         Task<(int, List<BiSeatSwitchDto>)> QuerySeatSwitchAsync(QuerySeatSwitchRequest dto, CancellationToken cancellationToken);
         Task<List<TrCallHourDto>> GetCallHourListAsync(BiQueryHourCallDto dto, CancellationToken cancellationToken);
-        ISugarQueryable<BiSeatSwitchDto> GetCallListAsync(QueryCallListDto dto, CancellationToken cancellationToken);
+        Task<TotalData<BiSeatSwitchDto>> GetCallListAsync(QueryCallListDto dto, CancellationToken cancellationToken);
         Task<List<CallHotLineDto>> GetCallHotLineListAsync(BiQueryGateWayDto dto, CancellationToken cancellationToken);
         Task<List<QueryCallsDetailStatistics>> QueryCallsDetailStatisticsAsync(StartEndTimeDto dto, CancellationToken cancellationToken);
 

+ 3 - 2
src/Hotline.Repository.SqlSugar/CallCenter/CallNativeRepository.cs

@@ -189,14 +189,15 @@ public class CallNativeRepository : BaseRepository<CallNative>, ICallNativeRepos
     /// 通话时段统计明细
     /// </summary>
     /// <returns></returns>
-    public ISugarQueryable<BiSeatSwitchDto> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes)
+    public async Task<TotalData<BiSeatSwitchDto>> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes)
     {
         TimeSpan endHourTo = DateTime.Now.TimeOfDay;
         if (dto.StartHourTo.HasValue)
         {
             endHourTo = dto.StartHourTo.Value.Add(new TimeSpan(1, 0, 0));
         }
-        var res = Db.Queryable<CallNative>()
+		RefAsync<int> total = 0;
+		var res = await Db.Queryable<CallNative>()
             .Where(x => x.BeginIvrTime >= dto.StartTime && x.BeginIvrTime <= dto.EndTime)
             .Where(x => x.Direction == ECallDirection.In && x.CallState != ECallState.Invalid)
             .WhereIF(!string.IsNullOrEmpty(dto.Source), x => x.ToNo == dto.Source)

+ 8 - 8
src/Hotline.Repository.SqlSugar/CallCenter/TrCallRecordRepository.cs

@@ -178,19 +178,19 @@ namespace Hotline.Repository.SqlSugar.CallCenter
             return resultList;
         }
 
-        /// <summary>
-        /// 通话时段统计明细
-        /// </summary>
-        /// <returns></returns>
-        public ISugarQueryable<BiSeatSwitchDto> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes)
-        {
-            TimeSpan endHourTo = DateTime.Now.TimeOfDay;
+		/// <summary>
+		/// 通话时段统计明细
+		/// </summary>
+		/// <returns></returns>
+		public async Task<TotalData<BiSeatSwitchDto>> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes)
+		{
+			TimeSpan endHourTo = DateTime.Now.TimeOfDay;
             if (dto.StartHourTo.HasValue)
             {
                 endHourTo = dto.StartHourTo.Value.Add(new TimeSpan(1, 0, 0));
             }
             RefAsync<int> total = 0;
-            var res = Db.Queryable<TrCallRecord>()
+            var res = await Db.Queryable<TrCallRecord>()
                 .Where(x => x.CreatedTime >= dto.StartTime && x.CreatedTime <= dto.EndTime)
                 .Where(x => x.CallDirection == ECallDirection.In)
                 .WhereIF(!string.IsNullOrEmpty(dto.Source), x => x.CDPN == dto.Source)

+ 3 - 2
src/Hotline/CallCenter/Calls/ICallNativeRepository.cs

@@ -10,6 +10,7 @@ public interface ICallNativeRepository : IRepository<CallNative>
     Task<List<BiCallDto>> GetQueryCalls(DateTime beginDate, DateTime endDate, string? Line);
     Task<List<QueryCallsDetailDto>> QueryCallsHourDetail(DateTime beginDate, DateTime endDate, int noConnectByeTimes, int effectiveTimes, int connectByeTimes, int CallInOverConnRingTime, int SeatChaoTime, string? Line);
     Task<List<TrCallHourDto>?> GetCallHourList(DateTime beginDate, DateTime? endDate, int noConnectByeTimes, int effectiveTimes, int connectByeTimes, string source);
-    ISugarQueryable<BiSeatSwitchDto> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes,int connectByeTimes);
-    Task<List<CallHotLineDto>> GetCallHotLineListAsync(BiQueryGateWayDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes, int ringTimes, List<string> hotLines);
+    Task<TotalData<BiSeatSwitchDto>> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes);
+
+	Task<List<CallHotLineDto>> GetCallHotLineListAsync(BiQueryGateWayDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes, int ringTimes, List<string> hotLines);
 }

+ 7 - 7
src/Hotline/CallCenter/Calls/ITrCallRecordRepository.cs

@@ -26,14 +26,14 @@ namespace Hotline.CallCenter.Calls
 
 
         Task<List<CallHotLineDto>> GetCallHotLineList(DateTime beginDate, DateTime endDate, string lineNum, int noConnectByeTimes, int effectiveTimes, int connectByeTimes,int ringTims);
-        ISugarQueryable<BiSeatSwitchDto> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes,int connectByeTimes);
+        Task<TotalData<BiSeatSwitchDto>> GetCallList(QueryCallListDto dto, int noConnectByeTimes, int effectiveTimes, int connectByeTimes);
 
-        /// <summary>
-        /// 获取通话记录
-        /// </summary>
-        /// <param name="dto"></param>
-        /// <returns></returns>
-        ISugarQueryable<TrCallRecord> GetCallList(GetCallListDto dto);
+		/// <summary>
+		/// 获取通话记录
+		/// </summary>
+		/// <param name="dto"></param>
+		/// <returns></returns>
+		ISugarQueryable<TrCallRecord> GetCallList(GetCallListDto dto);
 
         /// <summary>
         /// 话务日期统计明细