|
|
@@ -18,61 +18,61 @@ namespace CallCenterApi.Interface.Controllers.quality
|
|
18
|
18
|
string sql = "";
|
|
19
|
19
|
DataTable dt = new DataTable();
|
|
20
|
20
|
|
|
21
|
|
- string categoryid = RequestString.GetQueryString("categoryid");
|
|
22
|
|
- string key = WebHelper.UrlDecode(RequestString.GetQueryString("key"));
|
|
|
21
|
+ string categoryid = RequestString.GetQueryString("categoryid");
|
|
|
22
|
+ string key = WebHelper.UrlDecode(RequestString.GetQueryString("key"));
|
|
23
|
23
|
|
|
24
|
|
- string strpageindex = RequestString.GetQueryString("page");
|
|
25
|
|
- int pageindex = 1;
|
|
26
|
|
- string strpagesize = RequestString.GetQueryString("pagesize");
|
|
27
|
|
- int pagesize = 10;
|
|
28
|
|
- if (categoryid.Trim() != "")
|
|
29
|
|
- {
|
|
30
|
|
- sql += " and (F_CategoryId=" + categoryid + " or F_CategoryId in (select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + categoryid + " )) ";
|
|
31
|
|
- }
|
|
|
24
|
+ string strpageindex = RequestString.GetQueryString("page");
|
|
|
25
|
+ int pageindex = 1;
|
|
|
26
|
+ string strpagesize = RequestString.GetQueryString("pagesize");
|
|
|
27
|
+ int pagesize = 10;
|
|
|
28
|
+ if (categoryid.Trim() != "")
|
|
|
29
|
+ {
|
|
|
30
|
+ sql += " and (F_CategoryId=" + categoryid + " or F_CategoryId in (select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + categoryid + " )) ";
|
|
|
31
|
+ }
|
|
32
|
32
|
|
|
33
|
|
- if (key.Trim() != "")
|
|
34
|
|
- {
|
|
35
|
|
- sql += " and (F_Title like '%" + key.Trim() + "%' or F_Content like '%" + key.Trim() + "%') ";
|
|
36
|
|
- }
|
|
37
|
|
- if (strpageindex.Trim() != "")
|
|
38
|
|
- {
|
|
39
|
|
- pageindex = Convert.ToInt32(strpageindex);
|
|
40
|
|
- }
|
|
|
33
|
+ if (key.Trim() != "")
|
|
|
34
|
+ {
|
|
|
35
|
+ sql += " and (F_Title like '%" + key.Trim() + "%' or F_Content like '%" + key.Trim() + "%') ";
|
|
|
36
|
+ }
|
|
|
37
|
+ if (strpageindex.Trim() != "")
|
|
|
38
|
+ {
|
|
|
39
|
+ pageindex = Convert.ToInt32(strpageindex);
|
|
|
40
|
+ }
|
|
41
|
41
|
|
|
42
|
|
- if (strpagesize.Trim() != "")
|
|
43
|
|
- {
|
|
44
|
|
- pagesize = Convert.ToInt32(strpagesize);
|
|
45
|
|
- }
|
|
46
|
|
- int recordCount = 0;
|
|
47
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
48
|
|
- "vw_QC_IndexBase",
|
|
49
|
|
- "F_IndexId",
|
|
50
|
|
- "*",
|
|
51
|
|
- " and F_DeleteFlag=0 " + sql,
|
|
52
|
|
- "ORDER BY F_Sort",
|
|
53
|
|
- pagesize,
|
|
54
|
|
- pageindex,
|
|
55
|
|
- true,
|
|
56
|
|
- out recordCount);
|
|
|
42
|
+ if (strpagesize.Trim() != "")
|
|
|
43
|
+ {
|
|
|
44
|
+ pagesize = Convert.ToInt32(strpagesize);
|
|
|
45
|
+ }
|
|
|
46
|
+ int recordCount = 0;
|
|
|
47
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
48
|
+ "vw_QC_IndexBase",
|
|
|
49
|
+ "F_IndexId",
|
|
|
50
|
+ "*",
|
|
|
51
|
+ " and F_DeleteFlag=0 " + sql,
|
|
|
52
|
+ "ORDER BY F_Sort",
|
|
|
53
|
+ pagesize,
|
|
|
54
|
+ pageindex,
|
|
|
55
|
+ true,
|
|
|
56
|
+ out recordCount);
|
|
57
|
57
|
|
|
58
|
|
- var obj = new
|
|
59
|
|
- {
|
|
60
|
|
- rows = dt,
|
|
61
|
|
- total = recordCount
|
|
62
|
|
- };
|
|
|
58
|
+ var obj = new
|
|
|
59
|
+ {
|
|
|
60
|
+ rows = dt,
|
|
|
61
|
+ total = recordCount
|
|
|
62
|
+ };
|
|
63
|
63
|
|
|
64
|
|
- res = Content(obj.ToJson());
|
|
|
64
|
+ res = Content(obj.ToJson());
|
|
65
|
65
|
|
|
66
|
|
- //System.Collections.Generic.List<Model.T_QC_IndexBase> modelList = new BLL.T_QC_IndexBase().DataTableToList(dt);
|
|
|
66
|
+ //System.Collections.Generic.List<Model.T_QC_IndexBase> modelList = new BLL.T_QC_IndexBase().DataTableToList(dt);
|
|
67
|
67
|
|
|
68
|
|
- //if (modelList.Count > 0)
|
|
69
|
|
- //{
|
|
70
|
|
- // res = Success("指标列表加载成功", modelList);
|
|
71
|
|
- //}
|
|
72
|
|
- //else
|
|
73
|
|
- //{
|
|
74
|
|
- // res = Error("指标列表加载失败");
|
|
75
|
|
- //}
|
|
|
68
|
+ //if (modelList.Count > 0)
|
|
|
69
|
+ //{
|
|
|
70
|
+ // res = Success("指标列表加载成功", modelList);
|
|
|
71
|
+ //}
|
|
|
72
|
+ //else
|
|
|
73
|
+ //{
|
|
|
74
|
+ // res = Error("指标列表加载失败");
|
|
|
75
|
+ //}
|
|
76
|
76
|
|
|
77
|
77
|
return res;
|
|
78
|
78
|
}
|
|
|
@@ -81,71 +81,71 @@ namespace CallCenterApi.Interface.Controllers.quality
|
|
81
|
81
|
public ActionResult GetIndexBase(string id)
|
|
82
|
82
|
{
|
|
83
|
83
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
84
|
|
-
|
|
85
|
|
- if (id.Trim() != "")
|
|
|
84
|
+
|
|
|
85
|
+ if (id.Trim() != "")
|
|
|
86
|
+ {
|
|
|
87
|
+ BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
|
|
|
88
|
+ Model.T_QC_IndexBase dModel = dBLL.GetModel(int.Parse(id.Trim()));
|
|
|
89
|
+ if (dModel != null)
|
|
86
|
90
|
{
|
|
87
|
|
- BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
|
|
88
|
|
- Model.T_QC_IndexBase dModel = dBLL.GetModel(int.Parse(id.Trim()));
|
|
89
|
|
- if (dModel != null)
|
|
90
|
|
- {
|
|
91
|
|
- res = Success("获取指标成功", dModel);
|
|
92
|
|
- }
|
|
93
|
|
- else
|
|
94
|
|
- {
|
|
95
|
|
- res = Error("获取指标失败");
|
|
96
|
|
- }
|
|
|
91
|
+ res = Success("获取指标成功", dModel);
|
|
97
|
92
|
}
|
|
98
|
93
|
else
|
|
99
|
94
|
{
|
|
100
|
|
- res = Error("获取参数失败");
|
|
|
95
|
+ res = Error("获取指标失败");
|
|
101
|
96
|
}
|
|
|
97
|
+ }
|
|
|
98
|
+ else
|
|
|
99
|
+ {
|
|
|
100
|
+ res = Error("获取参数失败");
|
|
|
101
|
+ }
|
|
102
|
102
|
|
|
103
|
103
|
return res;
|
|
104
|
104
|
}
|
|
105
|
105
|
|
|
106
|
106
|
//添加指标
|
|
107
|
|
- public ActionResult AddIndexBase(string cid, string score, string sort, string title,string remark)
|
|
|
107
|
+ public ActionResult AddIndexBase(string cid, string score, string sort, string title, string remark)
|
|
108
|
108
|
{
|
|
109
|
109
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
110
|
110
|
if (Request.IsAuthenticated)
|
|
111
|
111
|
{
|
|
112
|
|
-
|
|
113
|
|
- Model.T_QC_IndexBase dModel = new Model.T_QC_IndexBase();
|
|
114
|
112
|
|
|
115
|
|
- if (!string.IsNullOrWhiteSpace(cid.Trim()))
|
|
116
|
|
- {
|
|
117
|
|
- dModel.F_CategoryId = int.Parse(cid.Trim());
|
|
118
|
|
- }
|
|
119
|
|
- if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
120
|
|
- {
|
|
121
|
|
- dModel.F_Sort = Convert.ToInt32(sort.Trim());
|
|
122
|
|
- }
|
|
123
|
|
- if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
124
|
|
- {
|
|
125
|
|
- dModel.F_Score = Convert.ToInt32(sort.Trim());
|
|
126
|
|
- }
|
|
127
|
|
- if (!string.IsNullOrWhiteSpace(title.Trim()))
|
|
128
|
|
- {
|
|
129
|
|
- dModel.F_Title = WebHelper.UrlDecode(title.Trim());
|
|
130
|
|
- }
|
|
131
|
|
- if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
132
|
|
- {
|
|
133
|
|
- dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
|
|
134
|
|
- }
|
|
|
113
|
+ Model.T_QC_IndexBase dModel = new Model.T_QC_IndexBase();
|
|
|
114
|
+
|
|
|
115
|
+ if (!string.IsNullOrWhiteSpace(cid.Trim()))
|
|
|
116
|
+ {
|
|
|
117
|
+ dModel.F_CategoryId = int.Parse(cid.Trim());
|
|
|
118
|
+ }
|
|
|
119
|
+ if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
|
120
|
+ {
|
|
|
121
|
+ dModel.F_Sort = Convert.ToInt32(sort.Trim());
|
|
|
122
|
+ }
|
|
|
123
|
+ if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
|
124
|
+ {
|
|
|
125
|
+ dModel.F_Score = Convert.ToInt32(score.Trim());
|
|
|
126
|
+ }
|
|
|
127
|
+ if (!string.IsNullOrWhiteSpace(title.Trim()))
|
|
|
128
|
+ {
|
|
|
129
|
+ dModel.F_Title = WebHelper.UrlDecode(title.Trim());
|
|
|
130
|
+ }
|
|
|
131
|
+ if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
|
132
|
+ {
|
|
|
133
|
+ dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
|
|
|
134
|
+ }
|
|
135
|
135
|
|
|
136
|
|
- dModel.F_CreateOn = DateTime.Now;
|
|
137
|
|
- dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
|
|
138
|
|
- dModel.F_DeleteFlag = 0;
|
|
|
136
|
+ dModel.F_CreateOn = DateTime.Now;
|
|
|
137
|
+ dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
|
|
|
138
|
+ dModel.F_DeleteFlag = 0;
|
|
139
|
139
|
|
|
140
|
|
- bool b = new BLL.T_QC_IndexBase().Add(dModel) > 0;
|
|
141
|
|
- if (b)
|
|
142
|
|
- {
|
|
143
|
|
- res = Success("添加成功");
|
|
144
|
|
- }
|
|
145
|
|
- else
|
|
146
|
|
- {
|
|
147
|
|
- res = Success("添加失败");
|
|
148
|
|
- }
|
|
|
140
|
+ bool b = new BLL.T_QC_IndexBase().Add(dModel) > 0;
|
|
|
141
|
+ if (b)
|
|
|
142
|
+ {
|
|
|
143
|
+ res = Success("添加成功");
|
|
|
144
|
+ }
|
|
|
145
|
+ else
|
|
|
146
|
+ {
|
|
|
147
|
+ res = Success("添加失败");
|
|
|
148
|
+ }
|
|
149
|
149
|
|
|
150
|
150
|
}
|
|
151
|
151
|
return res;
|
|
|
@@ -157,79 +157,79 @@ namespace CallCenterApi.Interface.Controllers.quality
|
|
157
|
157
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
158
|
158
|
if (Request.IsAuthenticated)
|
|
159
|
159
|
{
|
|
160
|
|
-
|
|
161
|
|
- if (cid.Trim() != "")
|
|
|
160
|
+
|
|
|
161
|
+ if (cid.Trim() != "")
|
|
|
162
|
+ {
|
|
|
163
|
+ BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
|
|
|
164
|
+ Model.T_QC_IndexBase dModel = dBLL.GetModel(int.Parse(id.Trim()));
|
|
|
165
|
+ if (dModel != null)
|
|
162
|
166
|
{
|
|
163
|
|
- BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
|
|
164
|
|
- Model.T_QC_IndexBase dModel = dBLL.GetModel(int.Parse(id.Trim()));
|
|
165
|
|
- if (dModel != null)
|
|
|
167
|
+ if (!string.IsNullOrWhiteSpace(cid.Trim()))
|
|
|
168
|
+ {
|
|
|
169
|
+ dModel.F_CategoryId = int.Parse(cid.Trim());
|
|
|
170
|
+ }
|
|
|
171
|
+ if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
|
172
|
+ {
|
|
|
173
|
+ dModel.F_Sort = Convert.ToInt32(sort.Trim());
|
|
|
174
|
+ }
|
|
|
175
|
+ if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
166
|
176
|
{
|
|
167
|
|
- if (!string.IsNullOrWhiteSpace(cid.Trim()))
|
|
168
|
|
- {
|
|
169
|
|
- dModel.F_CategoryId = int.Parse(cid.Trim());
|
|
170
|
|
- }
|
|
171
|
|
- if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
172
|
|
- {
|
|
173
|
|
- dModel.F_Sort = Convert.ToInt32(sort.Trim());
|
|
174
|
|
- }
|
|
175
|
|
- if (!string.IsNullOrWhiteSpace(sort.Trim()))
|
|
176
|
|
- {
|
|
177
|
|
- dModel.F_Score = Convert.ToInt32(sort.Trim());
|
|
178
|
|
- }
|
|
179
|
|
- if (!string.IsNullOrWhiteSpace(title.Trim()))
|
|
180
|
|
- {
|
|
181
|
|
- dModel.F_Title = WebHelper.UrlDecode(title.Trim());
|
|
182
|
|
- }
|
|
183
|
|
- if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
184
|
|
- {
|
|
185
|
|
- dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
|
|
186
|
|
- }
|
|
187
|
|
- bool b = dBLL.Update(dModel);
|
|
188
|
|
- if (b)
|
|
189
|
|
- {
|
|
190
|
|
- res = Success("编辑成功");
|
|
191
|
|
- }
|
|
192
|
|
- else
|
|
193
|
|
- {
|
|
194
|
|
- res = Success("编辑失败");
|
|
195
|
|
- }
|
|
|
177
|
+ dModel.F_Score = Convert.ToInt32(score.Trim());
|
|
|
178
|
+ }
|
|
|
179
|
+ if (!string.IsNullOrWhiteSpace(title.Trim()))
|
|
|
180
|
+ {
|
|
|
181
|
+ dModel.F_Title = WebHelper.UrlDecode(title.Trim());
|
|
|
182
|
+ }
|
|
|
183
|
+ if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
|
184
|
+ {
|
|
|
185
|
+ dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
|
|
|
186
|
+ }
|
|
|
187
|
+ bool b = dBLL.Update(dModel);
|
|
|
188
|
+ if (b)
|
|
|
189
|
+ {
|
|
|
190
|
+ res = Success("编辑成功");
|
|
196
|
191
|
}
|
|
197
|
192
|
else
|
|
198
|
|
- res = Error("获取信息失败");
|
|
|
193
|
+ {
|
|
|
194
|
+ res = Success("编辑失败");
|
|
|
195
|
+ }
|
|
199
|
196
|
}
|
|
200
|
197
|
else
|
|
201
|
|
- {
|
|
202
|
|
- res = Error("请选择要编辑的指标");
|
|
203
|
|
- }
|
|
204
|
|
-
|
|
|
198
|
+ res = Error("获取信息失败");
|
|
|
199
|
+ }
|
|
|
200
|
+ else
|
|
|
201
|
+ {
|
|
|
202
|
+ res = Error("请选择要编辑的指标");
|
|
|
203
|
+ }
|
|
|
204
|
+
|
|
205
|
205
|
}
|
|
206
|
206
|
return res;
|
|
207
|
207
|
}
|
|
208
|
208
|
|
|
209
|
209
|
//删除指标记录
|
|
210
|
|
- public ActionResult DelIndexBase(string id,string cid)
|
|
|
210
|
+ public ActionResult DelIndexBase(string id, string cid)
|
|
211
|
211
|
{
|
|
212
|
212
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
213
|
213
|
DataTable dt = new DataTable();
|
|
214
|
|
-
|
|
215
|
|
- if (!string.IsNullOrEmpty(id.Trim()))
|
|
216
|
|
- {
|
|
217
|
|
- if (new BLL.T_QC_IndexBase().Delete(Convert.ToInt32(id)))
|
|
218
|
|
- {
|
|
219
|
|
- SetScoreByCategory(cid);
|
|
220
|
|
- res = Success("删除成功");
|
|
221
|
|
- }
|
|
222
|
|
- else
|
|
223
|
|
- {
|
|
224
|
|
- res = Error("删除失败");
|
|
225
|
|
- }
|
|
226
|
214
|
|
|
|
215
|
+ if (!string.IsNullOrEmpty(id.Trim()))
|
|
|
216
|
+ {
|
|
|
217
|
+ if (new BLL.T_QC_IndexBase().Delete(Convert.ToInt32(id)))
|
|
|
218
|
+ {
|
|
|
219
|
+ SetScoreByCategory(cid);
|
|
|
220
|
+ res = Success("删除成功");
|
|
227
|
221
|
}
|
|
228
|
222
|
else
|
|
229
|
223
|
{
|
|
230
|
|
- res = Error("请选择要删除的记录");
|
|
|
224
|
+ res = Error("删除失败");
|
|
231
|
225
|
}
|
|
232
|
226
|
|
|
|
227
|
+ }
|
|
|
228
|
+ else
|
|
|
229
|
+ {
|
|
|
230
|
+ res = Error("请选择要删除的记录");
|
|
|
231
|
+ }
|
|
|
232
|
+
|
|
233
|
233
|
return res;
|
|
234
|
234
|
}
|
|
235
|
235
|
|