Forráskód Böngészése

修改设备控制参数

Dun.Jason 2 éve
szülő
commit
5dee15f57c

+ 5 - 9
src/CallCenter.NewRock/DeviceManager.cs

@@ -319,6 +319,8 @@ namespace CallCenter.NewRock
                 cancellationToken);
         }
 
+
+        //TODO 修改参数传递
         /// <summary>
         /// 更新分机组
         /// </summary>
@@ -327,7 +329,7 @@ namespace CallCenter.NewRock
         /// <param name="cancellationToken"></param>
         /// <param name="isAdd"></param>
         /// <returns></returns>
-        public async Task ModifyGroupExtAsync(string groupId, List<string> ext,string voicefile="",bool isAdd=true,CancellationToken cancellationToken = default)
+        public async Task ModifyGroupExtAsync(string groupId,string ext,string voicefile="",bool isAdd=true,CancellationToken cancellationToken = default)
         {
             if (!int.TryParse(groupId, out int mId))
                 throw new UserFriendlyException("请输入数字");
@@ -352,17 +354,11 @@ namespace CallCenter.NewRock
 
             if (isAdd)
             {
-                for (int i = 0; i < ext.Count; i++)
-                {
-                    exts.Add(new QueryExtGroupExt(){ Id = ext[i] });
-                }
+                exts.Add(new QueryExtGroupExt(){ Id = ext });
             }
             else
             {
-                for (int i = 0; i < ext.Count; i++)
-                {
-                    exts.Remove(exts.First(x=>x.Id == ext.First()));
-                }
+                exts.Remove(exts.First(x=>x.Id == ext));
             }
 
             groupModel.Ext = exts.Select(x=>x.Id).ToList();

+ 1 - 1
src/CallCenter/Devices/IDeviceManager.cs

@@ -112,7 +112,7 @@ namespace CallCenter.Devices
         /// <param name="cancellationToken"></param>
         /// <param name="isAdd"></param>
         /// <returns></returns>
-        Task ModifyGroupExtAsync(string groupId, List<string> ext, string voicefile = "",bool isAdd= true, CancellationToken cancellationToken = default);
+        Task ModifyGroupExtAsync(string groupId, string ext, string voicefile = "",bool isAdd= true, CancellationToken cancellationToken = default);
         #endregion
 
         #region 通话控制

+ 2 - 2
src/CallCenter/Users/UserDomainService.cs

@@ -67,7 +67,7 @@ namespace CallCenter.Users
             //更新分机组
             foreach (var group in tel.Groups)
             {
-                await _deviceManager.ModifyGroupExtAsync(group.No, new List<string> { tel.No },group.Voice,true, cancellationToken);
+                await _deviceManager.ModifyGroupExtAsync(group.No,tel.No,group.Voice,true, cancellationToken);
             }
         }
 
@@ -89,7 +89,7 @@ namespace CallCenter.Users
 
             foreach (var group in tel.Groups)
             {
-                await _deviceManager.ModifyGroupExtAsync(group.No, new List<string>() { tel.No }, group.Voice,false, cancellationToken);
+                await _deviceManager.ModifyGroupExtAsync(group.No, tel.No, group.Voice,false, cancellationToken);
             }
 
             return _mapper.Map<WorkDto>(work);