|
|
@@ -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为分机号或特殊号码
|