Explorar el Código

客户管理增加重置密码,工单指派后增加微信推送

zhengbingbing %!s(int64=6) %!d(string=hace) años
padre
commit
576cbffee4

+ 4 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Cus_CustomerBaseNew.cs

@@ -138,6 +138,10 @@ namespace CallCenterApi.BLL
138 138
         {
139 139
             return dal.GetModelByOpenid(openid);
140 140
         }
141
+        public bool UpdatePWD(string ids, string pwd)
142
+        {
143
+            return dal.UpdatePWD(ids, pwd);
144
+        }
141 145
         #endregion  ExtensionMethod
142 146
     }
143 147
 }

BIN
codegit/CallCenterApi/CallCenterApi.BLL/bin/Release/CallCenterApi.DAL.pdb


+ 23 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerBaseNew.cs

@@ -661,6 +661,29 @@ namespace CallCenterApi.DAL
661 661
                 return null;
662 662
             }
663 663
         }
664
+
665
+        /// <summary>
666
+        /// 重置密码
667
+        /// </summary>
668
+        /// <param name="id"></param>
669
+        /// <param name="pwd"></param>
670
+        /// <returns></returns>
671
+        public bool UpdatePWD(string ids,string pwd)
672
+        {
673
+            StringBuilder strSql = new StringBuilder();
674
+            //strSql.Append("delete from T_Cus_CustomerBaseNew ");
675
+            strSql.Append("update T_Cus_CustomerBaseNew set F_WxPassword='"+ pwd + "' ");
676
+            strSql.Append(" where F_CustomerId in (" + ids + ") ");
677
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
678
+            if (rows > 0)
679
+            {
680
+                return true;
681
+            }
682
+            else
683
+            {
684
+                return false;
685
+            }
686
+        }
664 687
         #endregion  ExtensionMethod
665 688
     }
666 689
 }

+ 39 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -488,6 +488,42 @@ namespace CallCenterApi.Interface.Controllers.customer
488 488
                 return Error("获取参数失败");
489 489
             }
490 490
         }
491
+
492
+        /// <summary>
493
+        /// 重置密码
494
+        /// </summary>
495
+        /// <param name="ids"></param>
496
+        /// <returns></returns>
497
+        public ActionResult UpdatePWD(string[] ids)
498
+        {
499
+            if (ids != null && ids.Length > 0)
500
+            {
501
+                string idd = " ";
502
+                foreach (string str in ids)
503
+                {
504
+                    idd += str + ",";
505
+                }
506
+                if (!string.IsNullOrEmpty(idd.Trim()))
507
+                {
508
+                    if (cusbll.UpdatePWD(idd.TrimEnd(','),"123456"))
509
+                    {
510
+                        return Success("设置成功");
511
+                    }
512
+                    else
513
+                    {
514
+                        return Error("设置失败");
515
+                    }
516
+                }
517
+                else
518
+                {
519
+                    return Error("请选择用户");
520
+                }
521
+            }
522
+            else
523
+            {
524
+                return Error("获取参数失败");
525
+            }
526
+        }
491 527
         #endregion
492 528
         #region 联系人
493 529
         /// <summary>
@@ -815,6 +851,9 @@ namespace CallCenterApi.Interface.Controllers.customer
815 851
                         var conmodel = new Model.T_Cus_ContactPersonNew();
816 852
                         #region  信息对应
817 853
                         //报税会计  做账会计  编号  客服  公司名称  负责人电话       交接日期
854
+                        if ((dataRow["编号"] == null || dataRow["编号"].ToString() == "")
855
+                            || (dataRow["公司名称"] == null || dataRow["公司名称"].ToString() == ""))
856
+                        { continue; }
818 857
                         cusmodel.F_CustomerCode = dataRow["编号"].ToString();
819 858
                         cusmodel.F_CompanyName = dataRow["公司名称"].ToString();
820 859
                         //判断编号唯一

+ 25 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -2,6 +2,7 @@
2 2
 using CallCenterApi.Common;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterAPI.WechatSDK;
5 6
 using System;
6 7
 using System.Collections.Generic;
7 8
 using System.Data;
@@ -654,6 +655,7 @@ namespace CallCenterApi.Interface.Controllers.tel
654 655
                             if (isover == 0) {
655 656
                                 if (clbm != 0 || clid != 0)
656 657
                                 {
658
+                                    #region 工单记录
657 659
                                     Model.T_Wo_WorkOrderItem item = new Model.T_Wo_WorkOrderItem();
658 660
                                     item.ToUser = users;
659 661
                                     item.WorkOrderID = model.WorkOrderID;
@@ -670,6 +672,7 @@ namespace CallCenterApi.Interface.Controllers.tel
670 672
                                     item.CreateUser = ua.F_UserCode;
671 673
                                     item.CreateTime = DateTime.Now;
672 674
                                     long itemid = new BLL.T_Wo_WorkOrderItem().Add(item);
675
+                                    #endregion
673 676
                                     if (itemid > 0)
674 677
                                     {
675 678
                                         string strmsg = string.Empty;
@@ -687,12 +690,32 @@ namespace CallCenterApi.Interface.Controllers.tel
687 690
 
688 691
                                         new BLL.T_Msg_List().Add(msg);
689 692
                                         #endregion
693
+                                        #region 派单后发送微信推送
694
+                                        if (model.State == 1)
695
+                                        {//已派单状态
696
+                                            var modelUser2 = sysUserAccountBll.GetModel(clid);  //被指派人
697
+                                            if (modelUser2 != null)
698
+                                            {
699
+                                                if (!string.IsNullOrEmpty(modelUser2.F_WxOpenId))
700
+                                                {
701
+                                                    var dicv = dicvalueBll.GetModel(model.TypeClass.Value);
702
+                                                    string content = string.Empty;
703
+                                                    if (dicv != null)
704
+                                                    {
705
+                                                        content = "客户" + model.Customer + "提出的" + dicv.F_Name + "类型的工单,"
706
+                                                          + "\n反馈内容为:" + (string.IsNullOrEmpty(model.Detail) ? "" : model.Detail);
707
+                                                    }
708
+                                                    WxHelper.SendWechatMsg(model.WorkOrderID, "创建且派单成功!", "创建且派单成功,请查看工单详情", content, "", orderid.ToString(), modelUser2.F_WxOpenId);
709
+                                                }
710
+                                            }
711
+                                        }
712
+                                        #endregion
690 713
                                         res = Success("处理成功");
691 714
                                     }
692 715
                                 }
693 716
                             }
694 717
                             #endregion
695
-
718
+                            #region 通话记录绑定工单
696 719
                             if (!string.IsNullOrEmpty(callid))
697 720
                             {
698 721
                                 var rec = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
@@ -702,7 +725,7 @@ namespace CallCenterApi.Interface.Controllers.tel
702 725
                                     new BLL.T_Call_CallRecords().Update(rec);
703 726
                                 }
704 727
                             }
705
-                            
728
+                            #endregion
706 729
                             res = Success("新增成功!");
707 730
                         }
708 731
                         else

+ 30 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -2,6 +2,7 @@
2 2
 using CallCenterApi.Common;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterAPI.WechatSDK;
5 6
 using System;
6 7
 using System.Collections.Generic;
7 8
 using System.Data;
@@ -15,6 +16,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
15 16
     {
16 17
         BLL.T_Wo_WorkOrder_Logs blllogs = new BLL.T_Wo_WorkOrder_Logs();
17 18
         BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
19
+        private BLL.T_Sys_UserAccount sysUserAccountBll = new BLL.T_Sys_UserAccount();
20
+        private BLL.T_Sys_DictionaryValue dicvalueBll = new BLL.T_Sys_DictionaryValue();
18 21
 
19 22
         #region 工单状态
20 23
         public ActionResult GetWorkState()
@@ -820,6 +823,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
820 823
                                 item.ToUser = users;
821 824
                             }
822 825
                             #endregion
826
+                            #region 工单记录
823 827
                             item.WorkOrderID = orderid;
824 828
                             item.Type = 1;      //处理
825 829
                             item.ToDept = clbm; //部门
@@ -841,9 +845,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
841 845
                             item.IsTimeOut = 0;
842 846
                             item.CreateUser = ua.F_UserCode;
843 847
                             item.CreateTime = DateTime.Now;
848
+                            #endregion
844 849
                             long itemid = new BLL.T_Wo_WorkOrderItem().Add(item);
845 850
                             if (itemid > 0)
846 851
                             {
852
+                                #region
847 853
                                 string strmsg = string.Empty;
848 854
 
849 855
                                 strmsg = ua.F_UserName + "完结了工单,单号:" + model.WorkOrderID;
@@ -876,7 +882,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
876 882
                                 //model.Detail = detail;
877 883
 
878 884
                                 new BLL.T_Wo_WorkOrder().Update(model);
879
-
885
+                                #endregion
880 886
                                 #region 消息表
881 887
                                 Model.T_Msg_List msg = new Model.T_Msg_List();
882 888
                                 msg.Type = 1;//处理
@@ -890,6 +896,29 @@ namespace CallCenterApi.Interface.Controllers.workorder
890 896
 
891 897
                                 new BLL.T_Msg_List().Add(msg);
892 898
                                 #endregion
899
+                                #region 派单后发送微信推送
900
+                                if (clid != 0)
901
+                                {
902
+                                    if (model.State == 1)
903
+                                    {//已派单状态
904
+                                        var modelUser2 = sysUserAccountBll.GetModel(clid);  //被指派人
905
+                                        if (modelUser2 != null)
906
+                                        {
907
+                                            if (!string.IsNullOrEmpty(modelUser2.F_WxOpenId))
908
+                                            {
909
+                                                var dicv = dicvalueBll.GetModel(model.TypeClass.Value);
910
+                                                string content = string.Empty;
911
+                                                if (dicv != null)
912
+                                                {
913
+                                                    content = "客户" + model.Customer + "提出的" + dicv.F_Name + "类型的工单已派单,"
914
+                                                      + "\n反馈内容为:" + (string.IsNullOrEmpty(model.Detail) ? "" : model.Detail);
915
+                                                }
916
+                                                WxHelper.SendWechatMsg(model.WorkOrderID, "派单成功!", "派单成功,请查看工单详情", content, "", orderid.ToString(), modelUser2.F_WxOpenId);
917
+                                            }
918
+                                        }
919
+                                    }
920
+                                }
921
+                                #endregion
893 922
                                 res = Success("处理成功");
894 923
                             }
895 924
                         }