|
@@ -0,0 +1,117 @@
|
|
|
+using Hotline.CallCenter.Calls;
|
|
|
+using Hotline.Repository.SqlSugar;
|
|
|
+using Microsoft.Extensions.DependencyInjection;
|
|
|
+using Microsoft.Extensions.Hosting;
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
+using SqlSugar;
|
|
|
+
|
|
|
+namespace Hotline.Application.CallCenter
|
|
|
+{
|
|
|
+ public class CallRecordManager : BackgroundService
|
|
|
+ {
|
|
|
+ private readonly IServiceScopeFactory _serviceScopeFactory;
|
|
|
+ private readonly ISugarUnitOfWork<WexDbContext> _uowWex;
|
|
|
+
|
|
|
+ public CallRecordManager(IServiceScopeFactory serviceScopeFactory,ISugarUnitOfWork<WexDbContext> uowWex)
|
|
|
+ {
|
|
|
+ _serviceScopeFactory = serviceScopeFactory;
|
|
|
+ _uowWex = uowWex;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
|
|
+ {
|
|
|
+ //20秒扫描一次威尔信数据库
|
|
|
+ using var sc = _serviceScopeFactory.CreateScope();
|
|
|
+ var _logger = sc.ServiceProvider.GetService<ILogger<CallRecordManager>>();
|
|
|
+ var time = TimeSpan.FromSeconds(20);
|
|
|
+ while (!stoppingToken.IsCancellationRequested)
|
|
|
+ {
|
|
|
+ using var scope = _serviceScopeFactory.CreateScope();
|
|
|
+ var _wexCallRecordRepository = scope.ServiceProvider.GetService<IWexCallRecordRepository>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new NotImplementedException();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public class WexRecord
|
|
|
+ {
|
|
|
+ [SugarColumn(ColumnName = "CallID")]
|
|
|
+ public string CallId { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "CallType")]
|
|
|
+ public string CallType { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "Telphone")]
|
|
|
+ public string TelPhone { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "TrunkLinePhone")]
|
|
|
+ public string TrunkNum { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "GongHao")]
|
|
|
+ public string GongHao { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "AreaName")]
|
|
|
+ public string AreaName { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "BeginIvrTime")]
|
|
|
+ public DateTime? BeginIvrTime { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "EndIvrTime")]
|
|
|
+ public DateTime? EndIvrTime { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "BeginQueueTime")]
|
|
|
+ public DateTime? BeginQueueTime { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "EndQueueTime")]
|
|
|
+ public DateTime? EndQueueTime { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "BeginRingTime")]
|
|
|
+ public DateTime? BeginRingTime{ get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "EndRingTime")]
|
|
|
+ public DateTime? EndRingTime { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "RingTimes")]
|
|
|
+ public int RingTimes { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "CallTime")]
|
|
|
+ public DateTime? CallTime { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "BeginTalking")]
|
|
|
+ public DateTime? BeginTalking { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "EndTalking")]
|
|
|
+ public DateTime? EndTalking { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 通话时长
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnName = "TalkLenth")]
|
|
|
+ public int TalkLength { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "RecordUrl")]
|
|
|
+ public string RecordUrl { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "RecordName")]
|
|
|
+ public string RecordName { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "SourceRecord")]
|
|
|
+ public string SourceRecord { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "noAnswerResult")]
|
|
|
+ public string NoAnswerResult { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "Result")]
|
|
|
+ public string Result { get; set; }
|
|
|
+
|
|
|
+ [SugarColumn(ColumnName = "AssessName")]
|
|
|
+ public string AssessName { get; set; }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|