zhengbingbing vor 7 Jahren
Ursprung
Commit
e7e4df5261

+ 78 - 42
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/CallOutOptController.cs

@@ -10,60 +10,96 @@ namespace CallCenterApi.Interface.Controllers
10 10
 {
11 11
     public class CallOutOptController : BaseController
12 12
     {
13
+        int zip = 0;string fixphone = "";
14
+        /// <summary>
15
+        /// 外呼时调用
16
+        /// 涉及到通话记录,返回callid
17
+        /// </summary>
18
+        /// <param name="phone"></param>
19
+        /// <param name="workorderid"></param>
20
+        /// <returns></returns>
21
+        public ActionResult CallOut(string phone, string workorderid)
22
+        {
23
+            int type = 0;
24
+            GetCallOutprefix(phone);
25
+            if (zip > 0)
26
+                type = 1;
27
+            #region 添加外呼通话记录
28
+            Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
29
+            model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms");
30
+            model.CallNumber = phone;
31
+            model.CallType = 1;
32
+            model.UserId = CurrentUser.UserData.F_UserId;
33
+            model.UserCode = CurrentUser.UserData.F_UserCode;
34
+            model.UserName = CurrentUser.UserData.F_UserName;
35
+            model.ExtNumber = CurrentUser.UserData.F_ExtensionNumber;
36
+            model.CallState = 0;
37
+            model.DealType = 6;
38
+            model.IsDeal = 1;
39
+            string cid = model.CallId;
40
+            int i = new BLL.T_Call_CallRecords().Add(model);
41
+            model.CallRecordsId = i;
42
+            #endregion
43
+
44
+            var obj = new
45
+            {
46
+                type = type,//0分机互拨或特殊号码
47
+                phone = fixphone,
48
+                callid = cid,
49
+            };
50
+            return Success("获取成功",obj);
51
+        }
13 52
         //外呼判断本地外地以及加前缀返回
14 53
         public ActionResult GetCallOutprefix(string phone)
15 54
         {
16
-            ActionResult res = NoToken("未知错误,请重新登录");
17
-            if (Request.IsAuthenticated)
55
+            string phone1 = RequestString.ToDBC(RequestString.RemoveNotNumber(WebHelper.NoHtml(phone)));
56
+            string tophone = phone1;
57
+            string zipcode = ""; string bfix = ""; string wfix = ""; string fix = "";
58
+            string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
59
+            if (userseatgroupid != "" && userseatgroupid != "0")
18 60
             {
19
-                string phone1 = RequestString.ToDBC(RequestString.RemoveNotNumber(WebHelper.NoHtml(phone)));
20
-                string tophone = phone1;
21
-                string zipcode = ""; string bfix = ""; string wfix = ""; string fix = "";
22
-                string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
23
-                if (userseatgroupid != "" && userseatgroupid != "0")
61
+                Model.T_Sys_SeatGroup smodel = new BLL.T_Sys_SeatGroup().GetModel(int.Parse(userseatgroupid));
62
+                if (smodel != null)
24 63
                 {
25
-                    Model.T_Sys_SeatGroup smodel = new BLL.T_Sys_SeatGroup().GetModel(int.Parse(userseatgroupid));
26
-                    if (smodel != null)
27
-                    {
28
-                        zipcode = smodel.F_ZXAtt.Trim();
29
-                        bfix = smodel.F_WHBDKey.Trim();
30
-                        wfix = smodel.F_WHWDKey.Trim();
31
-                    }
64
+                    zipcode = smodel.F_ZXAtt.Trim();
65
+                    bfix = smodel.F_WHBDKey.Trim();
66
+                    wfix = smodel.F_WHWDKey.Trim();
32 67
                 }
33
-                int zip = GetZipCodeByPhone(phone1, zipcode);
34
-                #region 
35
-                if (zip == 1)
36
-                {//手机本地号码
68
+            }
69
+            zip = GetZipCodeByPhone(phone1, zipcode);
70
+            #region 判断前缀
71
+            if (zip == 1)
72
+            {//手机本地号码
73
+                fix = bfix;
74
+            }
75
+            else if (zip == 2)
76
+            {//手机外地号码
77
+                fix = wfix;
78
+            }
79
+            else
80
+            {
81
+                tophone = phone1.TrimStart('0');
82
+                if (zip == 3)
83
+                {//本地固话去0加9 比如:988888517,937188888517
37 84
                     fix = bfix;
38 85
                 }
39
-                else if (zip == 2)
40
-                {//手机外地号码
86
+                else if (zip == 4)
87
+                {//外地固话前加9 比如:9037188888517
41 88
                     fix = wfix;
42 89
                 }
43
-                else
44
-                {
45
-                    tophone = phone1.TrimStart('0');
46
-                    if (zip == 3)
47
-                    {//本地固话去0加9 比如:988888517,937188888517
48
-                        fix = bfix;
49
-                    }
50
-                    else if (zip == 4)
51
-                    {//外地固话前加9 比如:9037188888517
52
-                        fix = wfix;
53
-                    }
54
-                }
55
-                #endregion
56
-                var obj = new
57
-                {
58
-                    phone = fix + tophone,
59
-                    fix = fix
60
-                };
61
-
62
-                res = Success("外呼号码加前缀", obj);
63 90
             }
64
-            return res;
65
-        }
91
+            #endregion
92
+
93
+            fixphone = fix + tophone;
94
+            var obj = new
95
+            {
96
+                phone = fixphone,
97
+                fix = fix
98
+            };
99
+
100
+            return Success("外呼号码加前缀", obj);
66 101
 
102
+        }
67 103
         /// <summary>
68 104
         /// 根据号码和区号判断号码是否为归属地号码
69 105
         /// 返回0为分机号或特殊号码

+ 47 - 13
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -139,13 +139,47 @@ namespace CallCenterApi.Interface.Controllers.tel
139 139
             ActionResult res = NoToken("未知错误,请重新登录");
140 140
             if (Request.IsAuthenticated)
141 141
             {
142
-                DataTable dt = new DataTable();
143
-
144
-                string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
145
-                Model.T_Call_CallRecords model = new BLL.T_Call_CallRecords().GetModelByTelphone(tel);
146
-
147
-                res = Success("加载成功", model);
148
-
142
+                int userId = CurrentUser.UserData.F_UserId;
143
+                if (userId != 0)
144
+                {
145
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
146
+                    if (ua != null)
147
+                    {
148
+                        string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("telphone"));
149
+                        Model.T_Call_CallRecords model1 = new BLL.T_Call_CallRecords().GetModelByTelphone(tel);
150
+                        if (model1 != null)
151
+                        {
152
+                            res = Success("加载成功", model1);
153
+                        }
154
+                        try
155
+                        {
156
+                            Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
157
+                            model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms");
158
+                            model.CallNumber = tel;
159
+
160
+                            #region 设置当前登录坐席
161
+                            model.UserId = ua.F_UserId;
162
+                            model.UserCode = ua.F_UserCode;
163
+                            model.UserName = ua.F_UserName;
164
+                            model.ExtNumber = CurrentUser.UserData.F_ExtensionNumber;
165
+                            #endregion
166
+                            #region 设置状态
167
+                            model.CallType = 0;
168
+                            model.CallState = 1;
169
+                            model.DealType = 6;
170
+                            model.IsDeal = 1;
171
+                            #endregion
172
+                            model.BeginTime = DateTime.Now;
173
+                            int i = new BLL.T_Call_CallRecords().Add(model);
174
+                            model.CallRecordsId = i;
175
+                            res = Success("加载成功", model);
176
+                        }
177
+                        catch
178
+                        {
179
+                            res = Error("加载失败");
180
+                        }
181
+                    }
182
+                }
149 183
             }
150 184
             return res;
151 185
         }
@@ -415,11 +449,11 @@ namespace CallCenterApi.Interface.Controllers.tel
415 449
                     {
416 450
                         Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
417 451
                         model.CallId = RequestString.GetFormString("callid");
418
-                        //model.UserId = ua.F_UserId;
419
-                        //model.UserCode = ua.F_UserCode;
420
-                        //model.UserName = ua.F_UserName;
421
-                        ////model.ExtNumber = ua.F_WorkNumber;
422
-                        //model.ExtNumber = CurrentUser.UserData.F_ExtensionNumber;
452
+                        model.UserId = ua.F_UserId;
453
+                        model.UserCode = ua.F_UserCode;
454
+                        model.UserName = ua.F_UserName;
455
+                        //model.ExtNumber = ua.F_WorkNumber;
456
+                        model.ExtNumber = CurrentUser.UserData.F_ExtensionNumber;
423 457
 
424 458
                         model.DealType = 5;
425 459
                         bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
@@ -514,7 +548,7 @@ namespace CallCenterApi.Interface.Controllers.tel
514 548
                 model.CallId = RequestString.GetFormString("callid");
515 549
                 model.CallState = 1;
516 550
                 model.DealType = 6;
517
-                //model.FilePath = RequestString.GetFormString("path");
551
+                model.FilePath = RequestString.GetFormString("path");
518 552
                 bool bl = new BLL.T_Call_CallRecords().UpdateCallInPathTelRecord(model);
519 553
                 if (bl)
520 554
                 {