Pārlūkot izejas kodu

禅道bug调整提交

zhengbingbing 5 gadi atpakaļ
vecāks
revīzija
c5fa97405b

+ 83 - 73
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs

@@ -97,28 +97,30 @@ namespace CallCenterApi.Interface.Controllers
97 97
         public ActionResult AddDic(DictionaryBaseInput input)
98 98
         {
99 99
             if (Request.IsAuthenticated)
100
-            {
101
-                int userId = CurrentUser.UserData.F_UserId;
102
-                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
100
+                return NoToken("未知错误,请重新登录");
101
+            if (string.IsNullOrEmpty(input.DicFlag))
102
+                return Error("字典标识不允许为空!");
103
+            if (string.IsNullOrEmpty(input.Name))
104
+                return Error("字典分类不允许为空!");
105
+            int userId = CurrentUser.UserData.F_UserId;
106
+            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
103 107
 
104
-                Model.T_Sys_DictionaryBase orderModel = new Model.T_Sys_DictionaryBase();
105
-                BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
106
-                var list = orderBll.GetList(" F_DictionaryFlag='" + input.DicFlag.Trim() + "' and F_GroupCode='" + userModel.groupcode + "'").Tables[0];
107
-                if (list.Rows.Count >0)
108
-                    return Error("字典标志已存在");
109
-                orderModel.F_DictionaryFlag = input.DicFlag;
110
-                orderModel.F_DictionaryName = input.Name;
111
-                orderModel.F_Describe = input.Remark;
112
-                orderModel.F_State = true;
113
-                orderModel.F_Sort = input.Sort;
114
-                orderModel.F_GroupCode = userModel.groupcode;
108
+            Model.T_Sys_DictionaryBase orderModel = new Model.T_Sys_DictionaryBase();
109
+            BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
110
+            var list = orderBll.GetList(" F_DictionaryFlag='" + input.DicFlag.Trim() + "' and F_GroupCode='" + userModel.groupcode + "'").Tables[0];
111
+            if (list.Rows.Count > 0)
112
+                return Error("字典标志已存在");
113
+            orderModel.F_DictionaryFlag = input.DicFlag;
114
+            orderModel.F_DictionaryName = input.Name;
115
+            orderModel.F_Describe = input.Remark;
116
+            orderModel.F_State = true;
117
+            orderModel.F_Sort = input.Sort;
118
+            orderModel.F_GroupCode = userModel.groupcode;
115 119
 
116
-                if (orderBll.Add(orderModel)>0)
117
-                    return Success("字典添加成功");
118
-                else
119
-                    return Error("字典添加失败");
120
-            }
121
-            return NoToken("未知错误,请重新登录");
120
+            if (orderBll.Add(orderModel) > 0)
121
+                return Success("字典分类添加成功");
122
+            else
123
+                return Error("字典分类添加失败");
122 124
         }
123 125
 
124 126
         //[Authority]
@@ -130,21 +132,25 @@ namespace CallCenterApi.Interface.Controllers
130 132
         public ActionResult EditDic(DictionaryBaseInput input)
131 133
         {
132 134
             if (Request.IsAuthenticated)
133
-            {
134
-                BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
135
-                Model.T_Sys_DictionaryBase orderModel = orderBll.GetModel(input.DicId);
136
-                if (orderModel == null)
137
-                    return Error("字典对象不存在");
138
-                orderModel.F_DictionaryFlag = input.DicFlag;
139
-                orderModel.F_DictionaryName = input.Name;
140
-                orderModel.F_Describe = input.Remark;
141
-                orderModel.F_Sort = input.Sort;
142
-                if (orderBll.Update(orderModel))
143
-                    return Success("字典添加成功");
144
-                else
145
-                    return Error("字典添加失败");
146
-            }
147
-            return NoToken("未知错误,请重新登录");
135
+                return NoToken("未知错误,请重新登录");
136
+            if(input.DicId<=0)
137
+                return Error("请选择要编辑的字典分类");
138
+            if (string.IsNullOrEmpty(input.DicFlag))
139
+                return Error("字典标识不允许为空!");
140
+            if (string.IsNullOrEmpty(input.Name))
141
+                return Error("字典分类不允许为空!");
142
+            BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
143
+            Model.T_Sys_DictionaryBase orderModel = orderBll.GetModel(input.DicId);
144
+            if (orderModel == null)
145
+                return Error("字典分类不存在");
146
+            orderModel.F_DictionaryFlag = input.DicFlag;
147
+            orderModel.F_DictionaryName = input.Name;
148
+            orderModel.F_Describe = input.Remark;
149
+            orderModel.F_Sort = input.Sort;
150
+            if (orderBll.Update(orderModel))
151
+                return Success("字典分类编辑成功");
152
+            else
153
+                return Error("字典分类编辑失败");
148 154
         }
149 155
 
150 156
         //[Authority]
@@ -278,53 +284,57 @@ namespace CallCenterApi.Interface.Controllers
278 284
         //添加字典值
279 285
         public ActionResult AddDicValue(DictionaryValueInput input)
280 286
         {
281
-            if (Request.IsAuthenticated)
282
-            {
287
+            if (!Request.IsAuthenticated)
288
+                return NoToken("未知错误,请重新登录");
289
+            if (string.IsNullOrEmpty(input.DicValue))
290
+                return Error("字典标识不允许为空!");
291
+            if (string.IsNullOrEmpty(input.DicVName))
292
+                return Error("字典值不允许为空!");
283 293
 
284
-                int userId = CurrentUser.UserData.F_UserId;
285
-                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
294
+            int userId = CurrentUser.UserData.F_UserId;
295
+            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
286 296
 
287
-                Model.T_Sys_DictionaryValue orderModel = new Model.T_Sys_DictionaryValue();
288
-                BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
297
+            Model.T_Sys_DictionaryValue orderModel = new Model.T_Sys_DictionaryValue();
298
+            BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
289 299
 
290
-                orderModel.F_Name = input.DicVName;
291
-                orderModel.F_Describe = input.DicDes;
292
-                orderModel.F_State = true;
293
-                orderModel.F_ValueCode = input.DicValue;
294
-                orderModel.F_DictionaryFlag = input.DicFlag;
295
-                orderModel.F_Sort = input.Sort;
296
-                orderModel.F_GroupCode = userModel.groupcode;
300
+            orderModel.F_Name = input.DicVName;
301
+            orderModel.F_Describe = input.DicDes;
302
+            orderModel.F_State = true;
303
+            orderModel.F_ValueCode = input.DicValue;
304
+            orderModel.F_DictionaryFlag = input.DicFlag;
305
+            orderModel.F_Sort = input.Sort;
306
+            orderModel.F_GroupCode = userModel.groupcode;
297 307
 
298
-                if (orderBll.Add(orderModel) > 0)
299
-                    return Success("字典值添加成功");
300
-                else
301
-                    return Error("字典值添加失败");
302
-            }
303
-            return NoToken("未知错误,请重新登录");
308
+            if (orderBll.Add(orderModel) > 0)
309
+                return Success("字典值添加成功");
310
+            else
311
+                return Error("字典值添加失败");
304 312
         }
305 313
         ////[Authority]
306 314
         //编辑字典值
307 315
         public ActionResult EditDicValue(DictionaryValueInput input)
308 316
         {
309
-            if (Request.IsAuthenticated)
310
-            {
311
-                if (input.DicVid <= 0)
312
-                    return Error("字典值id获取失败");
313
-                BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
314
-                Model.T_Sys_DictionaryValue orderModel = orderBll.GetModel(input.DicVid);
315
-                if (orderModel == null)
316
-                    return Error("字典值对象获取失败");
317
-                orderModel.F_Name = input.DicVName;
318
-                orderModel.F_Describe = input.DicDes;
319
-                orderModel.F_ValueCode = input.DicValue;
320
-                orderModel.F_DictionaryFlag = input.DicFlag;
321
-                orderModel.F_Sort = input.Sort;
322
-                if (orderBll.Update(orderModel))
323
-                    return Success("字典值编辑成功");
324
-                else
325
-                    return Error("字典值编辑失败");
326
-            }
327
-            return NoToken("未知错误,请重新登录");
317
+            if (!Request.IsAuthenticated)
318
+                return NoToken("未知错误,请重新登录");
319
+            if (input.DicVid <= 0)
320
+                return Error("请选择要编辑的字典值");
321
+            if (string.IsNullOrEmpty(input.DicValue))
322
+                return Error("字典标识不允许为空!");
323
+            if (string.IsNullOrEmpty(input.DicVName))
324
+                return Error("字典值不允许为空!");
325
+            BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
326
+            Model.T_Sys_DictionaryValue orderModel = orderBll.GetModel(input.DicVid);
327
+            if (orderModel == null)
328
+                return Error("字典值对象获取失败");
329
+            orderModel.F_Name = input.DicVName;
330
+            orderModel.F_Describe = input.DicDes;
331
+            orderModel.F_ValueCode = input.DicValue;
332
+            orderModel.F_DictionaryFlag = input.DicFlag;
333
+            orderModel.F_Sort = input.Sort;
334
+            if (orderBll.Update(orderModel))
335
+                return Success("字典值编辑成功");
336
+            else
337
+                return Error("字典值编辑失败");
328 338
         }
329 339
         //[Authority]
330 340
         //删除字典值

+ 51 - 116
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -381,7 +381,7 @@ namespace CallCenterApi.Interface.Controllers
381 381
         ///// <returns></returns>
382 382
         //public ActionResult GetTelRecordsTotal()
383 383
         //{
384
-            
384
+
385 385
         //    if (Request.IsAuthenticated)
386 386
         //    {
387 387
         //        int userId = CurrentUser.UserData.F_UserId;
@@ -397,7 +397,7 @@ namespace CallCenterApi.Interface.Controllers
397 397
         //            {
398 398
         //                uwhere += " and UserCode='" + userModel.F_UserCode + "' ";
399 399
         //            }
400
-                   
400
+
401 401
         //            if (!string.IsNullOrEmpty(userModel.groupcode))
402 402
         //            {
403 403
         //                uwhere += " and groupcode = '" + userModel.groupcode + "' ";
@@ -450,7 +450,7 @@ namespace CallCenterApi.Interface.Controllers
450 450
         //                daynocon = daynocon
451 451
         //            };
452 452
         //            return Success("成功", obj);
453
-                
453
+
454 454
         //    }
455 455
         //    }
456 456
         //    return NoToken("未知错误,请重新登录");
@@ -462,95 +462,40 @@ namespace CallCenterApi.Interface.Controllers
462 462
         /// <returns></returns>
463 463
         public ActionResult GetWorkTotal()
464 464
         {
465
-            
466
-            if (Request.IsAuthenticated)
467
-            {
468
-                int userId = CurrentUser.UserData.F_UserId;
469
-                if (userId != 0)
470
-                {
471
-                    Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
472
-                    if (userModel != null)
473
-                    {
474
-                        var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
475
-                        string strDate = date.ToString("yyyy-MM-dd");
476
-                        string strMonth = date.ToString("yyyy-MM");
477
-
478
-                        //BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
479
-                        //var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
480
-                        //var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
481
-                        //var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
482
-                        //var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
483
-
484
-                        string uwhere = " 1=1 and F_State !=11 and F_Duplicate!=5 AND CONVERT(char(7),F_CreateTime,20) = '" + strMonth + "'"; ;
485
-                        if (userModel.rolecode != "XTGLY")
486
-                        {
487
-                            uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
488
-                        }
465
+            if (!Request.IsAuthenticated)
466
+                return NoToken("未知错误,请重新登录");
467
+            int userId = CurrentUser.UserData.F_UserId;
468
+            if (userId <= 0)
469
+                return Error("登陆信息失效");
470
+            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
471
+            if (userModel == null)
472
+                return Error("当前用户信息不存在,请联系管理员!");
489 473
 
474
+            var date = DateTime.Now;
475
+            string strDate = date.ToString("yyyy-MM-dd");
476
+            string strMonth = date.ToString("yyyy-MM");
477
+            BLL.T_Rec_RegRecords bll = new BLL.T_Rec_RegRecords();
490 478
 
491
-                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
492
-                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
493
-                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
494
-                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
495
-
496
-                        //DataTable dtConnect = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateTime, 23) AS yearmonthdays,CONVERT(char(7),F_CreateTime,20) AS yearmonths,F_State,F_IsDelete,F_CreateTime,F_CreateUser FROM T_Bus_WorkOrder WITH(NOLOCK) where " + uwhere + "").Tables[0];
497
-
498
-                        //日已完成
499
-                        //int list1_count = dtConnect.Select(" yearmonthdays = '" + strDate + "' and F_State = 10 and F_IsDelete = 0").Count();
500
-                        ////日未完成
501
-                        //int list2_count = dtConnect.Select(" yearmonthdays = '" + strDate + "' and F_State<>10 and F_IsDelete=0 ").Count();
502
-                        ////月已完成
503
-                        //var list3_count = dtConnect.Select(" yearmonths = '" + strMonth + "' and F_State =10 and F_IsDelete=0 ").Count();
504
-                        ////月未完成
505
-                        //var list4_count = dtConnect.Select(" yearmonths = '" + strMonth + "' and F_State<>10 and F_IsDelete=0").Count();
506
-
507
-                        //BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
508
-                        //var modellist = bll.GetModelList (uwhere + " and F_IsDelete = 0  and F_State !=11 and F_Duplicate!=5");
509
-                        //int list1 = 0, list2 = 0, list3 = 0, list4 = 0;
510
-                        //if (modellist!=null )
511
-                        //{
512
-                        //   foreach (var it in modellist)
513
-                        //    {
514
-                        //        if (it .F_State ==10)
515
-                        //        {
516
-                        //            list3++;
517
-                        //            if (DateTime .Parse (it.F_CreateTime.ToString ()).ToString("yyyy-MM-dd")== strDate)
518
-                        //            {
519
-                        //                list1++;
520
-                        //            }
521
-                        //        }
522
-                        //        else
523
-                        //        {
524
-                        //            list4++;
525
-                        //            if (DateTime.Parse(it.F_CreateTime.ToString()).ToString("yyyy-MM-dd") == strDate)
526
-                        //            {
527
-                        //                list2++;
528
-                        //            }
529
-                        //        }
530
-                        //    }
531
-                        //}
532
-
533
-                     //   var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
534
-                     //   var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
535
-                    //    var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
536
-                      //  var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
537
-
538
-                        var obj = new
539
-                        {
540
-                            //daywc = list1,
541
-                            //daywwc = list2,
542
-                            //monwc = list3,
543
-                            //monwwc = list4
544
-                            //daywc = list1_count,
545
-                            //daywwc = list2_count,
546
-                            //monwc = list3_count,
547
-                            //monwwc = list4_count
548
-                        };
549
-                        return Success("成功", obj);
550
-                    }
551
-                }
479
+            var daywhere = " and datediff(day,F_CreateOn,getdate())=0 ";
480
+            var monthwhere = " and datediff(month,F_CreateOn,getdate())=0 ";
481
+            if (userModel.rolecode != "XTGLY")
482
+            {
483
+                daywhere += " and F_CreateBy='" + userModel.F_UserCode + "' ";
484
+                monthwhere += " and F_CreateBy='" + userModel.F_UserCode + "' ";
552 485
             }
553
-            return NoToken("未知错误,请重新登录");
486
+
487
+            var ldCount = bll.GetRecordCount("F_Direction=0 " + daywhere);
488
+            var qdCount = bll.GetRecordCount("F_Direction=1 " + daywhere);
489
+            var count = bll.GetRecordCount("1=1 " + monthwhere);
490
+
491
+
492
+            var obj = new
493
+            {
494
+                ldCount,
495
+                qdCount,
496
+                count
497
+            };
498
+            return Success("成功", obj);
554 499
         }
555 500
 
556 501
         /// <summary>
@@ -617,7 +562,7 @@ namespace CallCenterApi.Interface.Controllers
617 562
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
618 563
                 if (userModel != null)
619 564
                 {
620
-                    var date = DateTime.Now;//DateTime.Parse("2015-04-05"); //
565
+                    var date = DateTime.Now;
621 566
                     string strDate = date.ToString("yyyy-MM");
622 567
 
623 568
                     int days = DateTime.DaysInMonth(date.Year, date.Month);
@@ -628,33 +573,28 @@ namespace CallCenterApi.Interface.Controllers
628 573
                     int newcount = 0;
629 574
                     List<string> cols = strcols.Take(days).ToList();
630 575
                     BLL.T_Call_CallRecords telbll = new BLL.T_Call_CallRecords();
631
-                    //BLL.T_Wo_WorkOrderBase workbll = new BLL.T_Wo_WorkOrderBase();
632
-                    //BLL.T_Bus_WorkOrder workbll = new BLL.T_Bus_WorkOrder();
576
+                    
633 577
                     int[] teltotal = new int[days];
634 578
                     int[] worktotal = new int[days];
635
-                    string uwhere = " 1=1  AND CONVERT(char(7),F_CreateTime,20) = '" + strDate + "' ";
579
+                    string uwhere = " 1=1  AND CONVERT(char(7),F_CreateOn,20) = '" + strDate + "' ";
636 580
                     string u1where = " 1=1 and ISNULL(groupcode,'') != '' AND CONVERT(char(7),BeginTime,20) = '" + strDate + "' ";
637 581
                     if (userModel.rolecode != "XTGLY")
638 582
                     {
639
-                        uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
583
+                        uwhere += " and F_CreateBy='" + userModel.F_UserCode + "' ";
640 584
                         u1where += " and UserCode='" + userModel.F_UserCode + "' ";
641 585
                     }
642 586
 
643 587
                     DataTable dtConnect = DbHelperSQL.Query("select CONVERT(varchar(10),BeginTime, 23) AS yearmonthdays,CONVERT(char(7),BeginTime,20) AS yearmonths,CallType,BeginTime,groupcode,UserCode FROM T_Call_CallRecords WITH(NOLOCK) where " + u1where + "").Tables[0];
644
-                    //DataTable dtConnect_Wo = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateTime, 23) AS yearmonthdays,CONVERT(char(7),F_CreateTime,20) AS yearmonths,F_State,F_IsDelete,F_CreateTime,F_CreateUser FROM T_Bus_WorkOrder WITH(NOLOCK) where " + uwhere + "").Tables[0];
588
+                    DataTable dtConnect_Wo = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateOn, 23) AS yearmonthdays,CONVERT(char(7),F_CreateOn,20) AS yearmonths,F_CreateOn,F_CreateBy FROM T_Rec_RegRecords WITH(NOLOCK) where " + uwhere + "").Tables[0];
645 589
                     for (int i = 0; i < cols.Count; i++)
646 590
                     {
647 591
                         int tellist_Count = dtConnect.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
648 592
                         teltotal[i] = tellist_Count;
649 593
                         newcount = newcount + tellist_Count;
650 594
 
651
-                        //var worklist = workbll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
652
-                        //var worklist = workbll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
653
-                        //int worklist_count = workbll.GetRecordCount(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + (strDate + "-" + cols[i]) + "' ");
654
-                        //int worklist_count = dtConnect_Wo.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
655
-                        //worktotal[i] = worklist.Rows.Count;
656
-                        //worktotal[i] = worklist_count;
657
-                        worktotal[i] = 0;
595
+                        
596
+                        int worklist_count = dtConnect_Wo.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
597
+                        worktotal[i] = worklist_count;
658 598
                     }
659 599
 
660 600
                     var olddate = date.AddYears(-1);
@@ -707,18 +647,17 @@ namespace CallCenterApi.Interface.Controllers
707 647
         /// <returns></returns>
708 648
         public ActionResult GetWorkOrderCount()
709 649
         {
710
-            return Success("");
711
-
712
-            //if (Request.IsAuthenticated)
713
-            //{
650
+            if (!Request.IsAuthenticated)
651
+                return NoToken("未知错误,请重新登录");
652
+            int userId = CurrentUser.UserData.F_UserId;
653
+            if (userId <= 0)
654
+                return Error("登陆信息失效");
655
+            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
656
+            if (userModel == null)
657
+                return Error("当前用户信息不存在,请联系管理员!");
714 658
 
715
-            //    int userId = CurrentUser.UserData.F_UserId;
716
-            //    if (userId != 0)
717
-            //    {
718
-            //        Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
659
+            return Success("");
719 660
 
720
-            //        if (ua != null)
721
-            //        {
722 661
             //            BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
723 662
 
724 663
             //            string uwhere = " 1=1  ";
@@ -733,10 +672,6 @@ namespace CallCenterApi.Interface.Controllers
733 672
             //                thdtj = bll.GetList(uwhere + "  AND F_State=6 ").Tables[0].Rows.Count,
734 673
             //            };
735 674
             //            return Success("成功", obj);
736
-            //        }
737
-            //    }
738
-            //}
739
-            //return NoToken("未知错误,请重新登录");
740 675
         }
741 676
 
742 677
         /// <summary>

+ 28 - 18
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MenuManage/ModuleInfoController.cs

@@ -97,6 +97,12 @@ namespace CallCenterApi.Interface.Controllers
97 97
         [HttpPost]
98 98
         public ActionResult AddModule(ModuleInfoDto input)
99 99
         {
100
+            if (string.IsNullOrEmpty(input.name))
101
+                return Error("名称不允许为空");
102
+            if (string.IsNullOrEmpty(input.code))
103
+                return Error("代码不允许为空");
104
+            if (string.IsNullOrEmpty(input.url))
105
+                return Error("菜单连接不允许为空");
100 106
             var entity_ModuleInfo = new Model.T_Sys_ModuleInfo();
101 107
             entity_ModuleInfo.F_ParentID = input.parentid;
102 108
             entity_ModuleInfo.F_ModuleName = input.name;
@@ -156,30 +162,34 @@ namespace CallCenterApi.Interface.Controllers
156 162
         [HttpPost]
157 163
         public ActionResult EditModule(ModuleInfoDto input)
158 164
         {
165
+            if(input.id<=0)
166
+                return Error("请选择要编辑的菜单");
167
+            if (string.IsNullOrEmpty(input.name))
168
+                return Error("名称不允许为空");
169
+            if (string.IsNullOrEmpty(input.code))
170
+                return Error("代码不允许为空");
171
+            if (string.IsNullOrEmpty(input.url))
172
+                return Error("菜单连接不允许为空");
173
+
159 174
             var entity_ModuleInfo = moduleInfoBLL.GetModel(input.id);
160
-            if (entity_ModuleInfo != null)
161
-            {
162
-                entity_ModuleInfo.F_ParentID = input.parentid;
163
-                entity_ModuleInfo.F_ModuleName = input.name;
164
-                entity_ModuleInfo.F_ModuleCode = input.code;
165
-                entity_ModuleInfo.F_Remark = input.remark;
166
-                entity_ModuleInfo.F_Sort = input.sort;
167
-                entity_ModuleInfo.F_StateFlag = Convert.ToInt32(input.flag);
168
-                entity_ModuleInfo.F_OptUrl = input.url;
175
+            if (entity_ModuleInfo == null)
176
+                return Error("菜单对象获取失败");
177
+            entity_ModuleInfo.F_ParentID = input.parentid;
178
+            entity_ModuleInfo.F_ModuleName = input.name;
179
+            entity_ModuleInfo.F_ModuleCode = input.code;
180
+            entity_ModuleInfo.F_Remark = input.remark;
181
+            entity_ModuleInfo.F_Sort = input.sort;
182
+            entity_ModuleInfo.F_StateFlag = Convert.ToInt32(input.flag);
183
+            entity_ModuleInfo.F_OptUrl = input.url;
169 184
 
170 185
 
171
-                if (moduleInfoBLL.Update(entity_ModuleInfo))
172
-                {
173
-                    return Success("菜单修改成功");
174
-                }
175
-                else
176
-                {
177
-                    return Error("菜单修改失败,请重试!");
178
-                }
186
+            if (moduleInfoBLL.Update(entity_ModuleInfo))
187
+            {
188
+                return Success("菜单修改成功");
179 189
             }
180 190
             else
181 191
             {
182
-                return Error("菜单对象获取失败");
192
+                return Error("菜单修改失败,请重试!");
183 193
             }
184 194
         }
185 195
 

+ 70 - 85
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/knowledge/KnowledgeController.cs

@@ -122,100 +122,85 @@ namespace CallCenterApi.Interface.Controllers.knowledge
122 122
         //添加知识库
123 123
         public ActionResult AddInfo(string title, string key, string con, string pid)
124 124
         {
125
-            
126
-            if (Request.IsAuthenticated)
127
-            {
128
-
129
-                    Model.T_RepositoryInformation dModel = new Model.T_RepositoryInformation();
130
-                    if (pid.Trim() != "")
131
-                    {
132
-                        Model.T_RepositoryCategory pModel = new BLL.T_RepositoryCategory().GetModel(int.Parse(pid.Trim()));
133
-                        dModel.F_CategoryId = int.Parse(pid.Trim());
134
-                        if (pModel != null)
135
-                            dModel.F_Expand1 = pModel.F_CategoryName;
136
-                    }
137
-                    else
138
-                        dModel.F_CategoryId = 0;
139
-
140
-                    dModel.F_Title = title.Trim();
141
-                    dModel.F_KeyWords = key.Trim();
142
-                    dModel.F_Content = WebHelper.UrlDecode(con.Trim());
143
-                    dModel.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(con.Trim()));
144
-
145
-                    dModel.F_CreateOn = DateTime.Now;
146
-                    dModel.F_ModifyOn = DateTime.Now;
147
-                    dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
148
-                    dModel.F_DeleteFlag = 0;
149
-                    int b = new BLL.T_RepositoryInformation().Add(dModel);
150
-                    if (b > 0)
151
-                    {
152
-                        return Success("添加成功");
153
-                    }
154
-                    else
155
-                    {
156
-                        return Success("添加失败");
157
-                    }
158 125
 
126
+            if (!Request.IsAuthenticated)
127
+                return NoToken("未知错误,请重新登录");
128
+            if (string.IsNullOrEmpty(title))
129
+                return Error("标题不允许为空!");
130
+            if (string.IsNullOrEmpty(con))
131
+                return Error("内容不允许为空!");
132
+            if (string.IsNullOrEmpty(pid))
133
+                return Error("请选择所属分类!");
134
+
135
+            Model.T_RepositoryInformation dModel = new Model.T_RepositoryInformation();
136
+
137
+            Model.T_RepositoryCategory pModel = new BLL.T_RepositoryCategory().GetModel(int.Parse(pid.Trim()));
138
+            dModel.F_CategoryId = int.Parse(pid.Trim());
139
+            if (pModel != null)
140
+                dModel.F_Expand1 = pModel.F_CategoryName;
141
+
142
+            dModel.F_Title = title.Trim();
143
+            dModel.F_KeyWords = key.Trim();
144
+            dModel.F_Content = WebHelper.UrlDecode(con.Trim());
145
+            dModel.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(con.Trim()));
146
+
147
+            dModel.F_CreateOn = DateTime.Now;
148
+            dModel.F_ModifyOn = DateTime.Now;
149
+            dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
150
+            dModel.F_DeleteFlag = 0;
151
+            int b = new BLL.T_RepositoryInformation().Add(dModel);
152
+            if (b > 0)
153
+            {
154
+                return Success("添加成功");
159 155
             }
160
-            return NoToken("未知错误,请重新登录");
156
+            else
157
+            {
158
+                return Success("添加失败");
159
+            }
160
+
161 161
         }
162 162
         //[Authority]
163 163
         //编辑知识库
164 164
         public ActionResult EditInfo(string infoid, string title, string key, string con, string pid)
165 165
         {
166
-            
167
-            if (Request.IsAuthenticated)
168
-            {
169
-
170
-                    if (infoid != null && infoid.Trim() != "")
171
-                    {
172
-                        BLL.T_RepositoryInformation dBLL = new BLL.T_RepositoryInformation();
173
-                        Model.T_RepositoryInformation dModel = dBLL.GetModel(int.Parse(infoid.Trim()));
174
-                        if (dModel != null)
175
-                        {
176
-                            if (pid.Trim() != "")
177
-                            {
178
-                                Model.T_RepositoryCategory pModel = new BLL.T_RepositoryCategory().GetModel(int.Parse(pid.Trim()));
179
-                                dModel.F_CategoryId = int.Parse(pid.Trim());
180
-                                if (pModel != null)
181
-                                    dModel.F_Expand1 = pModel.F_CategoryName;
182
-                            }
183
-                            if (title.Trim() != "")
184
-                            {
185
-                                dModel.F_Title = title.Trim();
186
-                            }
187
-                            if (key.Trim() != "")
188
-                            {
189
-                                dModel.F_KeyWords = key.Trim();
190
-                            }
191
-                            if (con.Trim() != "")
192
-                            {
193
-                                dModel.F_Content = WebHelper.UrlDecode(con.Trim());
194
-                                dModel.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(con.Trim()));
195
-                            }
196
-
197
-                            dModel.F_ModifyBy = CurrentUser.UserData.F_UserId;
198
-                            dModel.F_ModifyOn = DateTime.Now;
199
-                            bool b = dBLL.Update(dModel);
200
-                            if (b)
201
-                            {
202
-                                return Success("编辑成功");
203
-                            }
204
-                            else
205
-                            {
206
-                                return Success("编辑失败");
207
-                            }
208
-                        }
209
-                        else
210
-                            return Error("获取信息失败");
211
-                    }
212
-                    else
213
-                    {
214
-                        return Error("请选择要编辑的知识库");
215
-                    }
216 166
 
167
+            if (!Request.IsAuthenticated)
168
+                return NoToken("未知错误,请重新登录");
169
+
170
+            if (infoid == null || infoid.Trim() != "")
171
+                return Error("请选择要编辑的知识库");
172
+            if (string.IsNullOrEmpty(title))
173
+                return Error("标题不允许为空!");
174
+            if (string.IsNullOrEmpty(con))
175
+                return Error("内容不允许为空!");
176
+            if (string.IsNullOrEmpty(pid))
177
+                return Error("请选择所属分类!");
178
+            BLL.T_RepositoryInformation dBLL = new BLL.T_RepositoryInformation();
179
+            Model.T_RepositoryInformation dModel = dBLL.GetModel(int.Parse(infoid.Trim()));
180
+            if (dModel == null)
181
+                return Error("获取信息失败");
182
+
183
+            Model.T_RepositoryCategory pModel = new BLL.T_RepositoryCategory().GetModel(int.Parse(pid.Trim()));
184
+            dModel.F_CategoryId = int.Parse(pid.Trim());
185
+            if (pModel != null)
186
+                dModel.F_Expand1 = pModel.F_CategoryName;
187
+
188
+            dModel.F_Title = title.Trim();
189
+            dModel.F_KeyWords = key.Trim();
190
+            dModel.F_Content = WebHelper.UrlDecode(con.Trim());
191
+            dModel.F_Description = WebHelper.NoHtml(WebHelper.UrlDecode(con.Trim()));
192
+
193
+            dModel.F_ModifyBy = CurrentUser.UserData.F_UserId;
194
+            dModel.F_ModifyOn = DateTime.Now;
195
+            bool b = dBLL.Update(dModel);
196
+            if (b)
197
+            {
198
+                return Success("编辑成功");
199
+            }
200
+            else
201
+            {
202
+                return Success("编辑失败");
217 203
             }
218
-            return NoToken("未知错误,请重新登录");
219 204
         }
220 205
         //[Authority]
221 206
         //删除知识库

+ 6 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiTongHuaController.cs

@@ -159,7 +159,7 @@ namespace CallCenterApi.Interface.Controllers.report
159 159
                 }
160 160
                 if (dt1.Rows[0]["sumshuchu"] == null || dt1.Rows[0]["sumshuchu"].ToString() == "")
161 161
                 {
162
-                    drNew["呼出通话总时长"] = "0";
162
+                    drNew["呼出通话总时长"] = "0";
163 163
                 }
164 164
                 else
165 165
                 {
@@ -182,7 +182,7 @@ namespace CallCenterApi.Interface.Controllers.report
182 182
                 }
183 183
                 if (dt1.Rows[0]["sumshuru"] == null || dt1.Rows[0]["sumshuru"].ToString() == "")
184 184
                 {
185
-                    drNew["呼入通话总时长"] = "0";
185
+                    drNew["呼入通话总时长"] = "0";
186 186
                 }
187 187
                 else
188 188
                 {
@@ -206,8 +206,8 @@ namespace CallCenterApi.Interface.Controllers.report
206 206
                 }
207 207
                 if (day == 0)
208 208
                 {
209
-                    drNew["平均日呼入通话时长"] = "0";
210
-                    drNew["平均日呼出通话时长"] = "0";
209
+                    drNew["平均日呼入通话时长"] = "0";
210
+                    drNew["平均日呼出通话时长"] = "0";
211 211
                 }
212 212
                 else
213 213
                 {
@@ -247,8 +247,8 @@ namespace CallCenterApi.Interface.Controllers.report
247 247
             }
248 248
             if (day == 0)
249 249
             {
250
-                drzj["平均日呼入通话时长"] = "0";
251
-                drzj["平均日呼出通话时长"] = "0";
250
+                drzj["平均日呼入通话时长"] = "0";
251
+                drzj["平均日呼出通话时长"] = "0";
252 252
             }
253 253
             else
254 254
             {