duhongyu hace 3 meses
padre
commit
2d698ef8d8

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 37 - 14
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs


+ 140 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

7
 using System;
7
 using System;
8
 using System.Collections.Generic;
8
 using System.Collections.Generic;
9
 using System.Data;
9
 using System.Data;
10
+using System.IO;
10
 using System.Linq;
11
 using System.Linq;
11
 using System.Web;
12
 using System.Web;
12
 using System.Web.Mvc;
13
 using System.Web.Mvc;
613
             }
614
             }
614
             return NoToken("未知错误,请重新登录");
615
             return NoToken("未知错误,请重新登录");
615
         }
616
         }
617
+
618
+        /// <summary>
619
+        /// 导入用户列表
620
+        /// </summary>
621
+        /// <returns></returns>
622
+        public ActionResult ImportExcel()
623
+        {
624
+            string usercode = CurrentUser.UserData.F_UserCode;
625
+            if (!string.IsNullOrWhiteSpace(usercode))
626
+            {
627
+                HttpPostedFile _upFile = RequestString.GetFile("upFile");
628
+                if (_upFile != null)
629
+                {
630
+                    int headrow = 0;
631
+                    List<Model.T_Sys_RoleInfo> rolelist = rolebll.GetModelList("1=1");
632
+                    List<Model.T_Sys_Department> departments = departmentBLL.GetModelList("1=1");
633
+                    #region 上传文件
634
+                    string filepath = "";
635
+                    string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
636
+                    string aLastName = Path.GetExtension(_upFile.FileName);
637
+                    string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
638
+                    if (aLastName != ".xls" && aLastName != ".xlsx")
639
+                    {
640
+                        return Error("文件类型错误,请选择Excel文件");
641
+                    }
642
+                    string newpath = datepath + "_" + _upFile.FileName;
643
+                    if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
644
+                    {
645
+                        Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
646
+                    }
647
+                    filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
648
+                    string PhysicalPath = Server.MapPath(filepath);
649
+                    _upFile.SaveAs(PhysicalPath);
650
+                    #endregion
651
+                    NPOIHelper np = new NPOIHelper();
652
+                    DataTable dt = np.ExcelToTable(_upFile, headrow);
653
+                    string msg = string.Empty;
654
+                    if (dt == null || dt.Rows.Count == 0)
655
+                        return Error("文件没有数据");
656
+                    else
657
+                    {
658
+                        Model.T_Sys_UserAccount dModel = new Model.T_Sys_UserAccount();
659
+
660
+                        foreach (DataRow dr in dt.Rows)
661
+                        {
662
+                            #region 数据入库
663
+                            headrow = headrow + 1;
664
+                            if (!string.IsNullOrEmpty(dr["用户角色"].ToString()))
665
+                            {
666
+                                var role = rolelist.Where(x => x.F_RoleName 
667
+                                == dr["用户角色"].ToString());
668
+                                if (role!=null&& role.Count()>0)
669
+                                {
670
+                                    dModel.F_RoleId = role.ToList()[0].F_RoleId;
671
+                                }
672
+                                else
673
+                                {
674
+                                    msg = msg + "第" + headrow + "行,用户角色错误,不存在,未导入<br>";
675
+                                    continue;
676
+                                }
677
+                            }
678
+                            else
679
+                            {
680
+                                msg = msg + "第" + headrow + "行,用户角色为空,未导入<br>";
681
+                                continue;
682
+                            }
683
+                            if (!string.IsNullOrEmpty(dr["用户姓名"].ToString()))
684
+                            {
685
+                                dModel.F_UserName = dr["用户姓名"].ToString();
686
+                            }
687
+                            else
688
+                            {
689
+                                msg = msg + "第" + headrow + "行,用户姓名为空,未导入<br>";
690
+                                continue;
691
+                            }
692
+                            if (!string.IsNullOrEmpty(dr["用户部门"].ToString()))
693
+                            {
694
+                                var dept = departments.Where(x => x.F_DeptName
695
+                                 == dr["用户部门"].ToString());
696
+                                if (dept != null && dept.Count() > 0)
697
+                                {
698
+                                    dModel.F_DeptId = dept.ToList()[0].F_DeptId;
699
+                                }
700
+                                else
701
+                                {
702
+                                    msg = msg + "第" + headrow +
703
+                                        "行,用户部门错误,不存在,未导入<br>";
704
+                                    continue;
705
+                                }
706
+                            }
707
+                            else
708
+                            {
709
+                                msg = msg + "第" + headrow + "行,用户部门为空,未导入<br>";
710
+                                continue;
711
+                            }
712
+                            if (!string.IsNullOrEmpty(dr["职务"].ToString()))
713
+                            {
714
+                                dModel.F_Post = dr["职务"].ToString();
715
+                            }
716
+                            if (!string.IsNullOrEmpty(dr["用户性别"].ToString()))
717
+                            {
718
+                                dModel.F_SexFlag = dr["用户性别"].ToString();
719
+                            }
720
+                            if (!string.IsNullOrEmpty(dr["固定电话"].ToString()))
721
+                            {
722
+                                dModel.F_Telephone = dr["固定电话"].ToString();
723
+                            }
724
+                            if (!string.IsNullOrEmpty(dr["手机号码"].ToString()))
725
+                            {
726
+                                dModel.F_Mobile = dr["手机号码"].ToString();
727
+                            }
728
+                            if (!string.IsNullOrEmpty(dr["备注"].ToString()))
729
+                            {
730
+                                dModel.F_Remark = dr["备注"].ToString();
731
+                            }
732
+                            dModel.F_Password = "123456";
733
+                            dModel.F_UserCode = Getcode().ToString();
734
+                            dModel.F_WorkNumber = Getcode().ToString();
735
+                            dModel.F_CreateBy = usercode;
736
+                            if (sysUserAccountBll.Add(dModel) > 0)
737
+                            {
738
+                                continue;
739
+                            }
740
+                            else
741
+                                msg = msg + "第" + headrow + "行,新增失败,未导入<br>";
742
+                            #endregion
743
+                        }
744
+                        if (string.IsNullOrEmpty(msg))
745
+                            return Success("导入成功 ");
746
+                        else
747
+                            return Error(msg);
748
+                    }
749
+                }
750
+                return Error("数据源上传失败");
751
+            }
752
+            return Error("用户登录失败,请重新登录");
753
+        }
754
+
755
+
616
         //[Authority]
756
         //[Authority]
617
         //添加用户信息
757
         //添加用户信息
618
         public ActionResult AddUsers(UserAccountInput input)
758
         public ActionResult AddUsers(UserAccountInput input)

+ 51 - 47
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

82
         public ActionResult GetList(string code, string starttime, string area, 
82
         public ActionResult GetList(string code, string starttime, string area, 
83
             string office,string officename, string endtime,string duplicatetime,string endduplicatetime, 
83
             string office,string officename, string endtime,string duplicatetime,string endduplicatetime, 
84
             string productType,string productDate, string batchNumber,string manufacturer,string problemCode, 
84
             string productType,string productDate, string batchNumber,string manufacturer,string problemCode, 
85
-            string productName,string producttypes,string complaintType,string notifications,string keywords, string dealTimely,string ywy,int IsReduction=-1, 
85
+            string productName,string producttypes,string complaintType,string notifications,string keywords,
86
+            string auditStartTime, string auditEndTime,
87
+            string dealTimely,string ywy, string reviewNotes, string startdealtime, string enddealtime, int IsReduction=-1, 
86
             int CJ=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1,
88
             int CJ=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1,
87
             int pagesize = 10,int isdc=0,int istime=-1 , int reminder=-1, int incomplete = -1,int isdealfile=-1,
89
             int pagesize = 10,int isdc=0,int istime=-1 , int reminder=-1, int incomplete = -1,int isdealfile=-1,
88
-            int isreductions=0,int comprehensive=-1,int isManager=0)
90
+            int isreductions=0,int comprehensive=-1,int isManager=0, int reviewStatus = 0)
89
         {
91
         {
90
            int userId = CurrentUser.UserData.F_UserId; ;
92
            int userId = CurrentUser.UserData.F_UserId; ;
91
             if (userId != 0)
93
             if (userId != 0)
206
                     sql += $" and c.F_ProductDate = '" + productDate.Trim() + "'";
208
                     sql += $" and c.F_ProductDate = '" + productDate.Trim() + "'";
207
                 if (!string.IsNullOrEmpty(batchNumber))//产品编码
209
                 if (!string.IsNullOrEmpty(batchNumber))//产品编码
208
                     sql += $" and c.F_BatchNumber like '%" + batchNumber.Trim() + "%'";
210
                     sql += $" and c.F_BatchNumber like '%" + batchNumber.Trim() + "%'";
211
+                if (!string.IsNullOrEmpty(reviewNotes))
212
+                    sql += $" and c.F_ReviewNotes like '%" + reviewNotes.Trim() + "%'";
213
+                if (reviewStatus > 0)
214
+                {
215
+                    if (reviewStatus==3)
216
+                    {
217
+                        sql += $" and  F_ReviewStatus is null ";
218
+                    }
219
+                    else
220
+                    {
221
+                        sql += $" and  F_ReviewStatus=" + reviewStatus + "";
222
+                    }
223
+                   
224
+                }
225
+                if(!string .IsNullOrEmpty(auditStartTime))
226
+                {
227
+                    sql += $" and  F_AuditTime >='"+ auditStartTime + "'";
228
+                }
229
+
230
+                if (!string.IsNullOrEmpty(auditEndTime))
231
+                {
232
+                    sql += $" and  F_AuditTime <='" + auditEndTime + "'";
233
+                }
209
                 if (reminder==0)
234
                 if (reminder==0)
210
                 {
235
                 {
211
                     sql += $" and c.F_DealType ='1' ";
236
                     sql += $" and c.F_DealType ='1' ";
298
                     sql += " and datediff(day,c.F_CreateTime,'" + starttime + "')<=0 ";
323
                     sql += " and datediff(day,c.F_CreateTime,'" + starttime + "')<=0 ";
299
                 if (!string.IsNullOrEmpty(endtime))
324
                 if (!string.IsNullOrEmpty(endtime))
300
                     sql += " and datediff(day,c.F_CreateTime,'" + endtime + "')>=0   ";
325
                     sql += " and datediff(day,c.F_CreateTime,'" + endtime + "')>=0   ";
326
+
327
+                if (!string.IsNullOrEmpty(startdealtime))
328
+                    sql += " and datediff(day,c.F_DealTime,'" + startdealtime + "')<=0 ";
329
+                if (!string.IsNullOrEmpty(enddealtime))
330
+                    sql += " and datediff(day,c.F_DealTime,'" + enddealtime + "')>=0   ";
331
+
332
+                
333
+
334
+
335
+
301
                  if (istime == 0)
336
                  if (istime == 0)
302
                 {
337
                 {
303
                     sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
338
                     sql += " and datediff(day,c.F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
451
                             if (ro.F_RoleCode == "QTJS")
486
                             if (ro.F_RoleCode == "QTJS")
452
                                 return Error("无操作权限");
487
                                 return Error("无操作权限");
453
                             break;
488
                             break;
454
-                        case 12://已完结
455
-                            sql += "AND c.F_State=11";
456
-                            sql += RetuSql(ro, see, ua);
457
-                            if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
458
-                            {
459
-                                sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
460
-                            }
461
-
462
-                            if (ro.F_RoleCode == "QTJS")
463
-                                return Error("无操作权限");
464
-                            break;
489
+                       
490
+                    }
491
+                    if (see >11)
492
+                    {
493
+                        sql += RetuSql(ro, see, ua);
465
                     }
494
                     }
466
                 }
495
                 }
467
                 else
496
                 else
1839
                 model.F_ProductDate = it.F_ProductDate;//生产日期
1868
                 model.F_ProductDate = it.F_ProductDate;//生产日期
1840
                 model.F_BatchNumber = it.F_BatchNumber;//产品编码
1869
                 model.F_BatchNumber = it.F_BatchNumber;//产品编码
1841
                 model.F_Manufacturer = it.F_Manufacturer;//生产厂家
1870
                 model.F_Manufacturer = it.F_Manufacturer;//生产厂家
1871
+                model.F_ReviewStatus = it.F_ReviewStatus;//审核情况
1872
+                model.F_ReviewNotes = it.F_ReviewNotes;//审核备注
1873
+
1842
                 model.F_ProblemCode = it.F_ProblemCode;//问题代码
1874
                 model.F_ProblemCode = it.F_ProblemCode;//问题代码
1843
                 model.F_QualityProblem = it.F_QualityProblem;//质量问题
1875
                 model.F_QualityProblem = it.F_QualityProblem;//质量问题
1844
                 model.F_IsReduction = it.F_IsReduction;
1876
                 model.F_IsReduction = it.F_IsReduction;
1914
                     }
1946
                     }
1915
                 }
1947
                 }
1916
                 //      model.F_ImplementationSituation = it.F_ImplementationSituation;//落实情况
1948
                 //      model.F_ImplementationSituation = it.F_ImplementationSituation;//落实情况
1917
-                model.F_State = it.F_State;//处理进度0待提交、1待查收、2待分派、3待接收、4处理中、10已完成11已审核
1949
+                model.F_State = it.F_State;//处理进度0待提交、1待查收、2待分派、3待接收、4处理中、10已完成
1918
                 model.F_Duplicate = it.F_Duplicate;//重复工单0未重复1重复
1950
                 model.F_Duplicate = it.F_Duplicate;//重复工单0未重复1重复
1919
                 model.F_Content = it.F_Content;//备注
1951
                 model.F_Content = it.F_Content;//备注
1920
                  model . F_IsReduction= it.F_IsReduction;//是否减免
1952
                  model . F_IsReduction= it.F_IsReduction;//是否减免
3368
         public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
3400
         public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
3369
         {
3401
         {
3370
             #region 工单处理
3402
             #region 工单处理
3371
-            string creatuser = "";
3372
             var opt = "审核通过";
3403
             var opt = "审核通过";
3373
-            int optbut = 10;
3374
-            int wostate = 10;
3375
-            string touser = "";
3376
-            int deptid = 0;
3377
             if (state == 2)
3404
             if (state == 2)
3378
             {
3405
             {
3379
                 opt = "审核拒绝";
3406
                 opt = "审核拒绝";
3380
-                optbut = 5;
3381
-                wostate = 5;
3382
-                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
3383
-                if (itemlast != null)
3384
-                {
3385
-                     creatuser = itemlast.F_CreateUser;
3386
-                }
3387
-               
3388
-                touser = nowUser.F_UserCode;
3389
-                deptid = nowUser.F_DeptId;
3390
             }
3407
             }
3391
-            int F_Largeareaid = 0, F_Officeid = 0;
3392
             #region 读取当前登录人部门
3408
             #region 读取当前登录人部门
3393
             string deptname = "";
3409
             string deptname = "";
3394
             var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
3410
             var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
3401
             if (!string.IsNullOrEmpty(cont))
3417
             if (!string.IsNullOrEmpty(cont))
3402
                 optcont = ",审核意见:" + cont;
3418
                 optcont = ",审核意见:" + cont;
3403
             var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
3419
             var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
3404
-            var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
3420
+
3421
+              long itemid= AddLog(model.F_Id, (int)model.F_State, content, 14, 14, "", 0, nowUser, 1);
3405
             if (itemid > 0)
3422
             if (itemid > 0)
3406
             {
3423
             {
3407
                 #region 处理工单
3424
                 #region 处理工单
3408
-                if (state==2)
3409
-                {
3410
-                    model.F_Officeid = F_Officeid;
3411
-                    model.F_Largeareaid = F_Largeareaid;
3412
-                    model.F_Notifications = creatuser;//通知人
3413
-                    if (wostate == 5)
3414
-                    {
3415
-                        if (model.F_TobeallocatedTime == null)
3416
-                            model.F_TobeallocatedTime = DateTime.Now;
3417
-                    }
3418
-                    if (!string.IsNullOrEmpty(model.F_Returnnote))
3419
-                        model.F_Returnnote += "," + cont;
3420
-                    else
3421
-                        model.F_Returnnote += cont;
3422
-                }
3423
-                model.F_State = wostate;
3425
+                model.F_ReviewStatus = state;
3426
+                model.F_ReviewNotes = cont;
3427
+                model.F_AuditTime = DateTime.Now;
3424
                 workorderBLL.Update(model);
3428
                 workorderBLL.Update(model);
3425
                 #endregion
3429
                 #endregion
3426
                 return true;
3430
                 return true;

+ 31 - 75
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs

75
         [HttpPost]
75
         [HttpPost]
76
         public ActionResult login(string Username, string Password)
76
         public ActionResult login(string Username, string Password)
77
         {
77
         {
78
+            return Error("移动端已停止使用。");
78
             bool appResult = LoodLoop();
79
             bool appResult = LoodLoop();
79
             if (appResult)
80
             if (appResult)
80
             {
81
             {
154
                 DataTable dt = new DataTable();
155
                 DataTable dt = new DataTable();
155
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
156
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
156
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
157
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
157
-                int DTJ = 0, DFP = 0, DCL = 0, CLZ = 0, YWJ = 0, THDTJ = 0, THDFP = 0, YJGD = 0, EJGD = 0, SJGD = 0, CJSL=0,ZX=0,
158
-                    DSH=0;
158
+                int DTJ = 0, DFP = 0, DCL = 0, CLZ = 0, YWJ = 0, THDTJ = 0, THDFP = 0, YJGD = 0, EJGD = 0, SJGD = 0, CJSL=0,ZX=0
159
+                  ;
159
                 string where = $" and (F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4  and F_Type=3) or F_Type>4 )";
160
                 string where = $" and (F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4  and F_Type=3) or F_Type>4 )";
160
                if (ro.F_RoleCode == "DS")//电商角色
161
                if (ro.F_RoleCode == "DS")//电商角色
161
                 {
162
                 {
359
                             }
360
                             }
360
                             ZX = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK)  where {sql} ").ToString());//待处理
361
                             ZX = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK)  where {sql} ").ToString());//待处理
361
                             break;
362
                             break;
362
-                        case 12://待审核
363
-                            sql = "";
364
-                            sql += $"  F_IsDelete=0";
365
-                            sql += "AND F_Duplicate !=5" + where;
366
-                            sql += "AND F_State=11";
367
-                            sql += RetuSql(ro, 0, ua);
368
-                            if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
369
-                            {
370
-                                sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
371
-                            }
372
-
373
-                            if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX")
374
-                                sql += "AND F_CreateUser=" + ua.F_UserCode;
375
-                            if (ro.F_RoleCode == "QTJS")
376
-                            {
377
-                                YWJ = 0;
378
-                                break;
379
-                            }
380
-                            DSH = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK) where {sql} ").ToString());//待处理
381
-                            break;
382
-
383
                     }
363
                     }
384
 
364
 
385
                 }
365
                 }
399
                     SJGD = SJGD,
379
                     SJGD = SJGD,
400
                     CJSL= CJSL,
380
                     CJSL= CJSL,
401
                     ZX= ZX,
381
                     ZX= ZX,
402
-                    DSH= DSH
403
                 };
382
                 };
404
                 return Content(obj.ToJson()); ;
383
                 return Content(obj.ToJson()); ;
405
             }
384
             }
416
         /// <returns></returns>
395
         /// <returns></returns>
417
         /// F_Duplicate  1咨询2投诉6抽检
396
         /// F_Duplicate  1咨询2投诉6抽检
418
         [Authority]
397
         [Authority]
419
-        public ActionResult GetList(string starttime, string endtime, string keywords, string area, 
398
+        public ActionResult GetList(string starttime, string endtime, string keywords,string reviewNotes, string area, 
420
             string offce, string dealTimely,int CJ=0, int see=0, int state = -1, int pageindex = 1,
399
             string offce, string dealTimely,int CJ=0, int see=0, int state = -1, int pageindex = 1,
421
-            int pagesize = 10,int Processing=0,int isdc=0, int comprehensive = -1, int isManager = 0)
400
+            int pagesize = 10,int Processing=0,int isdc=0,int reviewStatus=0, int comprehensive = -1, int isManager = 0)
422
         {
401
         {
423
             int userId = CurrentUser.UserData.F_UserId;
402
             int userId = CurrentUser.UserData.F_UserId;
424
             if (userId != 0)
403
             if (userId != 0)
601
                     sql += " and datediff(day,F_CreateTime,'" + starttime + "')<=0 ";
580
                     sql += " and datediff(day,F_CreateTime,'" + starttime + "')<=0 ";
602
                 if (!string.IsNullOrEmpty(endtime))
581
                 if (!string.IsNullOrEmpty(endtime))
603
                     sql += " and datediff(day,F_CreateTime,'" + endtime + "')>=0   ";
582
                     sql += " and datediff(day,F_CreateTime,'" + endtime + "')>=0   ";
583
+
584
+                if (!string.IsNullOrEmpty(reviewNotes))
585
+                    sql += $" and F_ReviewNotes like '%" + reviewNotes.Trim() + "%'";
586
+                if (reviewStatus > 0)
587
+                {
588
+                    if (reviewStatus == 3)
589
+                    {
590
+                        sql += $" and  F_ReviewStatus is null ";
591
+                    }
592
+                    else
593
+                    {
594
+                        sql += $" and  F_ReviewStatus=" + reviewStatus + "";
595
+                    }
596
+                }
597
+
604
                 if (ro.F_RoleCode == "XTGLY"|| ro.F_RoleCode == "QTJS")
598
                 if (ro.F_RoleCode == "XTGLY"|| ro.F_RoleCode == "QTJS")
605
                 {
599
                 {
606
                 }
600
                 }
714
                             if (ro.F_RoleCode == "QTJS")
708
                             if (ro.F_RoleCode == "QTJS")
715
                                 return Error("无操作权限");
709
                                 return Error("无操作权限");
716
                             break;
710
                             break;
717
-                        case 12://已完结
718
-                            sql += "AND F_State=11";
719
-                            sql += RetuSql(ro, see, ua);
720
-
721
-                            if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
722
-                            {
723
-                                sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
724
-                            }
725
-                            //      if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX")
726
-                            //    sql += "AND F_CreateUser=" + ua.F_UserCode;
727
-                            if (ro.F_RoleCode == "QTJS")
728
-                                return Error("无操作权限");
729
-                            break;
730
                     }
711
                     }
731
                 }
712
                 }
732
                 else
713
                 else
983
                 var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
964
                 var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
984
                  if (ro.F_RoleCode== "CLZY")
965
                  if (ro.F_RoleCode== "CLZY")
985
                 {
966
                 {
986
-                    if (model.F_State==1  || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
967
+                    if (model.F_State==1 || model.F_State == 10 || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
987
                     {
968
                     {
988
                         buttons.Add(ButtonGroup.goback());
969
                         buttons.Add(ButtonGroup.goback());
989
                     }
970
                     }
1231
                 model.F_BatchNumber = it.F_BatchNumber;//产品编码
1212
                 model.F_BatchNumber = it.F_BatchNumber;//产品编码
1232
                 model.F_Manufacturer = it.F_Manufacturer;//生产厂家
1213
                 model.F_Manufacturer = it.F_Manufacturer;//生产厂家
1233
                 model.F_ProblemCode = it.F_ProblemCode;//问题代码
1214
                 model.F_ProblemCode = it.F_ProblemCode;//问题代码
1215
+                model.F_ReviewStatus = it.F_ReviewStatus;//审核情况
1216
+                model.F_ReviewNotes = it.F_ReviewNotes;//审核备注
1234
                 model.F_QualityProblem = it.F_QualityProblem;//质量问题
1217
                 model.F_QualityProblem = it.F_QualityProblem;//质量问题
1235
               //  model.F_Notifications = it.F_Notifications;//通知人
1218
               //  model.F_Notifications = it.F_Notifications;//通知人
1236
               //  model.F_ReceivingPerson = it.F_ReceivingPerson;//接听人
1219
               //  model.F_ReceivingPerson = it.F_ReceivingPerson;//接听人
1979
             {
1962
             {
1980
               
1963
               
1981
                 opt = "处理完结";
1964
                 opt = "处理完结";
1982
-                optbut = 11;
1983
-                wostate =11;
1965
+                optbut = 10;
1966
+                wostate =10;
1984
                 model.F_DealUser = nowUser.F_UserCode;
1967
                 model.F_DealUser = nowUser.F_UserCode;
1985
                 model.F_DealTime = DateTime.Now;
1968
                 model.F_DealTime = DateTime.Now;
1986
             }
1969
             }
2071
         public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
2054
         public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
2072
         {
2055
         {
2073
             #region 工单处理
2056
             #region 工单处理
2074
-            string creatuser = "";
2075
             var opt = "审核通过";
2057
             var opt = "审核通过";
2076
-            int optbut = 10;
2077
-            int wostate = 10;
2078
-            string touser = "";
2079
-            int deptid = 0;
2080
             if (state == 2)
2058
             if (state == 2)
2081
             {
2059
             {
2082
                 opt = "审核拒绝";
2060
                 opt = "审核拒绝";
2083
-                optbut = 5;
2084
-                wostate = 5;
2085
-                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
2086
-                if (itemlast != null)
2087
-                {
2088
-                    creatuser = itemlast.F_CreateUser;
2089
-                }
2090
-
2091
-                touser = nowUser.F_UserCode;
2092
-                deptid = nowUser.F_DeptId;
2093
             }
2061
             }
2094
-            int F_Largeareaid = 0, F_Officeid = 0;
2095
             #region 读取当前登录人部门
2062
             #region 读取当前登录人部门
2096
             string deptname = "";
2063
             string deptname = "";
2097
             var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
2064
             var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
2104
             if (!string.IsNullOrEmpty(cont))
2071
             if (!string.IsNullOrEmpty(cont))
2105
                 optcont = ",审核意见:" + cont;
2072
                 optcont = ",审核意见:" + cont;
2106
             var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
2073
             var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
2107
-            var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
2074
+
2075
+            long itemid = AddLog(model.F_Id, (int)model.F_State, content, 14, 14, "", 0, nowUser, 1);
2108
             if (itemid > 0)
2076
             if (itemid > 0)
2109
             {
2077
             {
2110
                 #region 处理工单
2078
                 #region 处理工单
2111
-                if (state == 2)
2112
-                {
2113
-                    model.F_Officeid = F_Officeid;
2114
-                    model.F_Largeareaid = F_Largeareaid;
2115
-                    model.F_Notifications = creatuser;//通知人
2116
-                    if (wostate == 5)
2117
-                    {
2118
-                        if (model.F_TobeallocatedTime == null)
2119
-                            model.F_TobeallocatedTime = DateTime.Now;
2120
-                    }
2121
-                    if (!string.IsNullOrEmpty(model.F_Returnnote))
2122
-                        model.F_Returnnote += "," + cont;
2123
-                    else
2124
-                        model.F_Returnnote += cont;
2125
-                }
2126
-                model.F_State = wostate;
2079
+                model.F_ReviewStatus = state;
2080
+                model.F_ReviewNotes = cont;
2081
+                model.F_AuditTime = DateTime.Now;
2127
                 workorderBLL.Update(model);
2082
                 workorderBLL.Update(model);
2128
                 #endregion
2083
                 #endregion
2129
                 return true;
2084
                 return true;
2133
             #endregion
2088
             #endregion
2134
         }
2089
         }
2135
 
2090
 
2091
+
2136
         /// <summary>
2092
         /// <summary>
2137
         /// 转派工单
2093
         /// 转派工单
2138
         /// </summary>
2094
         /// </summary>

+ 2 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Global.asax.cs

52
 
52
 
53
         protected void Application_AuthenticateRequest(object sender, EventArgs e)
53
         protected void Application_AuthenticateRequest(object sender, EventArgs e)
54
         {
54
         {
55
+            SqlChecker SqlChecker = new SqlChecker(this.Request, this.Response);
56
+            SqlChecker.Check();
55
             HttpApplication app = (HttpApplication)sender;
57
             HttpApplication app = (HttpApplication)sender;
56
             var context = app.Context;
58
             var context = app.Context;
57
             if (context == null) throw new ArgumentNullException("context");
59
             if (context == null) throw new ArgumentNullException("context");

+ 6 - 17
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

158
                     else if (code == "YWY" || code == "XTGLY" || code == "ZG")
158
                     else if (code == "YWY" || code == "XTGLY" || code == "ZG")
159
                     {
159
                     {
160
                         buttons.Add(handle());
160
                         buttons.Add(handle());
161
-                        //buttons.Add(goback());
161
+                        buttons.Add(goback());
162
                         
162
                         
163
                     }
163
                     }
164
-                    else if (code == "CLZY")
165
-                    {
166
-                        buttons.Add(handle());
167
-                        buttons.Add(Perfect());
168
-                    }
169
-                    break;
170
-                case "11":
171
-                    //坐席 坐席班长 管理员
172
-                    if (code == "BSCJL" || code == "XTGLY")
173
-                    {
174
-                        buttons.Add(assign());
175
-                    }
176
-                    else if (code == "YWY" || code == "XTGLY" || code == "ZG")
164
+                    else if (code == "XTGLY" || code == "ZR")
177
                     {
165
                     {
178
-                        buttons.Add(handle());
179
                         buttons.Add(review());
166
                         buttons.Add(review());
180
 
167
 
181
                     }
168
                     }
182
-                    else if (code == "CLZY")
169
+                    else if (code == "CLZY" )
183
                     {
170
                     {
184
-                        buttons.Add(review());
171
+                        buttons.Add(handle());
185
                         buttons.Add(Perfect());
172
                         buttons.Add(Perfect());
173
+                        buttons.Add(review());
186
                     }
174
                     }
187
                     break;
175
                     break;
176
+               
188
             }
177
             }
189
             return buttons;
178
             return buttons;
190
         }
179
         }

+ 11 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderInput.cs

406
         /// 投诉类型
406
         /// 投诉类型
407
         /// </summary>
407
         /// </summary>
408
         public string F_ComplaintType { set; get; }
408
         public string F_ComplaintType { set; get; }
409
-        
409
+        /// <summary>
410
+        /// 审核情况1通过2拒绝
411
+        /// </summary>
412
+
413
+        public int? F_ReviewStatus { set; get; }
414
+        /// <summary>
415
+        /// 审核备注
416
+        /// </summary>
417
+
418
+        public string F_ReviewNotes { set; get; }
419
+
410
     }
420
     }
411
 }
421
 }

+ 14 - 2
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

609
         /// 投诉类型
609
         /// 投诉类型
610
         /// </summary>
610
         /// </summary>
611
         public string F_ComplaintType { set; get; }
611
         public string F_ComplaintType { set; get; }
612
+        /// <summary>
613
+        /// 审核情况1通过2拒绝
614
+        /// </summary>
615
+
616
+        public int ? F_ReviewStatus { set; get; }
617
+        /// <summary>
618
+        /// 审核备注
619
+        /// </summary>
612
 
620
 
613
-    #endregion Model
621
+        public string F_ReviewNotes { set; get; }
614
 
622
 
615
-}
623
+        public DateTime? F_AuditTime { set; get; }
624
+
625
+        #endregion Model
626
+
627
+    }
616
 }
628
 }
617
 
629
 

+ 1 - 0
codegit/CallCenterCommon/CallCenter.Utility/CallCenter.Utility.csproj

84
     <Compile Include="NPOI\Market.cs" />
84
     <Compile Include="NPOI\Market.cs" />
85
     <Compile Include="RedisHelper.cs" />
85
     <Compile Include="RedisHelper.cs" />
86
     <Compile Include="SaltAndHashHelper.cs" />
86
     <Compile Include="SaltAndHashHelper.cs" />
87
+    <Compile Include="SqlChecker.cs" />
87
     <Compile Include="SysInformationHelper.cs" />
88
     <Compile Include="SysInformationHelper.cs" />
88
     <Compile Include="Time\DateTimeConvert.cs" />
89
     <Compile Include="Time\DateTimeConvert.cs" />
89
     <Compile Include="VerifyCode\VerifyCode.cs" />
90
     <Compile Include="VerifyCode\VerifyCode.cs" />

+ 1 - 1
codegit/CallCenterCommon/CallCenter.Utility/FeiShuiHelper.cs

122
                 content = "{\"zh_cn\":{\"title\":\""+ title + 
122
                 content = "{\"zh_cn\":{\"title\":\""+ title + 
123
                 "\",\"content\":[[{\"tag\":\"text\",\"text\":\"工单编号:"+ workrodercode + "\"}]," +
123
                 "\",\"content\":[[{\"tag\":\"text\",\"text\":\"工单编号:"+ workrodercode + "\"}]," +
124
                 "[{\"tag\":\"text\",\"text\":\"投诉人姓名:" + name + "\"}]," +
124
                 "[{\"tag\":\"text\",\"text\":\"投诉人姓名:" + name + "\"}]," +
125
-                "[{\"tag\":\"text\",\"text\":\"投诉人手机号:" + phone + "\"}]," +
125
+               // "[{\"tag\":\"text\",\"text\":\"投诉人手机号:" + phone + "\"}]," +
126
                 "[{\"tag\":\"text\",\"text\":\"投诉人地址:" + address + "\"}]," +
126
                 "[{\"tag\":\"text\",\"text\":\"投诉人地址:" + address + "\"}]," +
127
                 "[{\"tag\":\"text\",\"text\":\"产品地址:" + products + "\"}]," +
127
                 "[{\"tag\":\"text\",\"text\":\"产品地址:" + products + "\"}]," +
128
                 "[{\"tag\":\"text\",\"text\":\"问题描述:" + description + "\"}]," +
128
                 "[{\"tag\":\"text\",\"text\":\"问题描述:" + description + "\"}]," +

+ 193 - 0
codegit/CallCenterCommon/CallCenter.Utility/SqlChecker.cs

1
+
2
+using System;
3
+using System.Collections.Generic;
4
+using System.IO;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Web;
8
+
9
+namespace CallCenter.Utility
10
+{
11
+    public class SqlChecker
12
+    { //当前请求对象
13
+        private HttpRequest request;
14
+        //当前响应对象
15
+        private HttpResponse response;
16
+        //安全Url,当出现Sql注入时,将导向到的安全页面,如果没赋值,则停留在当前页面
17
+        private string safeUrl = String.Empty;
18
+
19
+        //Sql注入时,可能出现的sql关键字,可根据自己的实际情况进行初始化,每个关键字由'|'分隔开来
20
+        //private const string StrKeyWord = @"select|insert|delete|from|count(|drop table|update|truncate|asc(|mid(|char(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
21
+        private const string StrKeyWord = @"select|insert|delete|from|drop table|update|truncate|exec master|netlocalgroup administrators|net user|or|and|waitfor delay|waitfor|delay";
22
+        //Sql注入时,可能出现的特殊符号,,可根据自己的实际情况进行初始化,每个符号由'|'分隔开来
23
+        //  private const string StrRegex = @"@|*";
24
+        //private const string StrRegex = @"=|!|'";
25
+        public SqlChecker()
26
+        {
27
+            //
28
+            // TODO: 在此处添加构造函数逻辑
29
+            //
30
+        }
31
+        /// <summary>
32
+        /// 由此构造函数创建的对象,在验证Sql注入之后将停留在原来页面上
33
+        /// </summary>
34
+        /// <param name="_request">当前请求的 Request 对象</param>
35
+        /// <param name="_response">当前请求的 Response 对象</param>
36
+        public SqlChecker(HttpRequest _request, HttpResponse _response)
37
+        {
38
+            this.request = _request;
39
+            this.response = _response;
40
+        }
41
+        /// <summary>
42
+        /// 由此构造函数创建的对象,在验证Sql注入之后将请求将导向由 _safeUrl 指定的安全url页面上
43
+        /// </summary>
44
+        /// <param name="_request">当前请求的 Request 对象</param>
45
+        /// <param name="_response">当前请求的 Response 对象</param>
46
+        /// <param name="_safeUrl">验证Sql注入之后将导向的安全 url</param>
47
+        public SqlChecker(HttpRequest _request, HttpResponse _response, string _safeUrl)
48
+        {
49
+            this.request = _request;
50
+            this.response = _response;
51
+            this.safeUrl = _safeUrl;
52
+        }
53
+        /// <summary>
54
+        /// 只读属性 SQL关键字
55
+        /// </summary>
56
+        public string KeyWord
57
+        {
58
+            get
59
+            {
60
+                return StrKeyWord;
61
+            }
62
+        }
63
+        ///// <summary>
64
+        ///// 只读属性过滤特殊字符
65
+        ///// </summary>
66
+        //public string RegexString
67
+        //{
68
+        //    get
69
+        //    {
70
+        //        return StrRegex;
71
+        //    }
72
+        //}
73
+        /// <summary>
74
+        /// 当出现Sql注入时需要提示的错误信息(主要是运行一些客户端的脚本)
75
+        /// </summary>
76
+        public string Msg
77
+        {
78
+            get
79
+            {
80
+                string msg = "<script type='text/javascript'> "
81
+                + " alert('请勿输入非法字符!'); ";
82
+
83
+                if (this.safeUrl == String.Empty)
84
+                    msg += " window.location.href = '" + request.RawUrl + "'";
85
+                else
86
+                    msg += " window.location.href = '" + safeUrl + "'";
87
+
88
+                msg += "</script>";
89
+                return msg;
90
+            }
91
+        }
92
+        /// <summary>
93
+        /// 检查URL参数中是否带有SQL注入的可能关键字。
94
+        /// </summary>
95
+        /// <returns>存在SQL注入关键字时返回 true,否则返回 false</returns>
96
+        public bool CheckRequestQuery()
97
+        {
98
+            bool result = false;
99
+            if (request.QueryString.Count != 0)
100
+            {
101
+                //若URL中参数存在,则逐个检验参数。
102
+                foreach (string queryName in this.request.QueryString)
103
+                {
104
+                    //过虑一些特殊的请求状态值,主要是一些有关页面视图状态的参数
105
+                    if (queryName == "__VIEWSTATE" || queryName == "__EVENTVALIDATION")
106
+                        continue;
107
+                    //开始检查请求参数值是否合法
108
+                    if (CheckKeyWord(request.QueryString[queryName]))
109
+                    {
110
+                        //只要存在一个可能出现Sql注入的参数,则直接退出
111
+                        result = true;
112
+                        break;
113
+                    }
114
+                }
115
+            }
116
+            return result;
117
+        }
118
+        /// <summary>
119
+        /// 检查提交表单中是否存在SQL注入的可能关键字
120
+        /// </summary>
121
+        /// <returns>存在SQL注入关键字时返回 true,否则返回 false</returns>
122
+        public bool CheckRequestForm()
123
+        {
124
+            bool result = false;
125
+            if (request.Form.Count > 0)
126
+            {
127
+                //若获取提交的表单项个数不为0,则逐个比较参数
128
+                foreach (string queryName in this.request.Form)
129
+                {
130
+                    //过虑一些特殊的请求状态值,主要是一些有关页面视图状态的参数
131
+                    if (queryName == "__VIEWSTATE" || queryName == "__EVENTVALIDATION")
132
+                        continue;
133
+                    //开始检查提交的表单参数值是否合法
134
+                    if (CheckKeyWord(request.Form[queryName]))
135
+                    {
136
+                        //只要存在一个可能出现Sql注入的参数,则直接退出
137
+                        result = true;
138
+                        break;
139
+                    }
140
+                }
141
+            }
142
+            return result;
143
+        }
144
+
145
+        /// <summary>
146
+        /// 检查_sword是否包涵SQL关键字
147
+        /// </summary>
148
+        /// <param name="_sWord">需要检查的字符串</param>
149
+        /// <returns>存在SQL注入关键字时返回 true,否则返回 false</returns>
150
+        public bool CheckKeyWord(string _sWord)
151
+        {
152
+            bool result = false;
153
+            //模式1 : 对应Sql注入的可能关键字
154
+            string[] patten1 = StrKeyWord.Split('|');
155
+            //模式2 : 对应Sql注入的可能特殊符号
156
+            // string[] patten2 = StrRegex.Split('|');
157
+            //开始检查 模式1:Sql注入的可能关键字 的注入情况
158
+            foreach (string sqlKey in patten1)
159
+            {
160
+                if (_sWord.IndexOf(" " + sqlKey) >= 0 || _sWord.IndexOf(sqlKey + " ") >= 0)
161
+                {
162
+                    //只要存在一个可能出现Sql注入的参数,则直接退出
163
+                    result = true;
164
+                    break;
165
+                }
166
+
167
+            }
168
+            //开始检查 模式1:Sql注入的可能特殊符号 的注入情况
169
+            //foreach (string sqlKey in patten2)
170
+            //{
171
+            //    if (_sWord.IndexOf(sqlKey) >= 0)
172
+            //    {
173
+            //        //只要存在一个可能出现Sql注入的参数,则直接退出
174
+            //        result = true;
175
+            //        break;
176
+            //    }
177
+            //}
178
+            return result;
179
+        }
180
+        /// <summary>
181
+        /// 执行Sql注入验证
182
+        /// </summary>
183
+        public void Check()
184
+        {
185
+            if (CheckRequestQuery() || CheckRequestForm())
186
+            {
187
+                response.Write(Msg);
188
+                response.End();
189
+            }
190
+        }
191
+
192
+    }
193
+}