duhongyu 5 anni fa
parent
commit
eeeb05da33

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/FilterConfig.cs

@@ -7,7 +7,7 @@ namespace CallCenterApi.Interface
7 7
     {
8 8
         public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 9
         {
10
-            filters.Add(new SqlErrorAttribute());
10
+           // filters.Add(new SqlErrorAttribute());
11 11
             filters.Add(new ErrorAttribute());
12 12
         }
13 13
     }

+ 3 - 140
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/SqlErrorAttribute.cs

@@ -190,150 +190,13 @@ namespace CallCenterApi.Interface.App_Start
190 190
             //1:检测用户是否禁用
191 191
             var u = new BLL.T_Sys_UserAccount().GetModel(userId);
192 192
             //1-禁用 0-启用
193
-            if (u.F_DeleteFlag == 1)
193
+            if (u ==null )
194 194
             {
195 195
                 a = 1;
196 196
             }
197
-            else
197
+           else  if (u.F_DeleteFlag == 1)
198 198
             {
199
-                //2:检测当前操作页面是否具有权限
200
-                //当前登陆页面路径
201
-                string url = RequestString.GetUrlReferrer().ToString();
202
-                string url1 = RequestString.GetUrl();
203
-                string url2 = RequestString.GetCurrentFullHost();
204
-                string url3 = RequestString.GetRawUrl();
205
-                string url4 = RequestString.GetFilename(url);
206
-
207
-
208
-                //添加额外页面权限
209
-                if (url4 == "Editor.html" || url4 == "WorkOrderDetail.html" || url4 == "PrintPreview.html" || url4 == "PrintPreview.html" || url4 == "WorkOrderEdit.html")
210
-                {
211
-
212
-                    a = 0;
213
-                }
214
-                else
215
-                {
216
-
217
-
218
-                    //接口操作方法
219
-                    string url5 = "";
220
-                    if (url3 == null || url3 == "")
221
-                    {
222
-                        url5 = "";
223
-                    }
224
-                    else
225
-                    {
226
-                        int temp = url3.IndexOf("?");
227
-                        if (temp > 0)
228
-                        {
229
-                            url5 = url3.Substring(0, temp);
230
-                        }
231
-                        else
232
-                        {
233
-                            url5 = url3;
234
-                        }
235
-
236
-                    }
237
-                    if (url5 == "/UserAccount/GetList")
238
-                    {
239
-                        int qqq = 0;
240
-                    }
241
-
242
-                    // GetFilename
243
-
244
-                    //GetCurrentFullHost
245
-                    //GetRawUrl
246
-
247
-                    //首页 widgets.html
248
-                    //登陆页  过滤掉  index.html
249
-                    if (url4 != "widgets.html" && url4 != "index.html")
250
-                    {
251
-
252
-                        //根据当前登陆页 判断 导航id 之后只查找此导航内的接口权限
253
-                        //字符串.Replace(源子串,替换为);
254
-                        //string url6 = url.Replace(url2, "");
255
-                        int functionid = 0;
256
-                        if (url4.Length > 0 && url4 != "PrintPreview.html")
257
-                        {
258
-                            functionid = PageFuoction(url4);
259
-                        }
260
-
261
-
262
-
263
-                        StringBuilder strSql = new StringBuilder();
264
-                        strSql.Append(@"  select   f.F_OptUrl,f.F_FunctionId
265
-   from dbo.T_Sys_RoleFunction rf 
266
-   left join T_Sys_Function  f on   rf.F_FunctionId=f.F_FunctionId 
267
-     ");
268
-                        strSql.Append(" where    F_RoleId= " + roleId);
269
-                        if (functionid > 0)
270
-                        {
271
-                            strSql.Append(" and f.F_FunctionId=" + functionid);
272
-                        }
273
-                        else if (url4 == "PrintPreview.html")
274
-                        {
275
-                            strSql.Append(@" and f.F_FunctionId in (select F_FunctionId from dbo.T_Sys_Function 
276
-      where  F_OptUrl like '%" + url4 + "%')");
277
-                        }
278
-                        strSql.Append("  group by f.F_OptUrl ,f.F_FunctionId");
279
-
280
-                        var ds = DbHelperSQL.Query(strSql.ToString());
281
-                        DataTable dt = new DataTable();
282
-                        dt = ds.Tables[0];
283
-                        //行
284
-                        for (int i = 0; i < dt.Rows.Count; i++)
285
-                        {
286
-                            //列
287
-                            for (int j = 0; j < dt.Columns.Count; j++)
288
-                            {
289
-                                //用户所具有权限的页面
290
-                                string f1 = dt.Rows[i][0].ToString();
291
-                                string f2 = RequestString.GetFilename(f1);
292
-                                int f12 = Convert.ToInt32(dt.Rows[i][1].ToString() == "" ? "0" : dt.Rows[i][1].ToString());
293
-                                if (f2 == url4)
294
-                                {
295
-                                    b++;
296
-                                    break;
297
-                                }
298
-                                int tqw = getItemBYUrl(url5, Convert.ToInt32(roleId));
299
-                                if (tqw == 0)
300
-                                {
301
-                                    throw new Exception("操作失败,无权限");
302
-                                }
303
-                                //if (f12>0) {
304
-                                //    if (f12==19) {
305
-                                //        int qw1 = 1;
306
-                                //    }
307
-                                //   int qw= getItemUrl(f12, url5,Convert.ToInt32( roleId));
308
-                                //    if (qw == 0)
309
-                                //    {
310
-                                //        throw new Exception("操作失败,无权限");
311
-                                //    }
312
-
313
-
314
-                                //}
315
-
316
-                                //当前用户登陆的页面url
317
-
318
-
319
-                            }
320
-                        }
321
-                    }
322
-                    else
323
-                    {
324
-                        b = 1;
325
-                    }
326
-                    //此页面有权限
327
-                    if (b > 0)
328
-                    {
329
-                        a = 0;
330
-                    }
331
-                    if (b == 0)
332
-                    {
333
-                        a = 1;
334
-                    }
335
-
336
-                }
199
+                a = 1;
337 200
             }
338 201
             #region MyRegion
339 202
             // return ds;

+ 4 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -15,7 +15,7 @@ using System.Web.Mvc;
15 15
 
16 16
 namespace CallCenterApi.Interface.Controllers.workorder
17 17
 {
18
-    [SqlError]
18
+  //  [SqlError]
19 19
     public class WorkOrderController : BaseController
20 20
     {
21 21
         // GET: WorkOrder
@@ -2261,8 +2261,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
2261 2261
             }
2262 2262
             else
2263 2263
             {
2264
-                sql += " and (F_WorkState in (2,4,8)" + sqlwhere   + "or  (( isnull(F_DealTime,'')<>'' and F_LimitTime<F_DealTime) or ( isnull(F_DealTime,'')='' and F_LimitTime<F_CloseTime) ) " + sqlwhere1+ "and F_WorkState =9)";
2265
-
2264
+                sql += " and F_WorkState in (2,4,8) ";
2265
+                sql += " and (F_WorkState in (2,4,8)" + sqlwhere   + "or  (( isnull(F_DealTime,'')<>'' and F_LimitTime<F_DealTime) or ( isnull(F_DealTime,'')='' and F_LimitTime<F_CloseTime) ) " + sqlwhere1+ ")";
2266
+               
2266 2267
             }
2267 2268
             if (strworkid.Trim() != "" && strworkid != "undefined")
2268 2269
             {