|
@@ -38,7 +38,7 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IOptionsSnapshot<CallCenterConfiguration> _callcenterOptions;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
- private readonly IRepository<TelOperationXthx> _telOperationXthxRepository;
|
|
|
+ private readonly IRepository<TelOperationXthx> _telOperationXthxRepository;
|
|
|
private readonly IUserCacheManager _userCacheManager;
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
private readonly IRepository<TelActionRecord> _telActionRecordRepository;
|
|
@@ -140,9 +140,7 @@ namespace Hotline.Api.Controllers
|
|
|
if (actionType == 0)//小休
|
|
|
{
|
|
|
var isResting = await _telActionRecordRepository.AnyAsync(x => x.TelNo == work.TelNo && x.ActionType == EActionType.TelRest && !x.EndTime.HasValue, HttpContext.RequestAborted);
|
|
|
- if (isResting)
|
|
|
- throw UserFriendlyException.SameMessage("当前坐席正在休息");
|
|
|
- else
|
|
|
+ if (!isResting)
|
|
|
{
|
|
|
var telAction = new TelActionRecord(work.UserId, work.UserName, work.TelNo, work.QueueId, EActionType.TelRest);
|
|
|
await _telActionRecordRepository.AddAsync(telAction, HttpContext.RequestAborted);
|
|
@@ -251,44 +249,44 @@ namespace Hotline.Api.Controllers
|
|
|
public async Task<int> QueryCallsFixedCount([FromQuery] QueryCallsFixedDto dto)
|
|
|
=> await _callApplication.QueryCallsFixedAsync(dto, HttpContext.RequestAborted).CountAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 导出通话记录
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("calls-fixed/export")]
|
|
|
- [LogFilterAlpha("导出日志")]
|
|
|
- public async Task<FileStreamResult> ExportOrders([FromBody] ExportExcelDto<QueryCallsFixedDto> dto)
|
|
|
- {
|
|
|
- var query = _callApplication.QueryCallsFixedAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
- List<CallNativeDto> callls;
|
|
|
- if (dto.IsExportAll)
|
|
|
- {
|
|
|
- callls = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
- callls = items;
|
|
|
- }
|
|
|
- dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass<CallNativeDto>(dto.ColumnInfos);
|
|
|
-
|
|
|
- var dtos = callls
|
|
|
- .Select(stu => _mapper.Map(stu, typeof(CallNativeDto), dynamicClass))
|
|
|
- .Cast<object>()
|
|
|
- .ToList();
|
|
|
-
|
|
|
- var stream = ExcelHelper.CreateStream(dtos);
|
|
|
-
|
|
|
- return ExcelStreamResult(stream, "通话记录");
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 查询通话记录
|
|
|
- /// </summary>
|
|
|
- /// <param name="callId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("{callId}")]
|
|
|
+ /// <summary>
|
|
|
+ /// 导出通话记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("calls-fixed/export")]
|
|
|
+ [LogFilterAlpha("导出日志")]
|
|
|
+ public async Task<FileStreamResult> ExportOrders([FromBody] ExportExcelDto<QueryCallsFixedDto> dto)
|
|
|
+ {
|
|
|
+ var query = _callApplication.QueryCallsFixedAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ List<CallNativeDto> callls;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ callls = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ callls = items;
|
|
|
+ }
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass<CallNativeDto>(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = callls
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(CallNativeDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "通话记录");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询通话记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="callId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("{callId}")]
|
|
|
public Task<List<CallNative>> GetCall(string callId)
|
|
|
{
|
|
|
//为兼容天润通话记录返回集合
|