|
|
@@ -17,24 +17,11 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
17
|
17
|
//获取通话记录列表
|
|
18
|
18
|
public ActionResult GetList(string phone, string usercode)
|
|
19
|
19
|
{
|
|
20
|
|
- //ActionResult res = NoToken("未知错误,请重新登录");
|
|
21
|
|
- //if (Request.IsAuthenticated)
|
|
22
|
|
- //{
|
|
|
20
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
21
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
23
|
22
|
|
|
24
|
|
- //}
|
|
25
|
|
- //return res;
|
|
26
|
23
|
string sql = "";
|
|
27
|
|
- int roleid = 0, deptid = 0;
|
|
28
|
|
- string currcode = string.Empty;
|
|
29
|
|
- string deptcode = string.Empty;
|
|
30
|
|
- DataTable dt = new DataTable();
|
|
31
|
|
- if (Request.IsAuthenticated)
|
|
32
|
|
- {
|
|
33
|
|
- roleid = CurrentUser.UserData.F_RoleId;
|
|
34
|
|
- currcode = CurrentUser.UserData.F_UserCode;
|
|
35
|
|
- deptid = CurrentUser.UserData.F_DeptId;
|
|
36
|
|
- deptcode = CurrentUser.UserData.F_DeptCode;
|
|
37
|
|
- }
|
|
|
24
|
+
|
|
38
|
25
|
string callstate = HttpUtility.UrlDecode(RequestString.GetQueryString("callstate"));
|
|
39
|
26
|
string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
|
|
40
|
27
|
string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
|
|
|
@@ -47,73 +34,10 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
47
|
34
|
string strpagesize = RequestString.GetQueryString("pagesize");
|
|
48
|
35
|
int pagesize = 10;
|
|
49
|
36
|
|
|
50
|
|
- //if (roleid != 0)
|
|
51
|
|
- //{
|
|
52
|
|
- // if (roleid != 17)
|
|
53
|
|
- // {
|
|
54
|
|
- // if (deptcode.IndexOf("|533|") > 0)
|
|
55
|
|
- // {
|
|
56
|
|
- // sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + deptid + ")";
|
|
57
|
|
- // }
|
|
58
|
|
- // if (deptcode.IndexOf("|531|") > 0)
|
|
59
|
|
- // {
|
|
60
|
|
- // if (roleid == 32)
|
|
61
|
|
- // {
|
|
62
|
|
- // usercode = CurrentUser.UserData.F_UserCode;
|
|
63
|
|
- // sql += " and UserCode='" + usercode + "'";
|
|
64
|
|
- // }
|
|
65
|
|
- // else
|
|
66
|
|
- // {
|
|
67
|
|
- // sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptID in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%')) ";
|
|
68
|
|
- // }
|
|
69
|
|
- // }
|
|
70
|
|
- // }
|
|
71
|
|
- //}
|
|
72
|
|
- ////20180515 坐席能看到同组的
|
|
73
|
|
- //var usergroup = new BLL.T_Sys_UserAccount().GetModel(currcode) == null ? "" : new BLL.T_Sys_UserAccount().GetModel(currcode).F_SeartGroup;
|
|
74
|
|
- //var usercodes = new BLL.T_Sys_UserAccount().GetModelList("F_SeartGroup='" + usergroup + "'") == null ? null : new BLL.T_Sys_UserAccount().GetModelList("F_SeartGroup='" + usergroup + "'").Select(p => p.F_UserCode);
|
|
75
|
|
- //var str = "";
|
|
76
|
|
- //if (usercodes != null)
|
|
77
|
|
- //{
|
|
78
|
|
- // foreach (var item in usercodes)
|
|
79
|
|
- // {
|
|
80
|
|
- // str += item.ToString() + ',';
|
|
81
|
|
- // }
|
|
82
|
|
- // str = str.TrimEnd(',');
|
|
83
|
|
- // sql += " and UserCode in (" + str + ") ";
|
|
84
|
|
- //}
|
|
85
|
|
- //else
|
|
86
|
|
- // sql += " and UserCode='" + usercode + "' ";
|
|
87
|
|
- #region 2018-05-30 lihai 坐席能看到同组的通话记录
|
|
88
|
|
- int seartGroupId = 0;
|
|
89
|
|
- var modelUser = new BLL.T_Sys_UserAccount().GetModel(currcode);
|
|
90
|
|
- if (modelUser != null)
|
|
91
|
|
- seartGroupId = modelUser.F_SeartGroupID ?? 0;
|
|
92
|
|
- if (seartGroupId != 0)
|
|
|
37
|
+ if (!string.IsNullOrEmpty(userModel.groupcode))
|
|
93
|
38
|
{
|
|
94
|
|
- //groupcode判断是市场部或客服部的通话记录
|
|
95
|
|
- var modelSeartGroup = new BLL.T_Sys_SeatGroup().GetModel(seartGroupId);
|
|
96
|
|
- if (modelSeartGroup != null)
|
|
97
|
|
- {
|
|
98
|
|
- sql += " and groupcode = '" + modelSeartGroup.F_ZXZCode + "' ";
|
|
99
|
|
- //if (modelSeartGroup.F_ZXZCode == "SCZ")
|
|
100
|
|
- //{
|
|
101
|
|
- // sql += " and groupcode = 'SCZ' ";
|
|
102
|
|
- //}
|
|
103
|
|
- //else
|
|
104
|
|
- //{
|
|
105
|
|
- // sql += " and groupcode = 'KFZ' ";
|
|
106
|
|
- //}
|
|
107
|
|
- }
|
|
108
|
|
- //else
|
|
109
|
|
- // sql += " and UserCode='" + usercode + "' ";
|
|
|
39
|
+ sql += " and groupcode = '" + userModel.groupcode + "' ";
|
|
110
|
40
|
}
|
|
111
|
|
- //else
|
|
112
|
|
- //{
|
|
113
|
|
- // //找不到对应坐席组
|
|
114
|
|
- // sql += " and UserCode='" + usercode + "' ";
|
|
115
|
|
- //}
|
|
116
|
|
- #endregion
|
|
117
|
41
|
|
|
118
|
42
|
if (usercode != null && usercode.Trim() != "")
|
|
119
|
43
|
{
|
|
|
@@ -121,7 +45,7 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
121
|
45
|
}
|
|
122
|
46
|
if (dept != null && dept.Trim() != "")
|
|
123
|
47
|
{
|
|
124
|
|
- sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + dept.Trim() + ")";
|
|
|
48
|
+ sql += " and F_DeptId='" + dept.Trim() + "'";
|
|
125
|
49
|
}
|
|
126
|
50
|
if (dealtype != null && dealtype.Trim() != "")
|
|
127
|
51
|
{
|
|
|
@@ -159,10 +83,10 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
159
|
83
|
pagesize = Convert.ToInt32(strpagesize);
|
|
160
|
84
|
}
|
|
161
|
85
|
int recordCount = 0;
|
|
162
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
163
|
|
- "T_Call_CallRecords left join T_Sys_UserAccount on UserCode=F_UserCode",
|
|
|
86
|
+ DataTable dt = BLL.PagerBLL.GetListPager(
|
|
|
87
|
+ "T_Call_CallRecords left join T_Sys_UserAccount on UserCode=F_UserCode ",
|
|
164
|
88
|
"CallRecordsId",
|
|
165
|
|
- "T_Call_CallRecords.*,T_Sys_UserAccount.F_SeartGroup",
|
|
|
89
|
+ "T_Call_CallRecords.*,T_Sys_UserAccount.F_UserName as UserName,T_Sys_UserAccount.F_SeartGroup,T_Sys_UserAccount.F_DeptId",
|
|
166
|
90
|
sql,
|
|
167
|
91
|
"ORDER BY CallRecordsId desc",
|
|
168
|
92
|
pagesize,
|
|
|
@@ -188,24 +112,6 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
188
|
112
|
}
|
|
189
|
113
|
dr["FilePath"] = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
|
|
190
|
114
|
}
|
|
191
|
|
- string ucode = dr["UserCode"] != null ? dr["UserCode"].ToString() : "";
|
|
192
|
|
- string uname = dr["UserName"] != null ? dr["UserName"].ToString() : "";
|
|
193
|
|
- if (ucode != "")
|
|
194
|
|
- {
|
|
195
|
|
- if (uname == "")
|
|
196
|
|
- {
|
|
197
|
|
- var uu = users.Where(u => u.F_UserCode.Equals(ucode)).FirstOrDefault();
|
|
198
|
|
- if (uu != null)
|
|
199
|
|
- dr["UserName"] = uu.F_UserName;
|
|
200
|
|
- }
|
|
201
|
|
- }
|
|
202
|
|
- var modelCustomer = listCustomer.FirstOrDefault(x => x.F_Telephone == dr["CallNumber"].ToString());
|
|
203
|
|
- if (modelCustomer != null)
|
|
204
|
|
- {
|
|
205
|
|
- dr["CusName"] = modelCustomer.F_CustomerName; //客户姓名
|
|
206
|
|
- dr["CusDepName"] = modelCustomer.F_CustomerIndustry; //来电单位
|
|
207
|
|
- }
|
|
208
|
|
- //dr["CusName"] = new BLL.T_Cus_CustomerBase().GetModelList("F_Telephone='" + dr["CallNumber"] + "' and F_DeleteFlag=0").FirstOrDefault() == null ? "" : new BLL.T_Cus_CustomerBase().GetModelList("F_Telephone='" + dr["CallNumber"] + "'").FirstOrDefault().F_CustomerName;
|
|
209
|
115
|
}
|
|
210
|
116
|
|
|
211
|
117
|
var obj = new
|