Kaynağa Gözat

地区修改,报表修改,微信权限,

duhongyu 5 yıl önce
ebeveyn
işleme
16e6c331fc

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController.cs

@@ -40,9 +40,9 @@ namespace CallCenterApi.Interface.Controllers.customer
40 40
         public ActionResult GetAllList(int F_Layer=0, string F_RegionName = "")
41 41
         {
42 42
             int F_RegionId = 0;
43
-            if (!string .IsNullOrEmpty (F_RegionName.Trim ()))
43
+            if (!string .IsNullOrEmpty (F_RegionName))
44 44
             {
45
-                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
45
+                Model.T_RegionCategory userModel = regionBLL.GetModelList("F_RegionName='"+ F_RegionName + "'"+ "and F_Layer="+(F_Layer -1)).FirstOrDefault ();
46 46
                 if (userModel !=null )
47 47
                 {
48 48
                     F_RegionId = userModel.F_RegionId;

+ 17 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -865,6 +865,7 @@ namespace CallCenterApi.Interface.Controllers.report
865 865
             public int Overdue;//超期
866 866
             public int satisfied;//满意
867 867
             public int dissatisfied;//不满意
868
+            public int visit;//回访
868 869
         }
869 870
         public int  GetDeptWorkOrderID(int  deptId)
870 871
         {
@@ -917,13 +918,14 @@ namespace CallCenterApi.Interface.Controllers.report
917 918
             dt.Columns.Add("超期数量");
918 919
             dt.Columns.Add("满意数量");
919 920
             dt.Columns.Add("不满意数量");
920
-            
921
+            dt.Columns.Add("已回访");
922
+
921 923
             for (int i = 0; i < modeldeptid.Count; i++)
922 924
             {
923 925
                 DataRow drNew = dt.NewRow();
924
-                var itemlist = itembll.GetModelList("F_NextDept=" + modeldeptid[i]);
926
+                var itemlist = itembll.GetModelList("F_NextDept=" + modeldeptid[i] + "and F_IsUsed=0");
925 927
                 drNew["部门名称"] = modeldeptname[i];
926
-                int pending = 0; int beprocessed = 0; int processed = 0; int Overdue = 0; int satisfied = 0; int dissatisfied = 0;
928
+                int pending = 0; int beprocessed = 0; int processed = 0; int Overdue = 0; int satisfied = 0; int dissatisfied = 0, visit=0;
927 929
                 foreach (var it in itemlist)
928 930
                 {
929 931
                     if (it.F_IsUsed == 0 && it.F_OptType == 1)
@@ -944,7 +946,7 @@ namespace CallCenterApi.Interface.Controllers.report
944 946
                 {
945 947
                     if (it.F_RoleId == 59)
946 948
                     {
947
-                        var workorder = woBLL.GetModelList(sql + "and F_State=10 and F_DealBy='" + it.F_UserCode + "'");
949
+                        var workorder = woBLL.GetModelList(sql + "and F_State in(10,11) and F_DealBy='" + it.F_UserCode + "'");
948 950
                         processed += workorder.Count;
949 951
                         foreach (var im in workorder)
950 952
                         {
@@ -954,6 +956,8 @@ namespace CallCenterApi.Interface.Controllers.report
954 956
                                 satisfied++;
955 957
                             if (im.F_VisitResult == "不满意")
956 958
                                 dissatisfied++;
959
+                            if (im.F_State == 10)
960
+                                visit++;
957 961
                         }
958 962
                     }
959 963
                     
@@ -964,6 +968,7 @@ namespace CallCenterApi.Interface.Controllers.report
964 968
                 drNew["超期数量"] = Overdue;
965 969
                 drNew["满意数量"] = satisfied;
966 970
                 drNew["不满意数量"] = dissatisfied;
971
+                drNew["已回访"] = visit;
967 972
                 dt.Rows.Add(drNew);
968 973
             }
969 974
             NPOIHelper npoi = new NPOIHelper();
@@ -1008,10 +1013,10 @@ namespace CallCenterApi.Interface.Controllers.report
1008 1013
             List<Department> Departmentlist = new List<Department>();
1009 1014
             for (int i=0;i< modeldeptid.Count;i++)
1010 1015
             {
1011
-                var itemlist = itembll.GetModelList("F_NextDept=" + modeldeptid[i]);
1016
+                var itemlist = itembll.GetModelList("F_NextDept=" + modeldeptid[i]+ "and F_IsUsed=0");
1012 1017
                 Department model = new Department();
1013 1018
                 model.dapatname = modeldeptname[i];
1014
-                int pending = 0;int beprocessed = 0;int processed = 0;int Overdue = 0;int satisfied = 0;int dissatisfied = 0;
1019
+                int pending = 0;int beprocessed = 0;int processed = 0;int Overdue = 0;int satisfied = 0;int dissatisfied = 0, visit=0;
1015 1020
                 foreach (var it in itemlist)
1016 1021
                 {
1017 1022
                     if (it .F_IsUsed ==0&&it .F_OptType ==1)
@@ -1032,16 +1037,19 @@ namespace CallCenterApi.Interface.Controllers.report
1032 1037
                 {
1033 1038
                     if (it.F_RoleId == 59)
1034 1039
                     {
1035
-                        var workorder = woBLL.GetModelList(sql + "and F_State=10 and F_DealBy='" + it.F_UserCode + "'");
1040
+                        var workorder = woBLL.GetModelList(sql + "and F_State in(10,11) and F_DealBy='" + it.F_UserCode + "'");
1036 1041
                         processed += workorder.Count;
1037 1042
                         foreach (var im in workorder)
1038 1043
                         {
1044
+                            
1039 1045
                             if (im .F_IsOver ==1)
1040 1046
                                 Overdue++;
1041 1047
                             if (im.F_VisitResult == "满意" || im.F_VisitResult == "非常满意")
1042 1048
                                 satisfied++;
1043 1049
                             if (im.F_VisitResult == "不满意")
1044 1050
                                 dissatisfied++;
1051
+                            if (im .F_State ==11)
1052
+                                visit++;
1045 1053
                         }
1046 1054
                     }
1047 1055
                 }
@@ -1051,6 +1059,8 @@ namespace CallCenterApi.Interface.Controllers.report
1051 1059
                 model.Overdue = Overdue;
1052 1060
                 model.satisfied = satisfied;
1053 1061
                 model.dissatisfied = dissatisfied;
1062
+                model.visit = visit;
1063
+
1054 1064
                 Departmentlist.Add(model);
1055 1065
             }
1056 1066
             if (Departmentlist.Count > 0)

+ 17 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -3384,6 +3384,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
3384 3384
                             }
3385 3385
                             Customer.F_AreaID = pdModel.F_DeptId.ToString();
3386 3386
                         }
3387
+                        else
3388
+                        {
3389
+                            Customer.F_AreaID = "";
3390
+                        }
3387 3391
 
3388 3392
                         if (!string.IsNullOrEmpty(input.F_BranchName))
3389 3393
                         {
@@ -3398,6 +3402,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
3398 3402
                             }
3399 3403
                             Customer.F_BranchID = pdModel.F_DeptId.ToString();
3400 3404
                         }
3405
+                        else
3406
+                        {
3407
+                            Customer.F_BranchID = "";
3408
+                        }
3401 3409
                         if (!string.IsNullOrEmpty(input.F_CompanyName ))
3402 3410
                             Customer.F_CompanyName = input.F_CompanyName;
3403 3411
                         customerBaseBLL.Update(Customer);
@@ -3460,6 +3468,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
3460 3468
                             }
3461 3469
                             Customer.F_AreaID = pdModel.F_DeptId.ToString();
3462 3470
                         }
3471
+                        else
3472
+                        {
3473
+                            Customer.F_AreaID = "";
3474
+                        }
3463 3475
 
3464 3476
                         if (!string.IsNullOrEmpty(input.F_BranchName))
3465 3477
                         {
@@ -3476,6 +3488,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
3476 3488
                                 Customer.F_BranchID = pdModel.F_DeptId.ToString();
3477 3489
                             }
3478 3490
                         }
3491
+                        else
3492
+                        {
3493
+                            Customer.F_BranchID = "";
3494
+                        }
3479 3495
                         if (!string.IsNullOrEmpty(input.F_CompanyName))
3480 3496
                             Customer.F_CompanyName = input.F_CompanyName;
3481 3497
                         customerBaseBLL  .Update(Customer);
@@ -3508,7 +3524,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3508 3524
                 model.F_Files = input.F_Files;//附件上传ids
3509 3525
             else
3510 3526
                 model.F_Files = model.F_Files;//附件上传ids
3511
-            model.F_Brand = input.F_WorkerBrand;//分公司
3527
+            model.F_Brand = input.F_WorkerBrand;//
3512 3528
             model.F_DealType = model.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
3513 3529
             model.F_Canal = input.F_Canal;//处理方式:当即办理、电话转接、网络转办(点选)
3514 3530
             #endregion

+ 81 - 30
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -80,26 +80,35 @@ namespace CallCenterApi.Interface.Controllers.workorder
80 80
                 if (!string.IsNullOrWhiteSpace(createby))//创建人
81 81
                 {
82 82
                     string F_WorkNumber = "";
83
-
83
+                    string UserCode = "";
84 84
                     Model.T_Sys_UserAccount user = sysUserAccountBll.GetworkModel(createby);
85 85
                   
86 86
                     if (user != null)
87 87
                     {
88
-                        F_WorkNumber = user.F_UserCode;
88
+                        F_WorkNumber = user.F_WorkNumber;
89
+                        UserCode = user.F_UserCode;
89 90
                     }
90 91
                     else
91 92
                     {
92 93
                         Model.T_Sys_UserAccount userer = sysUserAccountBll.GetName (createby);
93 94
                         if (userer!=null )
94
-                             F_WorkNumber = user.F_UserCode;
95
+                        {
96
+                            F_WorkNumber = userer.F_WorkNumber;
97
+                            UserCode = userer.F_UserCode;
98
+                        }
99
+                          
95 100
                     }
96
-                    if (!string.IsNullOrEmpty(F_WorkNumber))
101
+                    if (!string.IsNullOrEmpty(F_WorkNumber)&& !string.IsNullOrEmpty(UserCode))
97 102
                     {
98
-                        sql += $" and F_CreateBy  in('" + createby + "','" + F_WorkNumber + "') ";
103
+                        sql += $" and F_CreateBy  in('" + UserCode + "','" + F_WorkNumber + "') ";
99 104
                     }
100
-                    else
105
+                    else if (!string.IsNullOrEmpty(F_WorkNumber))
106
+                    {
107
+                        sql += $" and F_CreateBy  in('" + F_WorkNumber + "') ";
108
+                    }
109
+                    else if (!string.IsNullOrEmpty(UserCode))
101 110
                     {
102
-                        sql += $" and F_CreateBy  in('" + createby + "') ";
111
+                        sql += $" and F_CreateBy  in('" + UserCode + "') ";
103 112
                     }
104 113
 
105 114
                 }
@@ -2247,20 +2256,35 @@ namespace CallCenterApi.Interface.Controllers.workorder
2247 2256
                 if (!string.IsNullOrWhiteSpace(createby))//创建人
2248 2257
                 {
2249 2258
                     string F_WorkNumber = "";
2250
-                        Model.T_Sys_UserAccount user = sysUserAccountBll.GetworkModel(createby);
2259
+                    string UserCode = "";
2260
+                    Model.T_Sys_UserAccount user = sysUserAccountBll.GetworkModel(createby);
2251 2261
                         if (user !=null )
2252 2262
                         {
2253
-                        F_WorkNumber = user.F_UserCode;
2263
+                        F_WorkNumber = user.F_WorkNumber;
2264
+                        UserCode = user.F_UserCode;
2265
+                    }
2266
+                    else
2267
+                    {
2268
+                        Model.T_Sys_UserAccount username = sysUserAccountBll.GetName(createby);
2269
+                        if (username != null)
2270
+                        {
2271
+                            F_WorkNumber = username.F_WorkNumber;
2272
+                            UserCode = username.F_UserCode;
2254 2273
                         }
2255
-                     if (!string.IsNullOrEmpty( F_WorkNumber))
2274
+                    }
2275
+                     if (!string.IsNullOrEmpty( F_WorkNumber)&& !string.IsNullOrEmpty(UserCode))
2256 2276
                     {
2257
-                        sql += $"and F_CreateBy  in(" + createby + "," + F_WorkNumber + ") ";
2277
+                        sql += $"and F_CreateBy  in(" + UserCode + "," + F_WorkNumber + ") ";
2258 2278
                     }
2259
-                     else
2279
+                    else if (!string.IsNullOrEmpty(F_WorkNumber) )
2260 2280
                     {
2261
-                        sql += $"and F_CreateBy  in(" + createby + ") ";
2281
+                        sql += $"and F_CreateBy  in(" + F_WorkNumber + ") ";
2262 2282
                     }
2263
-                    
2283
+                    else if (!string.IsNullOrEmpty(UserCode))
2284
+                    {
2285
+                        sql += $"and F_CreateBy  in(" + UserCode + ") ";
2286
+                    }
2287
+
2264 2288
                 }
2265 2289
                 if (!string.IsNullOrWhiteSpace(description))//问题描述
2266 2290
                     sql += $" and F_Description like '%" + description.Trim() + "%'";
@@ -2799,7 +2823,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2799 2823
                             "F_ID",
2800 2824
                             "*",
2801 2825
                             sql,
2802
-                            "ORDER BY T_Wo_WorkOrder.F_ID desc",
2826
+                            "ORDER BY T_Wo_WorkOrder.F_CreateOn desc",
2803 2827
                             pagesize,
2804 2828
                             pageindex,
2805 2829
                             true,
@@ -3952,6 +3976,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
3952 3976
                 }
3953 3977
                 model.F_AreaID = pdModel.F_DeptId.ToString();
3954 3978
             }
3979
+            else
3980
+            {
3981
+                model.F_AreaID = "";
3982
+            }
3955 3983
 
3956 3984
             if (!string.IsNullOrEmpty(input.F_BranchName))
3957 3985
             {
@@ -3966,6 +3994,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
3966 3994
                 }
3967 3995
                 model.F_BranchID = pdModel.F_DeptId.ToString();
3968 3996
             }
3997
+            else
3998
+            {
3999
+                model.F_BranchID ="";
4000
+            }
3969 4001
             model.F_Salesman = input.F_Salesman;//业务员
3970 4002
             model.F_SalesPhone = input.F_SalesPhone;//业务员电话
3971 4003
             model.F_Channel = input.F_Channel;// 渠道类型:总经销、二级商、种田大户、农户、化工客户、公司员工
@@ -4697,6 +4729,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4697 4729
                         if (!string.IsNullOrEmpty(model.F_UserCode))
4698 4730
                         {
4699 4731
                             Model.T_Sys_UserAccount user = sysUserAccountBll.GetModel(model.F_UserCode);
4732
+                            if(user!=null )
4700 4733
                             model.F_UserName = user.F_UserName;
4701 4734
                         }
4702 4735
 
@@ -5008,6 +5041,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
5008 5041
                             }
5009 5042
                             Customer.F_AreaID = pdModel.F_DeptId.ToString();
5010 5043
                         }
5044
+                        else
5045
+                        {
5046
+                            Customer.F_AreaID = "";
5047
+                        }
5011 5048
                               
5012 5049
                             if (!string.IsNullOrEmpty(input.F_BranchName))
5013 5050
                         {
@@ -5022,6 +5059,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
5022 5059
                             }
5023 5060
                             Customer.F_BranchID = pdModel.F_DeptId.ToString();
5024 5061
                         }
5062
+                            else
5063
+                        {
5064
+                            Customer.F_BranchID = "";
5065
+                        }
5025 5066
                         if (!string.IsNullOrEmpty(input.F_CompanyName))
5026 5067
                             Customer.F_CompanyName = input.F_CompanyName;
5027 5068
                         cusbll.Update(Customer);
@@ -5083,8 +5124,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
5083 5124
                             }
5084 5125
                             Customer.F_AreaID = pdModel.F_DeptId.ToString();
5085 5126
                         }
5086
-                               
5087
-                            if (!string.IsNullOrEmpty(input.F_BranchName))
5127
+                        else
5128
+                        {
5129
+                            Customer.F_AreaID = "";
5130
+                        }
5131
+
5132
+                        if (!string.IsNullOrEmpty(input.F_BranchName))
5088 5133
                         {
5089 5134
                             {
5090 5135
                                 Model.T_Sys_Department pdModel = new Model . T_Sys_Department();
@@ -5099,6 +5144,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
5099 5144
                                 Customer.F_BranchID = pdModel.F_DeptId.ToString();
5100 5145
                             }
5101 5146
                         }
5147
+                        else
5148
+                        {
5149
+                            Customer.F_BranchID = "";
5150
+                        }
5102 5151
                         if (!string.IsNullOrEmpty(input.F_CompanyName))
5103 5152
                             Customer.F_CompanyName = input.F_CompanyName;
5104 5153
                         cusbll.Update(Customer);
@@ -5338,19 +5387,27 @@ namespace CallCenterApi.Interface.Controllers.workorder
5338 5387
                 var model = new Model.T_Wo_WorkOrder();
5339 5388
                 #region 保存客户基本信息
5340 5389
                 model = inputtoobj(model, input, 2);
5341
-
5390
+                if (clbm == 0 && clid == 0)
5391
+                {
5392
+                    return Error("请选择接收部门");
5393
+                }
5342 5394
                 #endregion
5343 5395
                 long n = workOrder.Add(model);
5344 5396
                 if (n > 0)
5345 5397
                 {
5346 5398
 
5347 5399
                     Model.T_Wo_WorkOrder modlelist = new BLL.T_Wo_WorkOrder().GetModel(n);
5348
-                    WorkOrderNewInput inputs = new WorkOrderNewInput();
5349
-                        if (clbm == 0 && clid == 0)
5350
-                        {
5351
-                            return Error("请选择接收部门");
5352
-                        }
5400
+                    string deptname = "";
5353 5401
                     var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
5402
+                    //var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
5403
+                    if (deptmodel != null)
5404
+                    {
5405
+                        deptname = deptmodel.F_DeptName + "-";
5406
+                    }
5407
+                    AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
5408
+                    WorkOrderNewInput inputs = new WorkOrderNewInput();
5409
+                      
5410
+                
5354 5411
                             if (deptmodel != null)
5355 5412
                               {
5356 5413
                                if (modlelist != null)
@@ -5416,14 +5473,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
5416 5473
                         if (modlelist != null)
5417 5474
                         {
5418 5475
 
5419
-                        string deptname = "";
5420
-                        //var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
5421
-                        if (deptmodel != null)
5422
-                        {
5423
-                            deptname = deptmodel.F_DeptName + "-";
5424
-                        }
5476
+                     
5425 5477
 
5426
-                        AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
5427 5478
                         var res = AssignWO(ua, modlelist, inputs, cont, F_Files, clbm, clid, overtime, sms);
5428 5479
                             if (res)
5429 5480
                                 return Success("转派成功");