Przeglądaj źródła

提交更新自动外呼

zhangkun 5 lat temu
rodzic
commit
d3e6bdeef0

+ 27 - 4
codegit/CallCenterApi/CallCenterApi.BLL/T_Rec_RegRecordsCallOut.cs

@@ -33,9 +33,17 @@ namespace CallCenterApi.BLL
33 33
         }
34 34
 
35 35
         /// <summary>
36
-        /// 更新一条数据
36
+        /// 是否可拨打电话
37 37
         /// </summary>
38
-        public bool Update(CallCenterApi.Model.T_Rec_RegRecordsCallOut model)
38
+        public bool GetFlag(int userid)
39
+        {
40
+            return dal.GetFlag(userid);
41
+        }
42
+
43
+            /// <summary>
44
+            /// 更新一条数据
45
+            /// </summary>
46
+            public bool Update(CallCenterApi.Model.T_Rec_RegRecordsCallOut model)
39 47
         {
40 48
             return dal.Update(model);
41 49
         }
@@ -49,9 +57,24 @@ namespace CallCenterApi.BLL
49 57
         }
50 58
 
51 59
         /// <summary>
52
-        /// 删除一条数据
60
+        /// 更新数据状态
61
+        /// </summary>
62
+        public bool Update0(string id)
63
+        {
64
+            return dal.Update0(id);
65
+        }
66
+        /// <summary>
67
+        /// 挂断电话 可继续拨打电话
53 68
         /// </summary>
54
-        public bool Delete(int F_ID)
69
+        public bool Update2(int userid, string phone)
70
+        {
71
+            return dal.Update2(userid, phone);
72
+        }
73
+
74
+            /// <summary>
75
+            /// 删除一条数据
76
+            /// </summary>
77
+            public bool Delete(int F_ID)
55 78
         {
56 79
 
57 80
             return dal.Delete(F_ID);

+ 55 - 2
codegit/CallCenterApi/CallCenterApi.DAL/T_Rec_RegRecordsCallOut.cs

@@ -261,12 +261,65 @@ parameters[22].Value = model.F_UnitOffice;
261 261
 
262 262
 
263 263
         /// <summary>
264
-        /// 更新一条数据
264
+        /// 是否可拨打电话
265
+        /// </summary>
266
+        public bool GetFlag(int userid)
267
+        {
268
+
269
+            int rows =Convert.ToInt32(DbHelperSQL.GetSingle(string.Format("select count(1) from T_Rec_RegRecordsCallOut where  F_RecCode='0' and F_CreateBy=(select F_Mobile from T_Sys_UserAccount where  F_UserId={0}) AND (select count(1) from  T_Rec_RegRecordsCallOut where F_RecCode='1' and F_CreateBy=(select F_Mobile from T_Sys_UserAccount where  F_UserId={0}))=0", userid)));
270
+
271
+            if (rows > 0)
272
+            {
273
+                return  true;
274
+            }
275
+            else
276
+            {
277
+                return false;
278
+            }
279
+        }
280
+
281
+        /// <summary>
282
+        /// 重置电话
283
+        /// </summary>
284
+        public bool Update0(string id)
285
+        {
286
+
287
+            int rows = DbHelperSQL.ExecuteSql("update T_Rec_RegRecordsCallOut set F_RecCode='0' where F_RecCode='2' AND F_Id=" + id);
288
+
289
+            if (rows > 0)
290
+            {
291
+                return true;
292
+            }
293
+            else
294
+            {
295
+                return false;
296
+            }
297
+        }
298
+
299
+        /// <summary>
300
+        /// 开始电话
265 301
         /// </summary>
266 302
         public bool Update(string id)
267 303
         {    
268 304
 
269
-            int rows = DbHelperSQL.ExecuteSql("update T_Rec_RegRecordsCallOut set F_RecCode='1' where F_Id="+ id);
305
+            int rows = DbHelperSQL.ExecuteSql("update T_Rec_RegRecordsCallOut set F_RecCode='1' where F_RecCode='0' AND F_Id=" + id);
306
+
307
+            if (rows > 0)
308
+            {
309
+                return true;
310
+            }
311
+            else
312
+            {
313
+                return false;
314
+            }
315
+        }
316
+        /// <summary>
317
+        /// 挂断电话 可继续拨打电话
318
+        /// </summary>
319
+        public bool Update2(int userid,string phone)
320
+        {
321
+
322
+            int rows = DbHelperSQL.ExecuteSql(string.Format("update T_Rec_RegRecordsCallOut set F_RecCode='2' where  F_userPhone='{0}' AND F_RecCode = '1' and F_CreateBy = (select F_Mobile from T_Sys_UserAccount where F_UserId ={1} )",phone,userid));
270 323
 
271 324
             if (rows > 0)
272 325
             {

+ 57 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/RegRecords/RegRecordsCallOutController.cs

@@ -150,13 +150,68 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
150 150
                     return Success("成功");
151 151
                 }
152 152
                 else
153
-                    return Error("失败");
153
+                    return Success("失败");
154 154
             }
155 155
             else
156 156
             {
157
-                return Error("请选择记录");
157
+                return Success("请选择记录");
158 158
             }
159 159
 
160 160
         }
161
+
162
+        public ActionResult Update2(string phone)
163
+        {
164
+            if (!Request.IsAuthenticated)
165
+                return NoToken("未知错误,请重新登录");
166
+            int userid = CurrentUser.UserData.F_UserId;
167
+            if (userid == 0)
168
+                return Error("用户信息获取失败,请重新登录");
169
+
170
+                if (new BLL.T_Rec_RegRecordsCallOut().Update2(userid,phone))
171
+                {
172
+                    return Success("成功");
173
+                }
174
+                else
175
+                    return Success("失败");
176
+
177
+
178
+        }
179
+        public ActionResult Update0(string id)
180
+        {
181
+            if (!Request.IsAuthenticated)
182
+                return NoToken("未知错误,请重新登录");
183
+            int userid = CurrentUser.UserData.F_UserId;
184
+            if (userid == 0)
185
+                return Error("用户信息获取失败,请重新登录");
186
+
187
+            if (new BLL.T_Rec_RegRecordsCallOut().Update0(id))
188
+            {
189
+                return Success("成功");
190
+            }
191
+            else
192
+                return Success("失败");
193
+
194
+
195
+        }
196
+
197
+        public ActionResult GetFlag()
198
+        {
199
+            if (!Request.IsAuthenticated)
200
+                return NoToken("未知错误,请重新登录");
201
+            int userid = CurrentUser.UserData.F_UserId;
202
+            if (userid == 0)
203
+                return Error("用户信息获取失败,请重新登录");
204
+
205
+            if (new BLL.T_Rec_RegRecordsCallOut().GetFlag(userid))
206
+            {
207
+                return Success("成功",true);
208
+            }
209
+            else
210
+            {
211
+                return Success("失败", false);
212
+            }
213
+
214
+
215
+        }
161 216
     }
162 217
 }