Przeglądaj źródła

会员绑定坐席

duhongyu 5 lat temu
rodzic
commit
ecbcc1781b

+ 13 - 0
代码/System.IRepositories/Call/Ipoint_agentRepository.cs

@@ -0,0 +1,13 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Common;
4
+using System.Model.Call;
5
+using System.Text;
6
+
7
+namespace System.IRepositories.Call
8
+{
9
+    
10
+    public interface Ipoint_agentRepository : IRepository<point_agent>
11
+    {
12
+    }
13
+}

+ 43 - 0
代码/System.Model/Call/point_agent.cs

@@ -0,0 +1,43 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+
5
+namespace System.Model.Call
6
+{
7
+    [Serializable]
8
+    public partial class point_agent
9
+    {
10
+        public point_agent()
11
+        { }
12
+        #region Model
13
+        private long _id;
14
+        private string _caller;
15
+        private string _agent;
16
+        /// <summary>
17
+        /// auto_increment
18
+        /// </summary>
19
+        public long id
20
+        {
21
+            set { _id = value; }
22
+            get { return _id; }
23
+        }
24
+        /// <summary>
25
+        /// 
26
+        /// </summary>
27
+        public string caller
28
+        {
29
+            set { _caller = value; }
30
+            get { return _caller; }
31
+        }
32
+        /// <summary>
33
+        /// 
34
+        /// </summary>
35
+        public string agent
36
+        {
37
+            set { _agent = value; }
38
+            get { return _agent; }
39
+        }
40
+        #endregion Model
41
+
42
+    }
43
+}

+ 14 - 0
代码/System.Repositories/Call/point_agentRepository.cs

@@ -0,0 +1,14 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Common;
4
+using System.IRepositories.Call;
5
+using System.Model.Call;
6
+using System.Text;
7
+
8
+namespace System.Repositories.Call
9
+{
10
+   
11
+    public class point_agentRepository : BaseMysqlRepository<point_agent>, Ipoint_agentRepository
12
+    {
13
+    }
14
+}

+ 17 - 16
代码/TVShoppingCallCenter_ZLJ/Controllers/AutoDial/OutboundTaskController.cs

@@ -137,7 +137,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.AutoDial
137 137
         [HttpPost("addmiddleware")]
138 138
         public async Task<IActionResult> Addmiddleware()
139 139
         {
140
-            string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
140
+            string user ="8000";
141 141
             List<IConditionalModel> conModels = new List<IConditionalModel>();
142 142
             conModels.Add(new ConditionalModel() { FieldName = "F_IsDelete", ConditionalType = ConditionalType.Equal, FieldValue = ((int)EnumUserCountState.Enabled).ToString() });
143 143
              conModels.Add(new ConditionalCollections()
@@ -148,8 +148,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.AutoDial
148 148
                         new  KeyValuePair<WhereType, ConditionalModel>( WhereType.Or , new ConditionalModel() { FieldName = "F_Type", ConditionalType = ConditionalType.Equal , FieldValue = "0" })
149 149
                     }
150 150
                 });
151
-            conModels.Add(new ConditionalModel() { FieldName = "F_StartTime", ConditionalType = ConditionalType.GreaterThan , FieldValue = DateTime .Now .ToString() });
152
-            conModels.Add(new ConditionalModel() { FieldName = "F_EndTime", ConditionalType = ConditionalType.LessThanOrEqual , FieldValue = DateTime.Now.ToString() });
151
+            conModels.Add(new ConditionalModel() { FieldName = "F_StartTime", ConditionalType = ConditionalType.LessThanOrEqual, FieldValue = DateTime .Now .ToString() });
152
+            conModels.Add(new ConditionalModel() { FieldName = "F_EndTime", ConditionalType = ConditionalType.GreaterThan, FieldValue = DateTime.Now.ToString() });
153 153
             conModels.Add(new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal , FieldValue = "1" });
154 154
             var list = await _sys_outboundTaskrepository.GetListALL (conModels,  "  F_AddTime  desc");
155 155
             int n = 0;
@@ -165,26 +165,27 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.AutoDial
165 165
                         conModel.Add(new ConditionalModel() { FieldName = "F_Parentid", ConditionalType = ConditionalType.Equal, FieldValue = it.F_ID .ToString() });
166 166
                         conModel.Add(new ConditionalModel() { FieldName = "F_ISOutbound", ConditionalType = ConditionalType.Equal, FieldValue = "0" });
167 167
                         #endregion
168
-                        var modellist = await _sys_autodialrepository.GetListALL (conModels, "  F_ID  asc");
168
+                        var modellist = await _sys_autodialrepository.GetListALL (conModel, "  F_ID  asc");
169 169
                         if (modellist!=null )
170 170
                         {
171 171
                             foreach (var iv in modellist)
172 172
                             {
173
-                                task tasks = new task();
174
-                                tasks.agent = user;
175
-                                tasks.number  = iv .F_Tel ;
176
-                                tasks.state  =0;
177
-                                tasks.type  = it .F_Type ;
178
-                                tasks.content  = it.F_Content ;
179
-                                tasks.outbound_id   = iv .F_ID ;
180
-                                tasks.status = 0;
181
-                                var res = await _taskrepository.Add (tasks);
182
-                                if (res>0)
173
+                                var model = await _taskrepository.GetListALL(x => x.outbound_id == iv.F_ID);
174
+                                if (model==null || model.Count <=0)
183 175
                                 {
184
-                                  n=  n + 1;
185
-
176
+                                    task tasks = new task();
177
+                                    tasks.agent = user;
178
+                                    tasks.number = iv.F_Tel;
179
+                                    tasks.state = 0;
180
+                                    tasks.type = it.F_Type;
181
+                                    tasks.content = it.F_Content;
182
+                                    tasks.outbound_id = iv.F_ID;
183
+                                    tasks.status = 0;
184
+                                    var res = await _taskrepository.Add(tasks);
185
+                                   
186 186
                                 }
187 187
                             }
188
+                            n = modellist.Count ();
188 189
                         }
189 190
                     }
190 191
                     if (n >0)

+ 13 - 2
代码/TVShoppingCallCenter_ZLJ/Controllers/CallCenter/CallFunctionController.cs

@@ -37,9 +37,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
37 37
         private readonly ISys_AutoDialRepository sys_autodialrepository;
38 38
         private readonly ISys_SystemConfigRepository busSystemConfigRepository;
39 39
         private readonly ICus_VipInfoRepository _cus_vip_infoRepository;//客户
40
+        private readonly Ipoint_agentRepository _point_agentrepository;
40 41
         public CallFunctionController(ISys_SystemConfigRepository _busSystemConfigRepository,ICDRRepository _busCdrRepository,ICall_CallRecordsRepository _busCallRecordsRepository,IConfiguration _configuration, ISys_MobileDataRepository _busMobileDataRepository, ICus_VipInfoRepository cus_vip_infoRepository,
41 42
             ICall_CallOutboundRepository _CallOutboundRecordsRepository, Iauto_cdrRepository _auto_cdrRepository
42
-            , ItaskRepository _taskRepository, ISys_AutoDialRepository _sys_autodialrepository)
43
+            , ItaskRepository _taskRepository, ISys_AutoDialRepository _sys_autodialrepository,
44
+            Ipoint_agentRepository point_agentrepository)
43 45
         {
44 46
             busSystemConfigRepository = _busSystemConfigRepository;
45 47
             busCdrRepository = _busCdrRepository;
@@ -51,7 +53,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
51 53
             auto_cdrRepository = _auto_cdrRepository;
52 54
             taskRepository = _taskRepository;
53 55
             sys_autodialrepository = _sys_autodialrepository;
54
-    }
56
+            _point_agentrepository = point_agentrepository;
57
+        }
55 58
 
56 59
         /// <summary>
57 60
         /// 电话归属地查询
@@ -173,6 +176,14 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.CallCenter
173 176
                         {
174 177
                             modelRecord.CusCode = cus.FirstOrDefault ().F_Name ;
175 178
                             modelRecord.CusId = cus.FirstOrDefault().F_ID ;
179
+                            var point = await _point_agentrepository.GetListALL(x => x.agent == modelcdr.callee_agent);
180
+                            if (point==null && point.Count ()<=0)
181
+                            {
182
+                                point_agent point_Agent = new point_agent();
183
+                                point_Agent.caller = modelcdr.caller;
184
+                                point_Agent.agent  = modelcdr.callee_agent;
185
+                                var res = _point_agentrepository.Add(point_Agent);
186
+                            }
176 187
                         }
177 188
                     }
178 189
                     else

+ 1 - 0
代码/TVShoppingCallCenter_ZLJ/Startup.cs

@@ -208,6 +208,7 @@ namespace TVShoppingCallCenter_ZLJ
208 208
             services.AddTransient<ItaskRepository, taskRepository>();
209 209
             services.AddTransient<Iauto_cdrRepository , auto_cdrRepository>();
210 210
             services.AddTransient<ICall_CallOutboundRepository, Call_CallOutboundRepository>();
211
+            services.AddTransient<Ipoint_agentRepository, point_agentRepository>();
211 212
             
212 213
             #endregion
213 214