|
@@ -31,8 +31,9 @@ namespace Hotline.NewRock
|
|
|
private readonly ITelGroupRepository _telGroupRepository;
|
|
|
private readonly IUserCacheManager _userCacheManager;
|
|
|
private readonly ITelRestRepository _telRestRepository;
|
|
|
+ private readonly ITelCacheManager _telCacheManager;
|
|
|
|
|
|
- public DeviceManager(INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options, IMapper mapper, ICallRepository callRepository, ITelGroupRepository telGroupRepository,IUserCacheManager userCacheManager, ITelRestRepository telRestRepository)
|
|
|
+ public DeviceManager(INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options, IMapper mapper, ICallRepository callRepository, ITelGroupRepository telGroupRepository,IUserCacheManager userCacheManager, ITelRestRepository telRestRepository, ITelCacheManager telCacheManager)
|
|
|
{
|
|
|
_newRockClient = newRockClient;
|
|
|
_options = options;
|
|
@@ -41,6 +42,7 @@ namespace Hotline.NewRock
|
|
|
_telGroupRepository = telGroupRepository;
|
|
|
_userCacheManager = userCacheManager;
|
|
|
_telRestRepository = telRestRepository;
|
|
|
+ _telCacheManager = telCacheManager;
|
|
|
}
|
|
|
|
|
|
#region 查询
|
|
@@ -394,12 +396,19 @@ namespace Hotline.NewRock
|
|
|
#endregion
|
|
|
|
|
|
var list = await _telGroupRepository.QueryExtAsync(d => d.No == groupId, d => d.Includes(x => x.Tels));
|
|
|
+ //检查是否上班
|
|
|
List<string> exts = new List<string>();
|
|
|
foreach (var ext in list[0].Tels)
|
|
|
{
|
|
|
var iswork = await _userCacheManager.IsWorkingByTelAsync(ext.No, cancellationToken);
|
|
|
if (iswork)
|
|
|
- exts.Add(ext.No);
|
|
|
+ {
|
|
|
+ var tel = _telCacheManager.GetTel(ext.No);
|
|
|
+ if (tel.TelStatus == ETelStatus.Ready)
|
|
|
+ {
|
|
|
+ exts.Add(ext.No);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//查询所有正在休息的分机
|