|
|
@@ -15,80 +15,80 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
15
|
15
|
//获取留言列表
|
|
16
|
16
|
public ActionResult GetList(string strtelnum)
|
|
17
|
17
|
{
|
|
18
|
|
-
|
|
|
18
|
+
|
|
19
|
19
|
if (Request.IsAuthenticated)
|
|
20
|
20
|
{
|
|
21
|
21
|
string sql = "";
|
|
22
|
22
|
DataTable dt = new DataTable();
|
|
23
|
|
-
|
|
24
|
23
|
|
|
25
|
|
- string strsettime = HttpUtility.UrlDecode(RequestString.GetQueryString("settime"));
|
|
26
|
|
- string strremovetime = HttpUtility.UrlDecode(RequestString.GetQueryString("removetime"));
|
|
27
|
|
- string status = HttpUtility.UrlDecode(RequestString.GetQueryString("status"));
|
|
28
|
24
|
|
|
29
|
|
- string strpageindex = RequestString.GetQueryString("page");
|
|
30
|
|
- int pageindex = 1;
|
|
31
|
|
- string strpagesize = RequestString.GetQueryString("pagesize");
|
|
32
|
|
- int pagesize = 10;
|
|
|
25
|
+ string strsettime = HttpUtility.UrlDecode(RequestString.GetQueryString("settime"));
|
|
|
26
|
+ string strremovetime = HttpUtility.UrlDecode(RequestString.GetQueryString("removetime"));
|
|
|
27
|
+ string status = HttpUtility.UrlDecode(RequestString.GetQueryString("status"));
|
|
33
|
28
|
|
|
34
|
|
- if (strtelnum != null && strtelnum.Trim() != "")
|
|
35
|
|
- {
|
|
36
|
|
- sql += " and F_Phone= '" + strtelnum.Trim() + "' ";
|
|
37
|
|
- }
|
|
38
|
|
- if (strsettime.Trim() != "" && strsettime != "undefined")
|
|
39
|
|
- {
|
|
40
|
|
- sql += " and CONVERT(varchar(10),F_LeaveTime, 23) = '" + strsettime.Trim() + "' ";
|
|
41
|
|
- }
|
|
42
|
|
- if (strremovetime.Trim() != "" && strremovetime != "undefined")
|
|
43
|
|
- {
|
|
44
|
|
- sql += " and CONVERT(varchar(10),F_DealTime, 23) = '" + strremovetime.Trim() + "' ";
|
|
45
|
|
- }
|
|
46
|
|
- if (status.Trim() != "-1" && status != "undefined")
|
|
47
|
|
- {
|
|
48
|
|
- sql += " and F_Status = " + Convert.ToInt32(status);
|
|
49
|
|
- }
|
|
|
29
|
+ string strpageindex = RequestString.GetQueryString("page");
|
|
|
30
|
+ int pageindex = 1;
|
|
|
31
|
+ string strpagesize = RequestString.GetQueryString("pagesize");
|
|
|
32
|
+ int pagesize = 10;
|
|
50
|
33
|
|
|
51
|
|
- if (strpageindex.Trim() != "")
|
|
52
|
|
- {
|
|
53
|
|
- pageindex = Convert.ToInt32(strpageindex);
|
|
54
|
|
- }
|
|
|
34
|
+ if (strtelnum != null && strtelnum.Trim() != "")
|
|
|
35
|
+ {
|
|
|
36
|
+ sql += " and F_Phone= '" + strtelnum.Trim() + "' ";
|
|
|
37
|
+ }
|
|
|
38
|
+ if (strsettime.Trim() != "" && strsettime != "undefined")
|
|
|
39
|
+ {
|
|
|
40
|
+ sql += " and CONVERT(varchar(10),F_LeaveTime, 23) = '" + strsettime.Trim() + "' ";
|
|
|
41
|
+ }
|
|
|
42
|
+ if (strremovetime.Trim() != "" && strremovetime != "undefined")
|
|
|
43
|
+ {
|
|
|
44
|
+ sql += " and CONVERT(varchar(10),F_DealTime, 23) = '" + strremovetime.Trim() + "' ";
|
|
|
45
|
+ }
|
|
|
46
|
+ if (status.Trim() != "-1" && status != "undefined")
|
|
|
47
|
+ {
|
|
|
48
|
+ sql += " and F_Status = " + Convert.ToInt32(status);
|
|
|
49
|
+ }
|
|
55
|
50
|
|
|
56
|
|
- if (strpagesize.Trim() != "")
|
|
57
|
|
- {
|
|
58
|
|
- pagesize = Convert.ToInt32(strpagesize);
|
|
59
|
|
- }
|
|
60
|
|
- int recordCount = 0;
|
|
61
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
62
|
|
- "T_Call_LeaveRecord",
|
|
63
|
|
- "F_Id",
|
|
64
|
|
- "*",
|
|
65
|
|
- sql,
|
|
66
|
|
- "ORDER BY F_Id desc",
|
|
67
|
|
- pagesize,
|
|
68
|
|
- pageindex,
|
|
69
|
|
- true,
|
|
70
|
|
- out recordCount);
|
|
71
|
|
-
|
|
72
|
|
- var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
|
|
73
|
|
- foreach (DataRow dr in dt.Rows)
|
|
|
51
|
+ if (strpageindex.Trim() != "")
|
|
|
52
|
+ {
|
|
|
53
|
+ pageindex = Convert.ToInt32(strpageindex);
|
|
|
54
|
+ }
|
|
|
55
|
+
|
|
|
56
|
+ if (strpagesize.Trim() != "")
|
|
|
57
|
+ {
|
|
|
58
|
+ pagesize = Convert.ToInt32(strpagesize);
|
|
|
59
|
+ }
|
|
|
60
|
+ int recordCount = 0;
|
|
|
61
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
62
|
+ "T_Call_LeaveRecord",
|
|
|
63
|
+ "F_Id",
|
|
|
64
|
+ "*",
|
|
|
65
|
+ sql,
|
|
|
66
|
+ "ORDER BY F_Id desc",
|
|
|
67
|
+ pagesize,
|
|
|
68
|
+ pageindex,
|
|
|
69
|
+ true,
|
|
|
70
|
+ out recordCount);
|
|
|
71
|
+
|
|
|
72
|
+ var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
|
|
|
73
|
+ foreach (DataRow dr in dt.Rows)
|
|
|
74
|
+ {
|
|
|
75
|
+ string path = dr["F_RecFileUrl"] != null ? dr["F_RecFileUrl"].ToString() : "";
|
|
|
76
|
+ if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
|
|
74
|
77
|
{
|
|
75
|
|
- string path = dr["F_RecFileUrl"] != null ? dr["F_RecFileUrl"].ToString() : "";
|
|
76
|
|
- if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
|
|
77
|
|
- {
|
|
78
|
|
- dr["F_RecFileUrl"] = config.F_ParamValue + path;
|
|
79
|
|
- }
|
|
|
78
|
+ dr["F_RecFileUrl"] = config.F_ParamValue + path;
|
|
80
|
79
|
}
|
|
|
80
|
+ }
|
|
|
81
|
+
|
|
|
82
|
+ var obj = new
|
|
|
83
|
+ {
|
|
|
84
|
+ state = "success",
|
|
|
85
|
+ message = "成功",
|
|
|
86
|
+ rows = dt,
|
|
|
87
|
+ total = recordCount
|
|
|
88
|
+ };
|
|
|
89
|
+
|
|
|
90
|
+ return Content(obj.ToJson());
|
|
81
|
91
|
|
|
82
|
|
- var obj = new
|
|
83
|
|
- {
|
|
84
|
|
- state = "success",
|
|
85
|
|
- message = "成功",
|
|
86
|
|
- rows = dt,
|
|
87
|
|
- total = recordCount
|
|
88
|
|
- };
|
|
89
|
|
-
|
|
90
|
|
- return Content(obj.ToJson());
|
|
91
|
|
-
|
|
92
|
92
|
}
|
|
93
|
93
|
return NoToken("未知错误,请重新登录");
|
|
94
|
94
|
}
|
|
|
@@ -96,29 +96,29 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
96
|
96
|
//删除留言记录
|
|
97
|
97
|
public ActionResult DelLeaveRecord(string[] ids)
|
|
98
|
98
|
{
|
|
99
|
|
-
|
|
|
99
|
+
|
|
100
|
100
|
if (Request.IsAuthenticated)
|
|
101
|
101
|
{
|
|
102
|
|
-
|
|
103
|
|
- if (ids != null && ids.Length > 0)
|
|
|
102
|
+
|
|
|
103
|
+ if (ids != null && ids.Length > 0)
|
|
|
104
|
+ {
|
|
|
105
|
+ string idd = " ";
|
|
|
106
|
+ foreach (string str in ids)
|
|
104
|
107
|
{
|
|
105
|
|
- string idd = " ";
|
|
106
|
|
- foreach (string str in ids)
|
|
107
|
|
- {
|
|
108
|
|
- idd += str + ",";
|
|
109
|
|
- }
|
|
110
|
|
- if (new BLL.T_Call_LeaveRecord().DeleteList(idd.TrimEnd(',')))
|
|
111
|
|
- {
|
|
112
|
|
- return Success("删除成功");
|
|
113
|
|
- }
|
|
114
|
|
- else
|
|
115
|
|
- return Error("删除失败");
|
|
|
108
|
+ idd += str + ",";
|
|
116
|
109
|
}
|
|
117
|
|
- else
|
|
|
110
|
+ if (new BLL.T_Call_LeaveRecord().DeleteList(idd.TrimEnd(',')))
|
|
118
|
111
|
{
|
|
119
|
|
- return Error("请选择要删除的记录");
|
|
|
112
|
+ return Success("删除成功");
|
|
120
|
113
|
}
|
|
121
|
|
-
|
|
|
114
|
+ else
|
|
|
115
|
+ return Error("删除失败");
|
|
|
116
|
+ }
|
|
|
117
|
+ else
|
|
|
118
|
+ {
|
|
|
119
|
+ return Error("请选择要删除的记录");
|
|
|
120
|
+ }
|
|
|
121
|
+
|
|
122
|
122
|
}
|
|
123
|
123
|
return NoToken("未知错误,请重新登录");
|
|
124
|
124
|
}
|
|
|
@@ -126,42 +126,42 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
126
|
126
|
//更新留言处理状态
|
|
127
|
127
|
public ActionResult OptLeaveRecord(string[] ids)
|
|
128
|
128
|
{
|
|
129
|
|
-
|
|
|
129
|
+
|
|
130
|
130
|
if (Request.IsAuthenticated)
|
|
131
|
131
|
{
|
|
132
|
|
-
|
|
133
|
|
- int userId = CurrentUser.UserData.F_UserId;
|
|
134
|
|
- if (userId != 0)
|
|
|
132
|
+
|
|
|
133
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
134
|
+ if (userId != 0)
|
|
|
135
|
+ {
|
|
|
136
|
+ Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
137
|
+ if (ua != null)
|
|
135
|
138
|
{
|
|
136
|
|
- Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
137
|
|
- if (ua != null)
|
|
|
139
|
+ if (ids.Length > 0)
|
|
138
|
140
|
{
|
|
139
|
|
- if (ids.Length>0)
|
|
|
141
|
+ foreach (string arrid in ids)
|
|
140
|
142
|
{
|
|
141
|
|
- foreach (string arrid in ids)
|
|
|
143
|
+ Model.T_Call_LeaveRecord model = new BLL.T_Call_LeaveRecord().GetModel(Convert.ToInt32(arrid));
|
|
|
144
|
+ if (model != null)
|
|
142
|
145
|
{
|
|
143
|
|
- Model.T_Call_LeaveRecord model = new BLL.T_Call_LeaveRecord().GetModel(Convert.ToInt32(arrid));
|
|
144
|
|
- if (model != null)
|
|
145
|
|
- {
|
|
146
|
|
- model.F_Status = 1;
|
|
147
|
|
- model.F_DealTime = DateTime.Now;
|
|
148
|
|
- model.F_DealContent = "1";
|
|
149
|
|
- model.F_UserName = ua.F_UserName;
|
|
150
|
|
- model.F_UserCode = ua.F_UserCode;
|
|
151
|
|
- model.F_UserId = ua.F_UserId;
|
|
152
|
|
-
|
|
153
|
|
- new BLL.T_Call_LeaveRecord().Update(model);
|
|
154
|
|
- }
|
|
|
146
|
+ model.F_Status = 1;
|
|
|
147
|
+ model.F_DealTime = DateTime.Now;
|
|
|
148
|
+ model.F_DealContent = "1";
|
|
|
149
|
+ model.F_UserName = ua.F_UserName;
|
|
|
150
|
+ model.F_UserCode = ua.F_UserCode;
|
|
|
151
|
+ model.F_UserId = ua.F_UserId;
|
|
|
152
|
+
|
|
|
153
|
+ new BLL.T_Call_LeaveRecord().Update(model);
|
|
155
|
154
|
}
|
|
156
|
|
- return Success("处理成功");
|
|
157
|
|
- }
|
|
158
|
|
- else
|
|
159
|
|
- {
|
|
160
|
|
- return Error("请选择要处理的留言");
|
|
161
|
155
|
}
|
|
|
156
|
+ return Success("处理成功");
|
|
|
157
|
+ }
|
|
|
158
|
+ else
|
|
|
159
|
+ {
|
|
|
160
|
+ return Error("请选择要处理的留言");
|
|
162
|
161
|
}
|
|
163
|
162
|
}
|
|
164
|
|
-
|
|
|
163
|
+ }
|
|
|
164
|
+
|
|
165
|
165
|
}
|
|
166
|
166
|
return NoToken("未知错误,请重新登录");
|
|
167
|
167
|
}
|