|
@@ -1,4 +1,5 @@
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.CallCenter.Tels;
|
|
|
using Hotline.Share.Dtos.TrCallCenter;
|
|
|
using Hotline.Users;
|
|
|
using Tr.Sdk;
|
|
@@ -6,6 +7,7 @@ using XF.Domain.Authentications;
|
|
|
using XF.Domain.Constants;
|
|
|
using XF.Domain.Dependency;
|
|
|
using XF.Domain.Exceptions;
|
|
|
+using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Application.CallCenter.Calls
|
|
|
{
|
|
@@ -16,13 +18,15 @@ namespace Hotline.Application.CallCenter.Calls
|
|
|
private readonly IWorkRepository _workRepository;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
private readonly IUserCacheManager _userCacheManager;
|
|
|
- public TrApplication(ITrClient trClient, ISessionContext sessionContext,IWorkRepository workRepository,ISystemSettingCacheManager systemSettingCacheManager,IUserCacheManager userCacheManager)
|
|
|
+ private readonly ITelRestRepository _telRestRepository;
|
|
|
+ public TrApplication(ITrClient trClient, ISessionContext sessionContext,IWorkRepository workRepository,ISystemSettingCacheManager systemSettingCacheManager,IUserCacheManager userCacheManager, ITelRestRepository telRestRepository)
|
|
|
{
|
|
|
_trClient = trClient;
|
|
|
_sessionContext = sessionContext;
|
|
|
_workRepository = workRepository;
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
_userCacheManager = userCacheManager;
|
|
|
+ _telRestRepository = telRestRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -37,6 +41,7 @@ namespace Hotline.Application.CallCenter.Calls
|
|
|
var work = _userCacheManager.GetWorkByUserNoExp(userId);
|
|
|
if (work is not null)
|
|
|
{
|
|
|
+
|
|
|
if (work.TelNo == telNo)
|
|
|
{
|
|
|
return new TrOnDutyResponseDto() { TelNo = work.TelNo, TelPwd = work.TelPwd, Description = work.Description, QueueId = work.QueueId,StartTime = work.StartTime };
|
|
@@ -61,7 +66,7 @@ namespace Hotline.Application.CallCenter.Calls
|
|
|
bool IsTelNeedVerify = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsTelNeedVerify).SettingValue[0]);
|
|
|
if (IsTelNeedVerify)
|
|
|
{
|
|
|
- return new TrOnDutyResponseDto() { TelNo = telNo, TelPwd = "", Description = telModel[0].Description, QueueId = telModel[0].QueueId,StartTime = work.StartTime };
|
|
|
+ return new TrOnDutyResponseDto() { TelNo = telNo, TelPwd = "", Description = telModel[0].Description, QueueId = telModel[0].QueueId,StartTime = work.StartTime};
|
|
|
}
|
|
|
else
|
|
|
{
|