duhongyu 6 lat temu
rodzic
commit
0620353e2d

Plik diff jest za duży
+ 10 - 4
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs


Plik diff jest za duży
+ 1507 - 113
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs


+ 119 - 20
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

235
                         }
235
                         }
236
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" + "0" + "' "; ;
236
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" + "0" + "' "; ;
237
                         break;
237
                         break;
238
+                    case 8://待审批
239
+                        if (ro.F_RoleCode == "GC")
240
+                        {
241
+                            if (GetDJDWorkOrderID(ua.F_UserCode) != "")
242
+                            {
243
+                                sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetDJDWorkOrderID(ua.F_UserCode) + ") "; ;
244
+                            }
245
+                        }
246
+                        else
247
+                        {
248
+
249
+                            return Success("暂无工单"); ;
250
+                        }
251
+                        break;
238
                 }
252
                 }
239
                 #endregion
253
                 #endregion
240
                 int recordCount = 0;
254
                 int recordCount = 0;
269
                 else
283
                 else
270
                 {
284
                 {
271
 
285
 
272
-                    return Success("暂无工单"); ;
286
+                     return Success("暂无工单"); ;
273
                 }
287
                 }
274
             }
288
             }
275
             else
289
             else
321
         public string GetCYWorkOrderID(string user)
335
         public string GetCYWorkOrderID(string user)
322
         {
336
         {
323
             string str = string.Empty;
337
             string str = string.Empty;
324
-
325
-            str = "select F_WoID from T_Wo_WorkOrderItem_New where F_CreateUser='" + user + "' ";
326
-
338
+            str = "select F_WoID from T_Wo_WorkOrderItem_New where F_CreateUser in(" + user + ")"
339
+            
340
+             ;
327
             return str;
341
             return str;
328
         }
342
         }
329
         /// <summary>
343
         /// <summary>
1621
                     model.F_VisitResult = model1[i].F_VisitResult;//回访结果:非常满意、满意、一般、不满意
1635
                     model.F_VisitResult = model1[i].F_VisitResult;//回访结果:非常满意、满意、一般、不满意
1622
                     model.F_VisitReason = model1[i].F_VisitReason;// 回访不满意原因
1636
                     model.F_VisitReason = model1[i].F_VisitReason;// 回访不满意原因
1623
                     model.F_Callresults = model1[i].F_Callresults;//呼叫结果
1637
                     model.F_Callresults = model1[i].F_Callresults;//呼叫结果
1638
+                    model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
1624
 
1639
 
1625
-
1626
-
1640
+                    model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1641
+                    model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
1642
+                    if (model1[i].F_AuditState == 0)
1643
+                    {
1644
+                        model.F_AuditState = "同意上报";
1645
+                    }
1646
+                    else if (model1[i].F_AuditState == 1)
1647
+                    {
1648
+                        model.F_AuditState = "驳回修订";
1649
+                    }
1650
+                    else
1651
+                    {
1652
+                        model.F_AuditState = "强制结案";
1653
+                    }
1654
+                    model.F_AuditBy = model1[i].F_AuditBy;//审核人
1655
+                    model.F_AuditOn = model1[i].F_AuditOn;//审核时间
1656
+                    model.F_AuditCont = model1[i].F_AuditCont;//审核内容
1627
                     model.F_IsOver = model1[i].F_IsOver;
1657
                     model.F_IsOver = model1[i].F_IsOver;
1628
                  
1658
                  
1629
                     if (userId >0)
1659
                     if (userId >0)
2006
                                         }
2036
                                         }
2007
                                         else if (deptmodel.F_DeptId == 12)
2037
                                         else if (deptmodel.F_DeptId == 12)
2008
                                         {
2038
                                         {
2039
+                                        inputs.F_IsVisit = isvisit;
2009
                                         inputs.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2040
                                         inputs.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2010
                                         inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2041
                                         inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2011
                                         }
2042
                                         }
2061
         /// <returns></returns>
2092
         /// <returns></returns>
2062
         [Authority]
2093
         [Authority]
2063
         public ActionResult AssignWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment, int isvisit=1,
2094
         public ActionResult AssignWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment, int isvisit=1,
2064
-            float overtime =0,int sms=0,int clbm = 0, int clid = 0)
2095
+            float overtime =0,int sms=0,int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
2065
         {
2096
         {
2066
             int userId = CurrentUser.UserData.F_UserId;
2097
             int userId = CurrentUser.UserData.F_UserId;
2067
             string usercode = CurrentUser.UserData.F_UserCode;
2098
             string usercode = CurrentUser.UserData.F_UserCode;
2121
                                     }
2152
                                     }
2122
                                     else if (deptmodel.F_DeptId == 12)
2153
                                     else if (deptmodel.F_DeptId == 12)
2123
                                     {
2154
                                     {
2155
+                                        input.F_IsVisit = isvisit;
2124
                                         input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2156
                                         input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2125
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2157
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2126
                                     }
2158
                                     }
2146
                    
2178
                    
2147
                     if (model != null)
2179
                     if (model != null)
2148
                     {
2180
                     {
2149
-                        var res = AssignWO(ua, model, input,cont, clbm, clid, overtime, sms );
2181
+                        var res = AssignWO(ua, model, input,cont, clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
2150
                         if (res)
2182
                         if (res)
2151
                             return Success("转派成功");
2183
                             return Success("转派成功");
2152
                         else
2184
                         else
2215
         [Authority]
2247
         [Authority]
2216
         public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
2248
         public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
2217
             string uncont="",
2249
             string uncont="",
2218
-          int isvisit=0,  int isover = 0)
2250
+          int isvisit=1,  int isover = 0)
2219
         {
2251
         {
2220
             int userId = CurrentUser.UserData.F_UserId;
2252
             int userId = CurrentUser.UserData.F_UserId;
2221
             if (userId != 0)
2253
             if (userId != 0)
2264
                                 }
2296
                                 }
2265
                                 else if (deptmodel.F_DeptId == 12)
2297
                                 else if (deptmodel.F_DeptId == 12)
2266
                                 {
2298
                                 {
2299
+                                    input.F_IsVisit = isvisit;
2267
                                     input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2300
                                     input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2268
                                 }
2301
                                 }
2269
                             }
2302
                             }
2299
             return Error("无操作权限!");
2332
             return Error("无操作权限!");
2300
         }
2333
         }
2301
         /// <summary>
2334
         /// <summary>
2335
+        /// 高层审批
2336
+        /// </summary>
2337
+        /// <param name="input"></param>
2338
+        /// <returns></returns>
2339
+        [Authority]
2340
+        public ActionResult HigApprovalOrder( long orderid, string cont)
2341
+        {
2342
+            int userId = CurrentUser.UserData.F_UserId;
2343
+            if (userId != 0)
2344
+            {
2345
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
2346
+                if (ua != null)
2347
+                {
2348
+                    Model.T_Wo_WorkOrder model = workOrder  .GetModel(orderid);
2349
+                    //验证信息
2350
+                    if (model != null)
2351
+                    {
2352
+                        model.F_Highopinions = cont;
2353
+                        bool n = workOrder.Update(model);
2354
+                        if (n)
2355
+                            return Success("审批成功");
2356
+                        else
2357
+                            return Error("审批失败!");
2358
+                    }
2359
+                    return Error("工单不存在");
2360
+                }
2361
+            }
2362
+            return Error("无操作权限");
2363
+        }
2364
+        /// <summary>
2302
         /// 退回工单
2365
         /// 退回工单
2303
         /// </summary>
2366
         /// </summary>
2304
         /// <param name="input"></param>
2367
         /// <param name="input"></param>
2334
         /// <param name="input"></param>
2397
         /// <param name="input"></param>
2335
         /// <returns></returns>
2398
         /// <returns></returns>
2336
         [Authority]
2399
         [Authority]
2337
-        public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call )
2400
+        public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call ,int  isOver=0)
2338
         {
2401
         {
2339
             int userId = CurrentUser.UserData.F_UserId;
2402
             int userId = CurrentUser.UserData.F_UserId;
2340
             if (userId != 0)
2403
             if (userId != 0)
2346
                     //验证信息
2409
                     //验证信息
2347
                     if (model != null)
2410
                     if (model != null)
2348
                     {
2411
                     {
2349
-                        var res = Retu(ua, model, cont, reason, call);
2412
+                        var res = Retu(ua, model, cont, reason, call, isOver);
2350
                         if (res)
2413
                         if (res)
2351
                             return Success("回访成功");
2414
                             return Success("回访成功");
2352
                         else
2415
                         else
2609
         /// <summary>
2672
         /// <summary>
2610
         /// 回访工单
2673
         /// 回访工单
2611
         /// </summary>
2674
         /// </summary>
2612
-        public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason, string call)
2675
+        public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason, string call, int isOver = 0)
2613
         {
2676
         {
2614
             #region 工单处理
2677
             #region 工单处理
2615
             int overtime = 0, sms = 0;
2678
             int overtime = 0, sms = 0;
2626
                 }
2689
                 }
2627
             }
2690
             }
2628
             var opt = "回访";
2691
             var opt = "回访";
2692
+
2629
             int optbut = (int)EnumItemOpt.visit;
2693
             int optbut = (int)EnumItemOpt.visit;
2630
             int wostate = (int)EnumWorkOrderState.evaluate;
2694
             int wostate = (int)EnumWorkOrderState.evaluate;
2695
+            if (isOver==0)
2696
+            {                                                                                                                                                                                                                                                                                                                                                                                                    
2697
+                wostate = (int)EnumWorkOrderState.finish;
2698
+            }
2631
             #region 读取当前登录人部门
2699
             #region 读取当前登录人部门
2632
             string deptname = "";
2700
             string deptname = "";
2633
             var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
2701
             var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
2642
             var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
2710
             var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
2643
             if (itemlast != null)
2711
             if (itemlast != null)
2644
                 touser = itemlast.F_CreateUser;
2712
                 touser = itemlast.F_CreateUser;
2645
-            var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, overtime, sms);
2713
+            var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.evaluate, optbut, touser, 0, nowUser, overtime, sms);
2646
             if (itemid > 0)
2714
             if (itemid > 0)
2647
             {
2715
             {
2648
                 #region 处理工单
2716
                 #region 处理工单
2717
+                model.F_State  = wostate;
2649
                 model.F_VisitOn = DateTime .Now ;
2718
                 model.F_VisitOn = DateTime .Now ;
2650
                 model.F_VisitResult = cont ;
2719
                 model.F_VisitResult = cont ;
2651
                 model.F_VisitReason = reason;
2720
                 model.F_VisitReason = reason;
2715
             {
2784
             {
2716
                 #region 处理工单
2785
                 #region 处理工单
2717
                 model.F_VisitOn = DateTime.Now;
2786
                 model.F_VisitOn = DateTime.Now;
2718
-                
2787
+                model.F_State = wostate;
2719
                 workOrder.Update(model);
2788
                 workOrder.Update(model);
2720
                 #endregion
2789
                 #endregion
2721
                 #region 推送消息
2790
                 #region 推送消息
2813
                 #endregion
2882
                 #endregion
2814
                 #region 向上一级操作人员推送消息
2883
                 #region 向上一级操作人员推送消息
2815
                 var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.F_ID  + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
2884
                 var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.F_ID  + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
2816
-                if (itemlast.F_CreateUser != model.F_CreateBy)
2885
+                if (itemlast!=null )
2817
                 {
2886
                 {
2818
-                    sendsysmsg(model, nowUser, itemlast.F_CreateUser, (int)itemid, opt);
2819
-                    var lastUser = sysUserAccountBll.GetModel(itemlast.F_CreateUser);
2820
-                    if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
2821
-                       sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
2887
+                    if (itemlast.F_CreateUser != model.F_CreateBy)
2888
+                    {
2889
+                        sendsysmsg(model, nowUser, itemlast.F_CreateUser, (int)itemid, opt);
2890
+                        var lastUser = sysUserAccountBll.GetModel(itemlast.F_CreateUser);
2891
+                        if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
2892
+                            sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
2893
+                    }
2822
                 }
2894
                 }
2823
                 #endregion
2895
                 #endregion
2824
                 #region 办理完结向客户发送消息
2896
                 #region 办理完结向客户发送消息
2964
         /// <summary>
3036
         /// <summary>
2965
         /// 转派工单
3037
         /// 转派工单
2966
         /// </summary>
3038
         /// </summary>
2967
-        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int clbm = 0, int clid = 0, float overtime = 0, int sms = 0)
3039
+        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int clbm = 0, int clid = 0, float overtime = 0, int sms = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
2968
         {
3040
         {
2969
             string touser = ""; string tousername = "";
3041
             string touser = ""; string tousername = "";
3042
+            int deptid = 0;
2970
             #region 获取接收人
3043
             #region 获取接收人
2971
             if (clid != 0)
3044
             if (clid != 0)
2972
             {
3045
             {
2973
                 Model.T_Sys_UserAccount clus = sysUserAccountBll.GetModel(clid);
3046
                 Model.T_Sys_UserAccount clus = sysUserAccountBll.GetModel(clid);
3047
+                deptid = clus.F_DeptId;
2974
                 if (clus != null)
3048
                 if (clus != null)
2975
                 {
3049
                 {
2976
                     touser = clus.F_UserCode;
3050
                     touser = clus.F_UserCode;
2980
             else
3054
             else
2981
             {
3055
             {
2982
                 string users = string.Empty;
3056
                 string users = string.Empty;
3057
+                deptid = clbm;
2983
                 var list = sysUserAccountBll.GetModelList(" F_DeptId='" + clbm + "'");
3058
                 var list = sysUserAccountBll.GetModelList(" F_DeptId='" + clbm + "'");
2984
                 foreach (var l in list)
3059
                 foreach (var l in list)
2985
                 {
3060
                 {
2996
                 }
3071
                 }
2997
                 touser = users;
3072
                 touser = users;
2998
             }
3073
             }
3074
+            if (isApprovalp != 0&& deptid == 37)
3075
+            {
3076
+                if (hclid != 0)
3077
+                {
3078
+                    Model.T_Sys_UserAccount clus = sysUserAccountBll .GetModel(hclid);
3079
+                    if (clus != null)
3080
+                    {
3081
+                        if (string.IsNullOrEmpty(touser))
3082
+                        {
3083
+                            touser = touser + "," + clus.F_UserCode;
3084
+                            tousername = tousername + "," + clus.F_UserName + "(" + clus.F_UserCode + ")";
3085
+                        }
3086
+                    }
3087
+                }
3088
+                else
3089
+                {
3090
+                    var list = sysUserAccountBll .GetModelList(" F_DeptId='" + hclbm + "'");
3091
+                    foreach (var l in list)
3092
+                    {
3093
+                        touser = touser + "," + l.F_UserCode;
3094
+                        tousername = tousername + "," + l.F_UserName + "(" + l.F_UserCode + ")";
3095
+                    }
3096
+                }
3097
+            }
2999
             #endregion
3098
             #endregion
3000
             #region 工单处理
3099
             #region 工单处理
3001
             var opt = "指派";
3100
             var opt = "指派";

+ 8 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderNewInput.cs

509
         /// <summary>
509
         /// <summary>
510
         /// 审核状态
510
         /// 审核状态
511
         /// </summary>
511
         /// </summary>
512
-        public int? F_AuditState
512
+        public string  F_AuditState
513
         {
513
         {
514
             get; set;
514
             get; set;
515
         }
515
         }
675
         {
675
         {
676
             get; set;
676
             get; set;
677
         }
677
         }
678
-
678
+        /// <summary>
679
+        /// 高层处理意见
680
+        /// </summary>
681
+        public string F_Highopinions
682
+        {
683
+            get;set;
684
+        }
679
     }
685
     }
680
 }
686
 }

+ 12 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs

94
         private string _f_companyname;
94
         private string _f_companyname;
95
         private string _f_wxopenid;
95
         private string _f_wxopenid;
96
         private string _f_callresults;
96
         private string _f_callresults;
97
+        private string _f_highopinions;
98
+        /// <summary>
99
+        /// 高层处理意见
100
+        /// </summary>
101
+        public string F_Highopinions
102
+        {
103
+            set { _f_highopinions = value; }
104
+            get { return _f_highopinions; }
105
+        }
106
+        /// <summary>
107
+        /// 呼叫结果
108
+        /// </summary>
97
         public string F_Callresults
109
         public string F_Callresults
98
         {
110
         {
99
             set { _f_callresults = value; }
111
             set { _f_callresults = value; }