Преглед изворни кода

Merge branch 'dev' of http://110.188.24.182:10023/Fengwo/hotline into dev

田爽 пре 9 месеци
родитељ
комит
b1492a23c4

+ 1 - 1
src/Hotline.Api/config/appsettings.json

@@ -1,7 +1,7 @@
 {
   "AllowedHosts": "*",
   "CallCenterConfiguration": {
-    "CallCenterType": "WeiErXin", //XunShi、WeiErXin
+    "CallCenterType": "TianRun", //XunShi、WeiErXin、TianRun、XingTang
     "NewRock": {
       "Address": "http://192.168.100.100/xml",
       "Authorize": true,

+ 8 - 9
src/Hotline.Application/Jobs/GetCallsJob.cs

@@ -46,18 +46,17 @@ namespace Hotline.Application.Jobs
         {
             var calls = await _db.Queryable<XingtangCall>()
                 .Where(d => (d.IsSync == null || !d.IsSync) && (d.Tries == null || d.Tries <= 50))
-                .Take(100)
+                .Take(10)
                 .ToListAsync(context.CancellationToken);
 
             var occupyCalls = new List<XingtangCall>();
             foreach (var call in calls)
             {
-                var rows = await _db.Updateable(new XingtangCall
-                {
-                    Id = call.Id,
-                    IsSync = true,
-                    Tries = call.Tries + 1
-                }).ExecuteCommandWithOptLockAsync();
+                call.IsSync = true;
+                call.Tries += 1;
+
+                var rows = await _db.Updateable(call)
+                    .ExecuteCommandWithOptLockAsync(true);
                 if (rows > 0)
                     occupyCalls.Add(call);
             }
@@ -77,7 +76,7 @@ namespace Hotline.Application.Jobs
                     //    string.IsNullOrEmpty(trCall.RecordingAbsolutePath))
                     //    continue;
                     Console.WriteLine(trCall.OtherAccept);
-                    
+
                     var user = users.FirstOrDefault(d => d.StaffNo == trCall.StaffNo);
                     if (user is not null)
                     {
@@ -86,7 +85,7 @@ namespace Hotline.Application.Jobs
                     }
                 }
 
-                await _trcallRepository.UpdateRangeAsync(trCalls, context.CancellationToken);
+                await _trcallRepository.AddRangeAsync(trCalls, context.CancellationToken);
             }
             catch (Exception e)
             {

+ 1 - 0
src/Hotline.Application/Mappers/CallMapperConfigs.cs

@@ -79,6 +79,7 @@ namespace Hotline.Application.Mappers
                 .Map(d => d.RingTimes, s => s.RingTime)
                 .Map(d => d.QueueTims, s => s.WaitTime)
                 .Map(d => d.RecordingAbsolutePath, s => s.AudioFile)
+                .Map(d => d.Gateway, s => s.Called)
                 .AfterMapping((s, d) =>
                 {
                     d.CreatedTime = DateTime.Now;

+ 3 - 3
src/Hotline/CallCenter/Calls/TrCallRecord.cs

@@ -12,7 +12,7 @@ namespace Hotline.CallCenter.Calls
         /// <summary>
         /// IPPBX用户名
         /// </summary>
-        public string User { get; set; }
+        public string? User { get; set; }
 
         /// <summary>
         /// 可直接访问的通话录音地址
@@ -39,7 +39,7 @@ namespace Hotline.CallCenter.Calls
         /// <summary>
         /// 坐席侧通话流水,无坐席参与则为手机侧通话流水
         /// </summary>
-        public string CallAccept { get; set; }
+        public string? CallAccept { get; set; }
         /// <summary>
         /// 主叫
         /// </summary>
@@ -47,7 +47,7 @@ namespace Hotline.CallCenter.Calls
         /// <summary>
         /// 主叫名称
         /// </summary>
-        public string CPNName { get; set; }
+        public string? CPNName { get; set; }
         /// <summary>
         /// 被叫
         /// </summary>

+ 25 - 25
src/XingTang.Sdk/XingtangCall.cs

@@ -5,7 +5,7 @@ namespace XingTang.Sdk;
 [SugarTable("call_cti_trafficlist")]
 public class XingtangCall
 {
-    [SugarColumn(ColumnName = "ID")]
+    [SugarColumn(IsPrimaryKey = true, ColumnName = "ID")]
     public int Id { get; set; }
 
     /// <summary>
@@ -60,22 +60,22 @@ public class XingtangCall
     /// 挂机时间
     /// </summary>
     public DateTime CallEndTime { get; set; }
-    
+
     /// <summary>
     /// 时长
     /// </summary>
     public int Duration { get; set; }
-    
+
     /// <summary>
     /// 录音文件
     /// </summary>
     public string AudioFile { get; set; }
-    
+
     /// <summary>
     /// 等待时长
     /// </summary>
     public int WaitTime { get; set; }
-    
+
     /// <summary>
     /// 振铃时长
     /// </summary>
@@ -91,25 +91,25 @@ public class XingtangCall
     /// </summary>
     [SugarColumn(ColumnName = "CallOut_Channel")]
     public int CallOutChannel { get; set; }
-    
+
     /// <summary>
     /// 呼入通道号
     /// </summary>
     [SugarColumn(ColumnName = "CallIn_Channel")]
     public int CallInChannel { get; set; }
-    
+
     /// <summary>
     /// 进队列时间
     /// </summary>
     public DateTime? EnqueueTime { get; set; }
-    
+
     /// <summary>
     /// 出队列时间
     /// </summary>
     public DateTime? DequeueTime { get; set; }
-    
+
     public string? CompanyId { get; set; }
-    
+
     public int? SkillId { get; set; }
     public int? MeetingId { get; set; }
 
@@ -130,24 +130,24 @@ public class XingtangCall
 
     #region 未启用
 
-    public int MutiCall { get; set; }
-    public int CallForword { get; set; }
-    public DateTime RingStartTime { get; set; }
+    public int? MutiCall { get; set; }
+    public int? CallForword { get; set; }
+    public DateTime? RingStartTime { get; set; }
 
     [SugarColumn(ColumnName = "Trans_Called")]
-    public string TransCalled { get; set; }
+    public string? TransCalled { get; set; }
 
     [SugarColumn(ColumnName = "UserListID")]
-    public int UserListId { get; set; }
-
-    public int Score { get; set; }
-    public string MarkRemark { get; set; }
-    public string MarkUserId { get; set; }
-    public DateTime MarkDate { get; set; }
-    public int MarkState { get; set; }
-    public int IsAssign { get; set; }
-    public int ResultKey { get; set; }
-    public int Direction { get; set; }
+    public int? UserListId { get; set; }
+
+    public int? Score { get; set; }
+    public string? MarkRemark { get; set; }
+    public string? MarkUserId { get; set; }
+    public DateTime? MarkDate { get; set; }
+    public int? MarkState { get; set; }
+    public int? IsAssign { get; set; }
+    public int? ResultKey { get; set; }
+    public int? Direction { get; set; }
     #endregion
 
     #region 自建
@@ -157,7 +157,7 @@ public class XingtangCall
     public int Tries { get; set; }
 
     [SugarColumn(IsEnableUpdateVersionValidation = true)]
-    public string Ver { get; set; }
+    public long Ver { get; set; }
 
     #endregion
 }