|
@@ -1,6 +1,7 @@
|
|
|
using DotNetCore.CAP;
|
|
|
using Hotline.Ai.Quality;
|
|
|
using Hotline.Application.CallCenter.Calls;
|
|
|
+using Hotline.Application.Systems;
|
|
|
using Hotline.Application.Tels;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.CallCenter.Calls;
|
|
@@ -59,7 +60,7 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IRepository<QualityTemplate> _qualityTemplate;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
private readonly IRepository<TelActionRecord> _telActionRecordRepository;
|
|
|
-
|
|
|
+ private readonly ISystemMobilAreaApplication _systemMobilAreaApplication;
|
|
|
|
|
|
public IPPbxController(ITrClient trClient, IMapper mapper, IUserDomainService userDomainService,
|
|
|
ISessionContext sessionContext, IRepository<TrCallRecord> trCallRecordRepository,
|
|
@@ -70,7 +71,8 @@ namespace Hotline.Api.Controllers
|
|
|
ITelRestRepository telRestRepository, IRepository<User> userRepository,
|
|
|
ITelApplication telApplication, IRepository<Quality.Quality> qualiteyRepository,
|
|
|
IAiQualityService aiQualityService, IRepository<QualityTemplate> qualityTemplate,
|
|
|
- ISystemSettingCacheManager systemSettingCacheManager,IRepository<TelActionRecord> telActionRecordRepository)
|
|
|
+ ISystemSettingCacheManager systemSettingCacheManager,IRepository<TelActionRecord> telActionRecordRepository,
|
|
|
+ ISystemMobilAreaApplication systemMobilAreaApplication)
|
|
|
{
|
|
|
_trClient = trClient;
|
|
|
_mapper = mapper;
|
|
@@ -93,6 +95,7 @@ namespace Hotline.Api.Controllers
|
|
|
_qualityTemplate = qualityTemplate;
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
_telActionRecordRepository = telActionRecordRepository;
|
|
|
+ _systemMobilAreaApplication = systemMobilAreaApplication;
|
|
|
}
|
|
|
|
|
|
#region 添添呼
|
|
@@ -439,10 +442,32 @@ namespace Hotline.Api.Controllers
|
|
|
if (model.CallDirection == ECallDirection.In)
|
|
|
{
|
|
|
model.TelNo = model.CDPN;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var areaModel = await _systemMobilAreaApplication.GetPhoneCardArea(model.CPN, HttpContext.RequestAborted);
|
|
|
+ if (areaModel != null)
|
|
|
+ {
|
|
|
+ model.MobileAreaName = areaModel.MobileAreaName;
|
|
|
+ model.OFlag = areaModel.OFlag;
|
|
|
+ model.OperatorName = areaModel.OperatorName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch{}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
model.TelNo = model.CPN;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var areaModel = await _systemMobilAreaApplication.GetPhoneCardArea(model.CDPN, HttpContext.RequestAborted);
|
|
|
+ if (areaModel != null)
|
|
|
+ {
|
|
|
+ model.MobileAreaName = areaModel.MobileAreaName;
|
|
|
+ model.OFlag = areaModel.OFlag;
|
|
|
+ model.OperatorName = areaModel.OperatorName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch{}
|
|
|
}
|
|
|
//判断是否是内部通话(目前分机都为4位)
|
|
|
if (model.CPN.Length==4 && model.CDPN.Length ==4) //是内部通话
|
|
@@ -453,6 +478,7 @@ namespace Hotline.Api.Controllers
|
|
|
{
|
|
|
model.PhoneTypes = (EPhoneTypes)Convert.ToInt32(dto.phoneTypes);
|
|
|
}
|
|
|
+
|
|
|
|
|
|
//获取关联 工单或是回访
|
|
|
//var order = await _orderRepository.GetAsync(x => x.CallId == model.CallAccept, HttpContext.RequestAborted);//由CallAccept改为OtherAccept
|
|
@@ -593,6 +619,8 @@ namespace Hotline.Api.Controllers
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Gateway), x => x.Gateway.Contains(dto.Gateway))
|
|
|
|
|
|
.WhereIF(dto.IsAiAnswered == true,x=>string.IsNullOrEmpty(x.UserId) == true)
|
|
|
+
|
|
|
+ .WhereIF(dto.PhoneTypes!=null,x=>x.PhoneTypes == dto.PhoneTypes)
|
|
|
.OrderByDescending(x => x.CreatedTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize);
|
|
|
return new PagedDto<TrCallDto>(total, _mapper.Map<IReadOnlyList<TrCallDto>>(items));
|
|
@@ -610,6 +638,7 @@ namespace Hotline.Api.Controllers
|
|
|
OnState = EnumExts.GetDescriptions<EOnState>(),
|
|
|
CallDirection = EnumExts.GetDescriptions<ECallDirection>(),
|
|
|
EndBy = EnumExts.GetDescriptions<EEndBy>(),
|
|
|
+ PhoneTypes = EnumExts.GetDescriptions<EPhoneTypes>()
|
|
|
};
|
|
|
}
|
|
|
|