|
|
@@ -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
|
|