Procházet zdrojové kódy

五级归口接口处理

zhengbingbing %!s(int64=6) %!d(string=před) roky
rodič
revize
e23697808b

+ 27 - 5
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/InfoController.cs

@@ -2101,29 +2101,51 @@ namespace CallCenterApi.Interface.Controllers
2101 2101
         /// </summary>
2102 2102
         /// <param name="parentid"></param>
2103 2103
         /// <returns></returns>
2104
-        public ActionResult GetDemandsTypes(int parentid=0)
2104
+        public ActionResult GetDemandsTypes(DateTime? start, DateTime? end,int parentid=0)
2105 2105
         {
2106 2106
             var sql = "";
2107 2107
             if (parentid > 0)
2108 2108
             {
2109 2109
                 var model = demandstypebll.GetModel(parentid);
2110 2110
                 if (model != null)
2111
-                {
2112 2111
                     sql = " and F_layer=4 and F_Code like '" + model.F_Code + "%'";
2113
-                }
2114 2112
             }
2115 2113
             else
2116 2114
                 sql = " and F_ParentId=0 ";
2115
+
2116
+            string sqltype = $" select F_DemandsTypeID,count(1) cc from dbo.T_Bus_WorkOrder where F_IsDelete=0 ";
2117
+            string sqlwo = $" select count(1) cc from dbo.T_Bus_WorkOrder where F_IsDelete=0 ";
2118
+            if (start == null) { start = DateTime.Now; }
2119
+            if (end == null) { end = DateTime.Now; }
2120
+            sqlwo += $" and datediff(day,F_CreateTime,'{start.Value.ToString("yyyy-MM-dd")}')<=0 and datediff(day,F_CreateTime,'{end.Value.ToString("yyyy-MM-dd")}')>=0 ";
2121
+            sqltype += $" and datediff(day,F_CreateTime,'{start.Value.ToString("yyyy-MM-dd")}')<=0 and datediff(day,F_CreateTime,'{end.Value.ToString("yyyy-MM-dd")}')>=0 ";
2122
+            sqltype += $" group by F_DemandsTypeID";
2123
+
2124
+
2125
+            DataTable dttype = DbHelperSQL.Query(sqltype).Tables[0];
2126
+            DataTable dt = DbHelperSQL.Query(sqlwo).Tables[0];
2127
+            var count = 0;
2128
+            var drs = dt.Select();
2129
+            if (drs.Length > 0)
2130
+                count = (from DataRow dr in drs select dr.Field<int>("cc")).FirstOrDefault();
2131
+
2117 2132
             if (sql != "")
2118 2133
             {
2119 2134
                 var list = demandstypebll.GetModelList(" F_IsDelete=0 " + sql);
2120 2135
                 var newlist = list.Select(d=>{
2136
+                    var drin = dttype.Select("F_DemandsTypeID='" + d.F_Id + "'");
2137
+                    var counts = 0;
2138
+                    if (drin.Length > 0)
2139
+                        counts = (from DataRow dr in drin select dr.Field<int>("cc")).FirstOrDefault();
2140
+                    var percent = "0%";
2141
+                    if (count > 0)
2142
+                        percent = (counts / count * 100).ToString("f2") + "%";
2121 2143
                     return new
2122 2144
                     {
2123 2145
                         d.F_Id,
2124 2146
                         d.F_Name,
2125
-                        count = 0,
2126
-                        percent = "0%"
2147
+                        count = counts,
2148
+                        percent = percent
2127 2149
                     };
2128 2150
                 });
2129 2151
                 return Success("加载成功", newlist);

+ 8 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -6563,6 +6563,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
6563 6563
 
6564 6564
                 int isprotect = RequestString.GetInt("isprotect", 0);
6565 6565
                 int level = RequestString.GetInt("level", 0);
6566
+                int demandstype = RequestString.GetInt("demandstype", 0);//诉求分类编号
6566 6567
 
6567 6568
                 Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
6568 6569
                 if (modelT_Bus_WorkOrder != null)
@@ -6595,7 +6596,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
6595 6596
 
6596 6597
                         modelT_Bus_WorkOrder.F_Key = keys;
6597 6598
                         modelT_Bus_WorkOrder.F_Level = level;
6598
-
6599
+                        if (demandstype > 0)
6600
+                        {
6601
+                            modelT_Bus_WorkOrder.F_DemandsTypeID = demandstype;
6602
+                            Model.T_Bus_DemandsType dModel = demandstypeBLL.GetModel(demandstype);
6603
+                            if (dModel != null)
6604
+                                modelT_Bus_WorkOrder.F_DemandsType = dModel.F_Code;
6605
+                        }
6599 6606
                         workorderBLL.Update(modelT_Bus_WorkOrder);
6600 6607
                         #endregion
6601 6608
 

binární
sql/sql_20191206.sql


+ 39 - 0
sql/sql_20191206_新野清理语句.sql

@@ -0,0 +1,39 @@
1
+truncate table rep_agent_detail
2
+truncate table rep_agent_state
3
+truncate table rep_agentState_Detail
4
+truncate table rep_agentState_Duration
5
+truncate table rep_conference
6
+truncate table rep_ext_call_in
7
+truncate table rep_ext_call_out
8
+truncate table rep_host
9
+truncate table rep_transfer
10
+truncate table rep_trunk_call_in
11
+
12
+update stat_callid set value=1 where id=1
13
+
14
+truncate table T_Bus_AssignedInfo
15
+truncate table T_Bus_AssignedItemInfo
16
+truncate table T_Bus_DelayTime
17
+truncate table T_Bus_Feedback
18
+truncate table T_Bus_Operation
19
+truncate table T_Bus_RemindRecord
20
+truncate table T_Bus_SubmitSuper
21
+truncate table T_Bus_VisitResult
22
+truncate table T_Bus_VisitResultRecords
23
+truncate table T_Bus_WorkOrder
24
+truncate table T_Call_Blacklist
25
+truncate table T_Call_CallRecords
26
+truncate table T_Call_LeaveRecord
27
+truncate table T_Call_RecordSet
28
+truncate table T_Call_TaskTelNum
29
+truncate table T_Email_EmailMessage_Map
30
+truncate table T_Msg_Chat
31
+truncate table T_Msg_Chat_Map
32
+truncate table T_SMS_InternalMessages
33
+truncate table T_Sys_Accessories
34
+truncate table T_Sys_LoginLogs
35
+
36
+truncate table T_Sys_MobileData
37
+
38
+truncate table T_Cus_AddressBook
39
+truncate table T_Cus_CustomerBase