|
@@ -1,10 +1,14 @@
|
|
using Hotline.CallCenter.Calls;
|
|
using Hotline.CallCenter.Calls;
|
|
using Hotline.CallCenter.Tels;
|
|
using Hotline.CallCenter.Tels;
|
|
|
|
+using Hotline.Repository.SqlSugar.Extensions;
|
|
|
|
+using Hotline.Share.Dtos;
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
|
+using Hotline.Share.Dtos.Users;
|
|
using Hotline.Share.Enums.CallCenter;
|
|
using Hotline.Share.Enums.CallCenter;
|
|
using Hotline.Share.Enums.User;
|
|
using Hotline.Share.Enums.User;
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Users;
|
|
using Hotline.Users;
|
|
|
|
+using MapsterMapper;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
@@ -20,15 +24,18 @@ public class BiCallController : BaseController
|
|
private readonly IRepository<TrCallRecord> _trCallRecordRepository;
|
|
private readonly IRepository<TrCallRecord> _trCallRecordRepository;
|
|
private readonly IRepository<User> _userRepository;
|
|
private readonly IRepository<User> _userRepository;
|
|
private readonly IRepository<TelRest> _telRestRepository;
|
|
private readonly IRepository<TelRest> _telRestRepository;
|
|
|
|
+ private readonly IMapper _mapper;
|
|
|
|
|
|
public BiCallController(
|
|
public BiCallController(
|
|
IRepository<TrCallRecord> trCallRecordRepository,
|
|
IRepository<TrCallRecord> trCallRecordRepository,
|
|
IRepository<User> userRepository,
|
|
IRepository<User> userRepository,
|
|
- IRepository<TelRest> telRestRepository)
|
|
|
|
|
|
+ IRepository<TelRest> telRestRepository,
|
|
|
|
+ IMapper mapper)
|
|
{
|
|
{
|
|
_trCallRecordRepository = trCallRecordRepository;
|
|
_trCallRecordRepository = trCallRecordRepository;
|
|
_userRepository = userRepository;
|
|
_userRepository = userRepository;
|
|
_telRestRepository = telRestRepository;
|
|
_telRestRepository = telRestRepository;
|
|
|
|
+ _mapper = mapper;
|
|
}
|
|
}
|
|
|
|
|
|
[HttpGet("calls")]
|
|
[HttpGet("calls")]
|
|
@@ -116,10 +123,14 @@ public class BiCallController : BaseController
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 小休统计
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
[HttpGet("rests")]
|
|
[HttpGet("rests")]
|
|
[AllowAnonymous]
|
|
[AllowAnonymous]
|
|
- public async Task<IReadOnlyList<BiSeatRestDto>> QuerySeatRestAsync([FromQuery]QuerySeatRestRequest dto)
|
|
|
|
|
|
+ public async Task<IReadOnlyList<BiSeatRestDto>> QuerySeatRest([FromQuery]QuerySeatRestRequest dto)
|
|
{
|
|
{
|
|
return await _telRestRepository.Queryable()
|
|
return await _telRestRepository.Queryable()
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserName), x => x.UserName.Contains(dto.UserName))
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserName), x => x.UserName.Contains(dto.UserName))
|
|
@@ -140,4 +151,34 @@ public class BiCallController : BaseController
|
|
.MergeTable()
|
|
.MergeTable()
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 坐席转接统计
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet("seatswitch")]
|
|
|
|
+ [AllowAnonymous]
|
|
|
|
+ public async Task<PagedDto<BiSeatSwitchDto>> QuerySeatSwitch([FromQuery]QuerySeatSwitchRequest dto)
|
|
|
|
+ {
|
|
|
|
+ var (total,items) = await _trCallRecordRepository.Queryable()
|
|
|
|
+ .Where(x => string.IsNullOrEmpty(x.AgentTransferNumber))
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.UserName), x => x.UserName.Contains(dto.UserName))
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.CDPN), x => x.CDPN.Contains(dto.CDPN))
|
|
|
|
+ .WhereIF(dto.StartTime.HasValue,x=>x.CreatedTime >= dto.StartTime.Value)
|
|
|
|
+ .WhereIF(dto.EndTime.HasValue,x=>x.CreatedTime <= dto.EndTime.Value)
|
|
|
|
+ .Select(x=> new BiSeatSwitchDto {
|
|
|
|
+ UserId = x.UserId,
|
|
|
|
+ CPN = x.CPN,
|
|
|
|
+ CDPN = x.CDPN,
|
|
|
|
+ CreatedTime = x.CreatedTime,
|
|
|
|
+ TelNo = x.AgentTransferNumber,
|
|
|
|
+ UserName = x.UserName,
|
|
|
|
+ })
|
|
|
|
+ .OrderByDescending(x => x.CreatedTime)
|
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ return new PagedDto<BiSeatSwitchDto>(total, _mapper.Map<IReadOnlyList<BiSeatSwitchDto>>(items));
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|