Просмотр исходного кода

给业务员发送短信,地址修改,五个报表,列表修改

duhongyu лет назад: 6
Родитель
Сommit
b3d5e70c41

+ 15 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

@@ -37,7 +37,21 @@ namespace CallCenterApi.Interface.Controllers
37 37
                 return Error ("发送失败,请检查客户电话");
38 38
             }
39 39
         }
40
-      
40
+        public ActionResult SMSSendSalesman(string name, string phone, string cusphone)
41
+        {
42
+
43
+            SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,刚有客户反馈有关市场业务/产品/农化问题,请你及时联系提供服务。姓名:"+ name + ",电话:"+ phone + "。");
44
+
45
+            if (result != null)
46
+            {
47
+                return Success("发送短信", result);
48
+            }
49
+            else
50
+            {
51
+                return Error("发送失败,请检查客户电话");
52
+            }
53
+        }
54
+
41 55
         /// <summary>
42 56
         /// 单发短信
43 57
         /// </summary>

+ 16 - 13
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController.cs

@@ -70,20 +70,23 @@ namespace CallCenterApi.Interface.Controllers.customer
70 70
             F_Layer = F_Layer - 1;
71 71
             if (!string.IsNullOrEmpty(F_RegionName.Trim()))
72 72
             {
73
-                if (F_Layer == 2)
73
+                if (F_ParentId>0)
74 74
                 {
75
-                    entityJson1 = regionBLL.GetModel(F_ParentId);
76
-                }
77
-                else if (F_Layer == 3)
78
-                {
79
-                    entityJson2 = regionBLL.GetModel(F_ParentId);
80
-                    entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
81
-                }
82
-                else if (F_Layer == 4)
83
-                {
84
-                    entityJson3 = regionBLL.GetModel(F_ParentId);
85
-                    entityJson2 = regionBLL.GetModel(int.Parse(entityJson3.F_ParentId.ToString()));
86
-                    entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
75
+                    if (F_Layer == 2)
76
+                    {
77
+                        entityJson1 = regionBLL.GetModel(F_ParentId);
78
+                    }
79
+                    else if (F_Layer == 3)
80
+                    {
81
+                        entityJson2 = regionBLL.GetModel(F_ParentId);
82
+                        entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
83
+                    }
84
+                    else if (F_Layer == 4)
85
+                    {
86
+                        entityJson3 = regionBLL.GetModel(F_ParentId);
87
+                        entityJson2 = regionBLL.GetModel(int.Parse(entityJson3.F_ParentId.ToString()));
88
+                        entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
89
+                    }
87 90
                 }
88 91
             }
89 92
             var obj = new

+ 267 - 16
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -797,6 +797,7 @@ namespace CallCenterApi.Interface.Controllers.report
797 797
 
798 798
             return Success("获取成功", markets);
799 799
         }
800
+
800 801
         public class Department
801 802
         {
802 803
             public string dapatname;
@@ -822,6 +823,108 @@ namespace CallCenterApi.Interface.Controllers.report
822 823
             }
823 824
             return str;
824 825
         }
826
+        /// <summary>
827
+        /// 导出部门工单数量表
828
+        /// </summary>
829
+        /// <param name="stime"></param>
830
+        /// <param name="endtime"></param>
831
+        /// <returns></returns>
832
+        public ActionResult ExitDepartmentlist(string stime, string endtime)
833
+        {
834
+            DataTable dt = new DataTable();
835
+            string sql = $"  F_IsDelete=0";
836
+            if (stime != null && stime.Trim() != "")
837
+            {
838
+                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
839
+            }
840
+            if (endtime != null && endtime.Trim() != "")
841
+            {
842
+                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
843
+            }
844
+            var tab = new BLL.T_Sys_Department().GetModelList(" F_State=1 and F_Layer=0");
845
+            List<int> modeldeptid = new List<int>();
846
+            List<string> modeldeptname = new List<string>();
847
+            foreach (var it in tab)
848
+            {
849
+                if (GetDeptWorkOrderID(it.F_DeptId) > 0)
850
+                {
851
+                    modeldeptid.Add(it.F_DeptId);
852
+                    modeldeptname.Add(it.F_DeptName);
853
+                }
854
+            }
855
+            dt.Columns.Add("部门名称");
856
+            dt.Columns.Add("待接单");
857
+            dt.Columns.Add("待处理");
858
+            dt.Columns.Add("已处理");
859
+            dt.Columns.Add("超期数量");
860
+            dt.Columns.Add("满意数量");
861
+            dt.Columns.Add("不满意数量");
862
+            
863
+            for (int i = 0; i < modeldeptid.Count; i++)
864
+            {
865
+                DataRow drNew = dt.NewRow();
866
+                var itemlist = itembll.GetModelList("F_NextDept=" + modeldeptid[i]);
867
+                drNew["部门名称"] = modeldeptname[i];
868
+                int pending = 0; int beprocessed = 0; int processed = 0; int Overdue = 0; int satisfied = 0; int dissatisfied = 0;
869
+                foreach (var it in itemlist)
870
+                {
871
+                    if (it.F_IsUsed == 0 && it.F_OptType == 1)
872
+                    {
873
+                        pending++;
874
+                        var Overworkorder = woBLL.GetModelList(sql +"and F_IsOver=1 and F_ID=" + it.F_WoID);
875
+                        Overdue++;
876
+                    }
877
+                    if (it.F_OptType == 2 && it.F_IsUsed == 0)
878
+                    {
879
+                        beprocessed++;
880
+                        var Overworkorder = woBLL.GetModelList(sql + "and F_IsOver=1 and F_ID=" + it.F_WoID);
881
+                        Overdue++;
882
+                    }
883
+                }
884
+                var user = new BLL.T_Sys_UserAccount().GetModelList("  F_DeptId =" + modeldeptid[i]);
885
+                foreach (var it in user)
886
+                {
887
+                    if (it.F_RoleId == 59)
888
+                    {
889
+                        var workorder = woBLL.GetModelList(sql + "and F_State=10 and F_DealBy='" + it.F_UserCode + "'");
890
+                        processed += workorder.Count;
891
+                        foreach (var im in workorder)
892
+                        {
893
+                            if (im.F_IsOver == 1)
894
+                                Overdue++;
895
+                            if (im.F_VisitResult == "满意" || im.F_VisitResult == "非常满意")
896
+                                satisfied++;
897
+                            if (im.F_VisitResult == "不满意")
898
+                                dissatisfied++;
899
+                        }
900
+                    }
901
+                    
902
+                }
903
+                drNew["待接单"]  = pending;
904
+                drNew["待处理"] = beprocessed;
905
+                drNew["已处理"] = processed;
906
+                drNew["超期数量"] = Overdue;
907
+                drNew["满意数量"] = satisfied;
908
+                drNew["不满意数量"] = dissatisfied;
909
+                dt.Rows.Add(drNew);
910
+            }
911
+            NPOIHelper npoi = new NPOIHelper();
912
+            if (npoi.ExportToExcel("部门工单数量表", dt) == "")
913
+            {
914
+                return Success("导出成功");
915
+            }
916
+            else
917
+            {
918
+                return Error("导出失败");
919
+
920
+            }
921
+        }
922
+        /// <summary>
923
+        /// 部门工单数量表
924
+        /// </summary>
925
+        /// <param name="stime"></param>
926
+        /// <param name="endtime"></param>
927
+        /// <returns></returns>
825 928
         public ActionResult GetDepartmentList(string stime, string endtime)
826 929
         {
827 930
             string sql = $"  F_IsDelete=0";
@@ -850,19 +953,19 @@ namespace CallCenterApi.Interface.Controllers.report
850 953
                 var itemlist = itembll.GetModelList("F_NextDept=" + modeldeptid[i]);
851 954
                 Department model = new Department();
852 955
                 model.dapatname = modeldeptname[i];
853
-                int pending = 0;int beprocessed = 0;int processed = 0;int Overdue = 0;
956
+                int pending = 0;int beprocessed = 0;int processed = 0;int Overdue = 0;int satisfied = 0;int dissatisfied = 0;
854 957
                 foreach (var it in itemlist)
855 958
                 {
856 959
                     if (it .F_IsUsed ==0&&it .F_OptType ==1)
857 960
                     {
858 961
                         pending++;
859
-                        var Overworkorder = woBLL.GetModelList("F_IsOver=1 and F_ID="+ it.F_WoID );
962
+                        var Overworkorder = woBLL.GetModelList(sql +"and F_IsOver=1 and F_ID="+ it.F_WoID );
860 963
                         Overdue++;
861 964
                     }
862 965
                     if (it .F_OptType ==2&& it.F_IsUsed == 0)
863 966
                     {
864 967
                         beprocessed++;
865
-                        var Overworkorder = woBLL.GetModelList("F_IsOver=1 and F_ID=" + it.F_WoID);
968
+                        var Overworkorder = woBLL.GetModelList(sql + "and F_IsOver=1 and F_ID=" + it.F_WoID);
866 969
                         Overdue++;
867 970
                     }
868 971
                 }
@@ -871,26 +974,174 @@ namespace CallCenterApi.Interface.Controllers.report
871 974
                 {
872 975
                     if (it.F_RoleId == 59)
873 976
                     {
874
-                        var workorder = woBLL.GetModelList("F_State=10 and F_DealBy='" + it.F_UserCode + "'");
977
+                        var workorder = woBLL.GetModelList(sql + "and F_State=10 and F_DealBy='" + it.F_UserCode + "'");
875 978
                         processed += workorder.Count;
876
-                        var Overworkorder = woBLL.GetModelList("F_IsOver=1 and F_DealBy='" + it.F_UserCode + "'");
877
-                        Overdue++;
979
+                        foreach (var im in workorder)
980
+                        {
981
+                            if (im .F_IsOver ==1)
982
+                                Overdue++;
983
+                            if (im.F_VisitResult == "满意" || im.F_VisitResult == "非常满意")
984
+                                satisfied++;
985
+                            if (im.F_VisitResult == "不满意")
986
+                                dissatisfied++;
987
+                        }
878 988
                     }
879 989
                 }
880
-                //public int processed;//已处理
881
-                //public int Overdue;//超期
882
-                //public int satisfied;//满意
883
-                //public int dissatisfied;//不满意
990
+                model.pending = pending;
991
+                model.beprocessed = beprocessed;
992
+                model.processed = processed;
993
+                model.Overdue = Overdue;
994
+                model.satisfied = satisfied;
995
+                model.dissatisfied = dissatisfied;
996
+                Departmentlist.Add(model);
884 997
             }
885
-            return null;
998
+            if (Departmentlist.Count > 0)
999
+            {
1000
+                for (int j = 0; j < Departmentlist.Count - 1; j++)
1001
+                {
1002
+                    for (int z = 0; z < Departmentlist.Count - 1 - j; z++)
1003
+                    {
1004
+                        if (Departmentlist[z].processed < Departmentlist[z + 1].processed)
1005
+                        {
1006
+                            var temp = Departmentlist[z + 1];
1007
+                            Departmentlist[z + 1] = Departmentlist[z];
1008
+                            Departmentlist[z] = temp;
1009
+                        }
1010
+                    }
1011
+                }
1012
+            }
1013
+            return Success("获取成功", Departmentlist);
886 1014
         }
1015
+        public class Returnvisit
1016
+        {
1017
+            public string name;
1018
+            public int bevisit;
1019
+            public int visit;
1020
+            public int Overdue;
1021
+            public int satisfied;
1022
+            public int dissatisfied;
1023
+        }
1024
+        /// <summary>
1025
+        /// 导出客户回访数量表
1026
+        /// </summary>
1027
+        /// <param name="stime"></param>
1028
+        /// <param name="endtime"></param>
1029
+        /// <returns></returns>
1030
+        public ActionResult ExitReturnvisitList(string stime, string endtime)
1031
+        {
1032
+            DataTable dt = new DataTable();
1033
+            string sql = $"  F_IsDelete=0";
1034
+            if (stime != null && stime.Trim() != "")
1035
+            {
1036
+                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
1037
+            }
1038
+            if (endtime != null && endtime.Trim() != "")
1039
+            {
1040
+                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
1041
+            }
1042
+            dt.Columns.Add("类别");
1043
+            dt.Columns.Add("待回访");
1044
+            dt.Columns.Add("已回访");
1045
+            dt.Columns.Add("回访总数");
1046
+            dt.Columns.Add("超期数量");
1047
+            dt.Columns.Add("满意数量");
1048
+            dt.Columns.Add("不满意数量");
1049
+            var workordewr = woBLL.GetModelList(sql + "and F_State in(10,11) and F_IsVisit =1");
1050
+            string name = "客户回访"; int bevisit = 0, visit = 0, Overdue = 0, satisfied = 0, dissatisfied = 0; int visitcont = 0;
1051
+            var workorder = woBLL.GetModelList(sql + "and F_State in(10,11)");
1052
+            visitcont = workorder.Count;
1053
+            foreach (var it in workordewr)
1054
+            {
1055
+                if (it.F_State == 10)
1056
+                    bevisit++;
1057
+                if (it.F_State == 11)
1058
+                    visit++;
1059
+                if (it.F_IsOver  == 1)
1060
+                    Overdue++;
1061
+                if (it.F_VisitResult == "满意" || it.F_VisitResult == "非常满意")
1062
+                    satisfied++;
1063
+                if (it.F_VisitResult == "不满意")
1064
+                    dissatisfied++;
1065
+            }
1066
+            var obj = new
1067
+            {
1068
+                name,
1069
+                bevisit,
1070
+                visit,
1071
+                visitcont,
1072
+                Overdue,
1073
+                satisfied,
1074
+                dissatisfied
1075
+            };
1076
+              DataRow drNew = dt.NewRow();
1077
+              drNew["类别"] = name;
1078
+              drNew["待回访"] = bevisit;
1079
+                drNew["已回访"] = visit;
1080
+                drNew["回访总数"] = visitcont;
1081
+                drNew["超期数量"] = Overdue;
1082
+                drNew["满意数量"] = satisfied;
1083
+                drNew["不满意数量"] = dissatisfied;
1084
+                dt.Rows.Add(drNew);
1085
+          
1086
+            NPOIHelper npoi = new NPOIHelper();
1087
+            if (npoi.ExportToExcel("客户回访数量表", dt) == "")
1088
+            {
1089
+                return Success("导出成功");
1090
+            }
1091
+            else
1092
+            {
1093
+                return Error("导出失败");
887 1094
 
1095
+            }
1096
+        }
1097
+        /// <summary>
1098
+        /// 客户回访数量表
1099
+        /// </summary>
1100
+        /// <param name="stime"></param>
1101
+        /// <param name="endtime"></param>
1102
+        /// <returns></returns>
1103
+        public ActionResult GetReturnvisitList(string stime, string endtime)
1104
+        {
1105
+            string sql = $"  F_IsDelete=0";
1106
+            if (stime != null && stime.Trim() != "")
1107
+            {
1108
+                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
1109
+            }
1110
+            if (endtime != null && endtime.Trim() != "")
1111
+            {
1112
+                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
1113
+            }
1114
+            var workordewr = woBLL.GetModelList(sql + "and F_State in(10,11) and F_IsVisit =1");
1115
+          string name="客户回访"; int bevisit = 0, visit = 0, Overdue = 0, satisfied = 0, dissatisfied = 0;int visitcont = 0;
1116
+            var workorder = woBLL.GetModelList(sql + "and F_State in(10,11)");
1117
+            visitcont = workorder.Count;
1118
+            foreach (var it in workordewr)
1119
+            {
1120
+                if (it.F_State == 10)
1121
+                    bevisit++;
1122
+                if (it.F_State == 11)
1123
+                    visit++;
1124
+                if (it.F_IsOver == 1)
1125
+                    Overdue++;
1126
+                if (it.F_VisitResult == "满意" || it.F_VisitResult == "非常满意")
1127
+                    satisfied++;
1128
+                if (it.F_VisitResult == "不满意")
1129
+                    dissatisfied++;
1130
+            }
1131
+            var obj = new
1132
+            {
1133
+                name,
1134
+                bevisit,
1135
+                visit,
1136
+                visitcont,
1137
+                Overdue,
1138
+                satisfied,
1139
+                dissatisfied
1140
+            };
1141
+            return Success("获取成功", obj
1142
+           );
888 1143
 
889
-
890
-
891
-
892
-
893
-
1144
+        }
894 1145
 
895 1146
 
896 1147
 

+ 29 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -3712,8 +3712,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
3712 3712
                     model.F_DealType = model1[i].F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
3713 3713
                     model.SuperiorOpinion = AssCont(model1[i].F_ID );//上级处理意见
3714 3714
                     #endregion
3715
-
3716
-
3717 3715
                     if (!string .IsNullOrEmpty (model1[i].F_QuestionType) )
3718 3716
                     {
3719 3717
                         try
@@ -3857,6 +3855,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3857 3855
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
3858 3856
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
3859 3857
                     model.DelayTimelimit = DelayTimelimit(model1[i].F_ID, model1[i].F_limit);//申请时限
3858
+                    model.DelayTimename = DelayDeptid(model1[i].F_ID);//申请部门
3860 3859
                     model.F_Reasontimeout= model1[i].F_Reasontimeout;//超时原因
3861 3860
                     Model.T_Sys_UserAccount ua = new T_Sys_UserAccount();
3862 3861
                     if (userId>0)
@@ -3920,10 +3919,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
3920 3919
             var itemlist = itembll.GetModelList("F_WoID="+ id + "and F_OptType="+ (int)EnumItemOpt.Delay+ "and F_ItemType = " + (int)EnumItemType.Delay);
3921 3920
             foreach (var it in itemlist )
3922 3921
             {
3922
+               
3923 3923
                 time = int.Parse(it.F_LimitTime) - limit;
3924 3924
             }
3925 3925
             return time;
3926 3926
         }
3927
+        private string DelayDeptid(int id)
3928
+        {
3929
+            string str = "";
3930
+           
3931
+            var itemlist = itembll.GetModelList("F_WoID=" + id + "and F_OptType=" + (int)EnumItemOpt.Delay + "and F_ItemType = " + (int)EnumItemType.Delay);
3932
+            string usercode="";
3933
+            foreach (var it in itemlist)
3934
+            {
3935
+                usercode = it.F_CreateUser;
3936
+            }
3937
+            
3938
+            if (usercode!="")
3939
+            {
3940
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(usercode);
3941
+                if (ua!=null )
3942
+                {
3943
+                    Model.T_Sys_Department dModel = departmentBLL.GetModel(ua.F_DeptId);
3944
+                    if (dModel!=null )
3945
+                    {
3946
+                        str = dModel.F_DeptName;
3947
+                    }
3948
+                    }
3949
+                }
3950
+            
3951
+            return str;
3952
+        }
3927 3953
         /// <summary>
3928 3954
         /// 是否超时
3929 3955
         /// </summary>
@@ -4578,6 +4604,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4578 4604
                     modlelist.F_DealTime =DateTime .Now ;// 处理时间
4579 4605
                     modlelist.F_DealContent = input.F_DealContent;//完结内容
4580 4606
                     modlelist.F_DealType = "当即办理";//处理方式:当即办理、电话转接、网络转办
4607
+                    model.F_IsVisit = 0;
4581 4608
                     bool f = workOrder  .Update(modlelist);
4582 4609
                     if (!f )
4583 4610
                     {

+ 7 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderNewInput.cs

@@ -773,6 +773,13 @@ namespace CallCenterApi.Interface.Models.Input
773 773
             get; set;
774 774
         }
775 775
         ///// <summary>
776
+        ///// 延期时限
777
+        ///// </summary>
778
+        public string  DelayTimename
779
+        {
780
+            get; set;
781
+        }
782
+        ///// <summary>
776 783
         ///// 超时原因
777 784
         ///// </summary>
778 785
         public string F_Reasontimeout