|
@@ -45,81 +45,6 @@ namespace Hotline.Api.Controllers
|
|
|
_callRepository = callRepository;
|
|
|
_sessionContext = sessionContext;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- ///// <summary>
|
|
|
- ///// 查询所有分机(高频)
|
|
|
- ///// </summary>
|
|
|
- ///// <returns></returns>
|
|
|
- //[HttpGet("tels-frequency")]
|
|
|
- //public async Task<IReadOnlyList<TelDto>> QueryTelsFrequency()
|
|
|
- //{
|
|
|
- // var tels = _telCacheManager.GetTels();
|
|
|
- // var dtos = new List<TelDto>();
|
|
|
- // foreach (var tel in tels)
|
|
|
- // {
|
|
|
- // var telModel = _mapper.Map<TelDto>(_telCacheManager.GetTel(tel.No));
|
|
|
- // var telDto = await _deviceManager.QueryTelAsync(tel.No, HttpContext.RequestAborted);
|
|
|
-
|
|
|
- // if (telDto!=null)
|
|
|
- // {
|
|
|
- // telModel.CPN = telDto.CPN;
|
|
|
- // telModel.CDPN = telDto.CDPN;
|
|
|
- // telModel.TelStatusInfo = telDto.TelStatusInfo;
|
|
|
- // telModel.ConversationId = telDto.ConversationId;
|
|
|
- // if (telModel.TelStatus == ETelStatus.Active)
|
|
|
- // telModel.TelStatus = telDto.TelStatus;
|
|
|
-
|
|
|
- // if (telModel.TelStatusInfo == ETelStatusInfo.Out)
|
|
|
- // {
|
|
|
- // var temp = await _callRepository.GetAsync(x => x.FromNo == telDto.CPN && x.ToNo == telDto.CDPN && x.CallDirection == ECallDirection.Out && x.ConversationId == telModel.ConversationId);
|
|
|
- // telModel.CallId = temp?.Id;
|
|
|
- // }
|
|
|
- // else if (telModel.TelStatusInfo == ETelStatusInfo.Into)
|
|
|
- // {
|
|
|
- // var temp = await _callRepository.GetAsync(x => x.FromNo == telDto.CPN && x.ToNo == telDto.CDPN && x.CallDirection == ECallDirection.In && x.ConversationId == telModel.ConversationId);
|
|
|
- // telModel.CallId = temp?.Id;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // dtos.Add(telModel);
|
|
|
- // }
|
|
|
- // return dtos;
|
|
|
- //}
|
|
|
-
|
|
|
- ///// <summary>
|
|
|
- ///// 查询当前用户分机(高频)
|
|
|
- ///// </summary>
|
|
|
- ///// <returns></returns>
|
|
|
- //[HttpGet("tel-frequency")]
|
|
|
- //public async Task<TelDto> QueryTelByToken()
|
|
|
- //{
|
|
|
- // var userid = _sessionContext.RequiredUserId;
|
|
|
- // var work = _userCacheManager.GetWorkByUser(userid);
|
|
|
- // var telModel = _mapper.Map<TelDto>(_telCacheManager.GetTel(work.TelNo));
|
|
|
- // var telDto = await _deviceManager.QueryTelAsync(work.TelNo, HttpContext.RequestAborted);
|
|
|
-
|
|
|
- // if (telDto!=null)
|
|
|
- // {
|
|
|
- // telModel.CPN = telDto.CPN;
|
|
|
- // telModel.CDPN = telDto.CDPN;
|
|
|
- // telModel.TelStatusInfo = telDto.TelStatusInfo;
|
|
|
- // telModel.ConversationId = telDto.ConversationId;
|
|
|
- // if (telModel.TelStatus == ETelStatus.Active)
|
|
|
- // telModel.TelStatus = telDto.TelStatus;
|
|
|
-
|
|
|
- // if(telModel.TelStatusInfo== ETelStatusInfo.Out)
|
|
|
- // {
|
|
|
- // var temp = await _callRepository.GetAsync(x => x.FromNo == telDto.CPN && x.ToNo == telDto.CDPN && x.CallDirection== ECallDirection.Out && x.ConversationId == telModel.ConversationId);
|
|
|
- // telModel.CallId = temp?.Id;
|
|
|
- // }
|
|
|
- // else if(telModel.TelStatusInfo == ETelStatusInfo.Into)
|
|
|
- // {
|
|
|
- // var temp = await _callRepository.GetAsync(x => x.FromNo == telDto.CPN && x.CallDirection == ECallDirection.In && x.ConversationId == telModel.ConversationId);
|
|
|
- // telModel.CallId = temp?.Id;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // return telModel;
|
|
|
- //}
|
|
|
|
|
|
|
|
|
}
|