|
|
@@ -24,11 +24,13 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
24
|
24
|
//return res;
|
|
25
|
25
|
string sql = "";
|
|
26
|
26
|
int roleid = 0, deptid = 0;
|
|
|
27
|
+ string currcode = string.Empty;
|
|
27
|
28
|
string deptcode = string.Empty;
|
|
28
|
29
|
DataTable dt = new DataTable();
|
|
29
|
30
|
if (Request.IsAuthenticated)
|
|
30
|
31
|
{
|
|
31
|
32
|
roleid = CurrentUser.UserData.F_RoleId;
|
|
|
33
|
+ currcode = CurrentUser.UserData.F_UserCode;
|
|
32
|
34
|
deptid = CurrentUser.UserData.F_DeptId;
|
|
33
|
35
|
deptcode = CurrentUser.UserData.F_DeptCode;
|
|
34
|
36
|
}
|
|
|
@@ -43,28 +45,43 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
43
|
45
|
string strpagesize = RequestString.GetQueryString("pagesize");
|
|
44
|
46
|
int pagesize = 10;
|
|
45
|
47
|
|
|
46
|
|
- if (roleid != 0)
|
|
|
48
|
+ //if (roleid != 0)
|
|
|
49
|
+ //{
|
|
|
50
|
+ // if (roleid != 17)
|
|
|
51
|
+ // {
|
|
|
52
|
+ // if (deptcode.IndexOf("|533|") > 0)
|
|
|
53
|
+ // {
|
|
|
54
|
+ // sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + deptid + ")";
|
|
|
55
|
+ // }
|
|
|
56
|
+ // if (deptcode.IndexOf("|531|") > 0)
|
|
|
57
|
+ // {
|
|
|
58
|
+ // if (roleid == 32)
|
|
|
59
|
+ // {
|
|
|
60
|
+ // usercode = CurrentUser.UserData.F_UserCode;
|
|
|
61
|
+ // sql += " and UserCode='" + usercode + "'";
|
|
|
62
|
+ // }
|
|
|
63
|
+ // else
|
|
|
64
|
+ // {
|
|
|
65
|
+ // 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 + "%')) ";
|
|
|
66
|
+ // }
|
|
|
67
|
+ // }
|
|
|
68
|
+ // }
|
|
|
69
|
+ //}
|
|
|
70
|
+ //20180515 坐席能看到同组的
|
|
|
71
|
+ var usergroup = new BLL.T_Sys_UserAccount().GetModel(currcode) == null ? "" : new BLL.T_Sys_UserAccount().GetModel(currcode).F_SeartGroup;
|
|
|
72
|
+ 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);
|
|
|
73
|
+ var str = "";
|
|
|
74
|
+ if (usercodes != null)
|
|
47
|
75
|
{
|
|
48
|
|
- if (roleid != 17)
|
|
|
76
|
+ foreach (var item in usercodes)
|
|
49
|
77
|
{
|
|
50
|
|
- if (deptcode.IndexOf("|533|") > 0)
|
|
51
|
|
- {
|
|
52
|
|
- sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + deptid + ")";
|
|
53
|
|
- }
|
|
54
|
|
- if (deptcode.IndexOf("|531|") > 0)
|
|
55
|
|
- {
|
|
56
|
|
- if (roleid == 32)
|
|
57
|
|
- {
|
|
58
|
|
- usercode = CurrentUser.UserData.F_UserCode;
|
|
59
|
|
- sql += " and UserCode='" + usercode + "'";
|
|
60
|
|
- }
|
|
61
|
|
- else
|
|
62
|
|
- {
|
|
63
|
|
- 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 + "%')) ";
|
|
64
|
|
- }
|
|
65
|
|
- }
|
|
|
78
|
+ str += item.ToString() + ',';
|
|
66
|
79
|
}
|
|
|
80
|
+ str = str.TrimEnd(',');
|
|
|
81
|
+ sql += " and UserCode in (" + str + ") ";
|
|
67
|
82
|
}
|
|
|
83
|
+ else
|
|
|
84
|
+ sql += " and UserCode='" + usercode + "' ";
|
|
68
|
85
|
|
|
69
|
86
|
if (usercode != null && usercode.Trim() != "")
|
|
70
|
87
|
{
|
|
|
@@ -105,26 +122,18 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
105
|
122
|
pagesize = Convert.ToInt32(strpagesize);
|
|
106
|
123
|
}
|
|
107
|
124
|
int recordCount = 0;
|
|
108
|
|
- /*dt = BLL.PagerBLL.GetListPager(
|
|
109
|
|
- "T_Call_CallRecords",
|
|
|
125
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
126
|
+ "T_Call_CallRecords left join T_Sys_UserAccount on UserCode=F_UserCode",
|
|
110
|
127
|
"CallRecordsId",
|
|
111
|
|
- "*",
|
|
|
128
|
+ "T_Call_CallRecords.*,T_Sys_UserAccount.F_SeartGroup",
|
|
112
|
129
|
sql,
|
|
113
|
130
|
"ORDER BY CallRecordsId desc",
|
|
114
|
131
|
pagesize,
|
|
115
|
132
|
pageindex,
|
|
116
|
133
|
true,
|
|
117
|
|
- out recordCount);*/
|
|
118
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
119
|
|
- "T_Call_CallRecords left join T_Sys_UserAccount ON T_Sys_UserAccount.F_UserCode=T_Call_CallRecords.UserCode left join T_Sys_Department ON T_Sys_UserAccount.F_DeptId=T_Sys_Department.F_DeptId ",
|
|
120
|
|
- "CallRecordsId",
|
|
121
|
|
- "*,T_Sys_UserAccount.F_UserName,T_Sys_Department.F_DeptName ",
|
|
122
|
|
- sql,
|
|
123
|
|
- "ORDER BY CallRecordsId desc",
|
|
124
|
|
- pagesize,
|
|
125
|
|
- pageindex,
|
|
126
|
|
- true,
|
|
127
|
|
- out recordCount);
|
|
|
134
|
+ out recordCount);
|
|
|
135
|
+
|
|
|
136
|
+ dt.Columns.Add("CusName");
|
|
128
|
137
|
|
|
129
|
138
|
var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
|
|
130
|
139
|
var users = new BLL.T_Sys_UserAccount().GetModelList("");
|
|
|
@@ -152,6 +161,8 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
152
|
161
|
dr["UserName"] = uu.F_UserName;
|
|
153
|
162
|
}
|
|
154
|
163
|
}
|
|
|
164
|
+
|
|
|
165
|
+ dr["CusName"] = new BLL.T_Cus_CustomerBase().GetModelList("F_Telephone='" + dr["CallNumber"] + "'").FirstOrDefault() == null ? "" : new BLL.T_Cus_CustomerBase().GetModelList("F_Telephone='" + dr["CallNumber"] + "'").FirstOrDefault().F_CustomerName;
|
|
155
|
166
|
}
|
|
156
|
167
|
|
|
157
|
168
|
var obj = new
|