Kaynağa Gözat

通话记录接口

gaobingyue 5 yıl önce
ebeveyn
işleme
47f3bc4548

+ 106 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/BusinessDockController.cs

@@ -206,7 +206,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
206 206
                  //    0, 0, 0, 0, 0);
207 207
 
208 208
                 AddGriddingLogs(uuid, port_password, "search", "Callrecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, "0", "", "", "", "", "", "", "", "", "", "",
209
-                     obj1[3].ToString(), "通讯记录", "查询表单",
209
+                     obj1[2].ToString(), "通讯记录", "查询表单",
210 210
                     0, 0, 0, 0, 0);
211 211
 
212 212
 
@@ -221,8 +221,112 @@ namespace CallCenterApi.Interface.Controllers.workorder
221 221
 
222 222
 
223 223
 
224
+        [AutoComplete(true)]
225
+        public ActionResult GetWorkOrderbyCallId()
226
+        {
227
+
228
+            string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
229
+            string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
230
+            string content = HttpUtility.UrlDecode(RequestString.GetQueryString("content"));//查收详情
231
+            string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
232
+            int id = Convert.ToInt32(HttpUtility.UrlDecode(RequestString.GetQueryString("callid")));
233
+
234
+            //#region 参数验证
235
+            if (string.IsNullOrEmpty(uuid))
236
+            {
237
+                ajresult.state = (int)CodeStatus.ID不存在;
238
+                ajresult.message = "客户唯一标识不能为空";
239
+                return Process();
240
+            }
241
+            else if (uuid.Length > 50)
242
+            {
243
+                ajresult.state = (int)CodeStatus.字符串超出长度;
244
+                ajresult.message = "客户唯一标识超出长度";
245
+                return Process();
246
+            }
247
+
248
+            if (string.IsNullOrEmpty(usercode))
249
+            {
250
+                ajresult.state = (int)CodeStatus.必填字段为空;
251
+                ajresult.message = "工号不能为空";
252
+                return Process();
253
+            }
254
+
255
+            if (!Common.CodeValidate.ICodeValidateGridding(uuid, port_password))
256
+            {
257
+                ajresult.state = (int)CodeStatus.安全验证未通过;
258
+                ajresult.message = "安全验证未通过";
259
+                AddGriddingLogs(uuid, port_password, "search", "T_Rec_RegRecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, id.ToString(), "", "", "", "", "", "", "", "", "", "",
260
+                   "", "通讯记录", "查看工单详情",
261
+                  0, 0, 0, 0, 0);
262
+                return Process();
263
+            }
264
+
265
+            if (id <= 0)
266
+            {
267
+                ajresult.state = (int)CodeStatus.执行失败;
268
+                ajresult.message = "操作失败,获取参数失败";
269
+                AddGriddingLogs(uuid, port_password, "search", "T_Rec_RegRecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, id.ToString(), "", "", "", "", "", "", "", "", "", "",
270
+                   "", "通讯记录", "查看工单详情",
271
+                  0, 0, 0, 0, 0);
272
+                return Process();
273
+            }
274
+            // return Error("获取参数失败");
275
+
276
+            BLL.T_Rec_RegRecords dBLL = new BLL.T_Rec_RegRecords();
277
+            var dModel = dBLL.GetModelList("F_CallId='" + id + "'").FirstOrDefault();
278
+            var cusmodel = new Model.T_Cus_Customer();
279
+            if (dModel == null)
280
+            {
281
+                ajresult.state = (int)CodeStatus.执行失败;
282
+                ajresult.message = "操作失败,获取登记信息失败";
283
+                AddGriddingLogs(uuid, port_password, "search", "T_Rec_RegRecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, id.ToString(), "", "", "", "", "", "", "", "", "", "",
284
+                   "", "通讯记录", "查看工单详情",
285
+                  0, 0, 0, 0, 0);
286
+                return Process();
287
+               
288
+            }
289
+
290
+             if (dModel.F_CusID > 0)
291
+            {
292
+                cusmodel = new BLL.T_Cus_Customer().GetModel(dModel.F_CusID);
293
+                if (cusmodel == null)
294
+                {
295
+                    ajresult.state = (int)CodeStatus.执行失败;
296
+                    ajresult.message = "操作失败,获取档案信息失败";
297
+                    AddGriddingLogs(uuid, port_password, "search", "T_Rec_RegRecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, id.ToString(), "", "", "", "", "", "", "", "", "", "",
298
+                   "", "通讯记录", "查看工单详情",
299
+                  0, 0, 0, 0, 0);
300
+                    return Process();
301
+                }
302
+               
303
+            }
304
+            var newobj = new
305
+            {
306
+                model = dModel
307
+                
308
+            };
309
+            ajresult.state = (int)CodeStatus.SUCCESS;
310
+            ajresult.message = "操作成功";
311
+            ajresult.data = newobj;  //反馈ID
312
+
313
+            AddGriddingLogs(uuid, port_password, "search", "T_Rec_RegRecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, id.ToString(), "", "", "", "", "", "", "", "", "", "",
314
+                    newobj.ToString(), "通讯记录", "查看工单详情",
315
+                   0, 0, 0, 0, 0);
316
+           // }
317
+
318
+
319
+            return Process();
320
+            
321
+            // return Success("获取成功", newobj);
322
+
323
+
324
+
325
+        }
224 326
 
225 327
 
226 328
 
227
-    }
329
+
330
+
331
+        }
228 332
 }

+ 200 - 38
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -808,55 +808,72 @@ namespace CallCenterApi.Interface.Controllers.tel
808 808
             //data
809 809
             DataTable dt = new DataTable();
810 810
             //tableinfo
811
+            
811 812
             string tableInfo = "";
812 813
             using (TransactionScope trans = new TransactionScope())
813 814
             {
814 815
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userCode);
815 816
 
816
-                if (userModel!=null) {
817
+                if (userModel!=null)
818
+                {
819
+
820
+                    //数据
821
+                    //
822
+                    tableInfo=theGet();
823
+
824
+                    state = "true";
825
+                    msgss = "获取成功";
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
817 834
                     //获取通话记录信息 
818 835
 
819 836
                     string sql = @"select 
820
-CallNumber,FilePath,CallType,DealType,CallState,
821
-UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
822
-(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
823
- where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName
824
-
825
- from  T_Call_CallRecords WITH(NOLOCK) 
826
- left join T_Sys_UserAccount on UserCode=F_UserCode where 1=1 ORDER BY CallRecordsId desc ";
827
-                    DataSet ds =DbHelperSQL.Query(sql,null);
828
-                    dt = ds.Tables[0];
829
-                    //tableInfo
830
-                    //行
831
-                    for (int i = 0; i < dt.Rows.Count; i++)
832
-                    {
833
-                        //列
834
-                        for (int j = 0; j < dt.Columns.Count; j++)
835
-                        {
836
-                            tableInfo += dt.Rows[i][j].ToString() + ",";
837
-                        }
838
-                        tableInfo += "|";
839
-                    }
837
+                    CallNumber,FilePath,CallType,DealType,CallState,
838
+                    UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
839
+                    (select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
840
+                     where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName
840 841
 
842
+                     from  T_Call_CallRecords WITH(NOLOCK) 
843
+                     left join T_Sys_UserAccount on UserCode=F_UserCode where 1=1 ORDER BY CallRecordsId desc ";
844
+                    //                    DataSet ds =DbHelperSQL.Query(sql,null);
845
+                    //                    dt = ds.Tables[0];
846
+                    //                    //tableInfo
847
+                    //                    //行
848
+                    //                    for (int i = 0; i < dt.Rows.Count; i++)
849
+                    //                    {
850
+                    //                        //列
851
+                    //                        for (int j = 0; j < dt.Columns.Count; j++)
852
+                    //                        {
853
+                    //                            tableInfo += dt.Rows[i][j].ToString() + ",";
854
+                    //                        }
855
+                    //                        tableInfo += "|";
856
+                    //                    }
841 857
 
842 858
 
843 859
 
844
-                            //                    int recordCount = 0;
845
-                            //                     dt = BLL.PagerBLL.GetListPager(
846
-                            //                        "T_Call_CallRecords WITH(NOLOCK) left join T_Sys_UserAccount on UserCode=F_UserCode  ",
847
-                            //                        "CallRecordsId",
848
-                            //                        @"CallNumber,FilePath,CallType,DealType,CallState,
849
-                            //UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
850
-                            //(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
851
-                            // where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName",
852
-                            //                        "",
853
-                            //                        "ORDER BY CallRecordsId desc",
854
-                            //                        1,
855
-                            //                        100000,
856
-                            //                        true,
857
-                            //                        out recordCount);
858
-                            state = "true";
859
-                    msgss = "获取成功";
860
+
861
+                    //                    int recordCount = 0;
862
+                    //                     dt = BLL.PagerBLL.GetListPager(
863
+                    //                        "T_Call_CallRecords WITH(NOLOCK) left join T_Sys_UserAccount on UserCode=F_UserCode  ",
864
+                    //                        "CallRecordsId",
865
+                    //                        @"CallNumber,FilePath,CallType,DealType,CallState,
866
+                    //UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
867
+                    //(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
868
+                    // where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName",
869
+                    //                        "",
870
+                    //                        "ORDER BY CallRecordsId desc",
871
+                    //                        1,
872
+                    //                        100000,
873
+                    //                        true,
874
+                    //                        out recordCount);
875
+                    //        state = "true";
876
+                    //msgss = "获取成功";
860 877
 
861 878
 
862 879
                 }
@@ -870,11 +887,156 @@ UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
870 887
             }
871 888
 
872 889
             //状态,信息,数据,
873
-            object[] returns = { state , msgss , dt, tableInfo };
890
+            object[] returns = { state , msgss , tableInfo };
874 891
             return returns;
875 892
         }
876 893
 
877 894
 
878 895
 
896
+        /// <summary>
897
+        /// 对接接口 分页 以及 关键字查询 
898
+        /// </summary>
899
+        /// <param name="workordercode"></param>
900
+        /// <param name="usercode"></param>
901
+        /// <param name="phone"></param>
902
+        /// <returns></returns>
903
+
904
+        public string  theGet() {
905
+
906
+
907
+            //int userId = CurrentUser.UserData.F_UserId;
908
+            //Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
909
+
910
+            string sql = "";
911
+
912
+            string workordercode = HttpUtility.UrlDecode(RequestString.GetQueryString("workordercode"));
913
+            //员工编号
914
+            string usercode2 = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode2"));
915
+            //电话号码
916
+            string phone = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));
917
+
918
+            //呼叫状态,0:未接通电话1已接通电话
919
+            string callstate = HttpUtility.UrlDecode(RequestString.GetQueryString("callstate"));
920
+            //呼叫类型,0呼入1呼出
921
+            string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
922
+            //开始时间
923
+            string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
924
+            //结束时间
925
+            string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
926
+            string dept = HttpUtility.UrlDecode(RequestString.GetQueryString("dept"));
927
+        //处理方式0: IVR处理1骚扰电话2自助服务3转值班电话4留言5呼损6人工处理
928
+            string dealtype = HttpUtility.UrlDecode(RequestString.GetQueryString("dealtype"));
929
+            //页数
930
+            string strpageindex = RequestString.GetQueryString("page");
931
+            int pageindex = 1;
932
+            //每页条数
933
+            string strpagesize = RequestString.GetQueryString("pagesize");
934
+            int pagesize = 10;
935
+
936
+
937
+            if (usercode2 != null && usercode2.Trim() != "")
938
+            {
939
+                sql += " and UserCode='" + usercode2 + "'";
940
+            }
941
+            if (dept != null && dept.Trim() != "")
942
+            {
943
+                sql += " and F_DeptId='" + dept.Trim() + "'";
944
+            }
945
+            if (dealtype != null && dealtype.Trim() != "")
946
+            {
947
+                //处理方式
948
+                sql += " and DealType = " + dealtype + " ";
949
+            }
950
+            if (phone != null && phone.Trim() != "")
951
+            {
952
+                sql += " and CallNumber like '%" + phone + "%'";
953
+            }
954
+            if (callstate.Trim() != "")
955
+            {
956
+                sql += " and CallState='" + callstate + "'";
957
+            }
958
+            if (calltype.Trim() != "")
959
+            {
960
+                sql += " and CallType='" + calltype + "'";
961
+            }
962
+            if (starttime.Trim() != "")
963
+            {
964
+                sql += " and datediff(day,BeginTime,'" + starttime + "')<=0 ";
965
+            }
966
+            if (endtime.Trim() != "")
967
+            {
968
+                sql += " and datediff(day,BeginTime,'" + endtime + "')>=0 ";
969
+            }
970
+            if (workordercode != "")
971
+            {
972
+                sql += " and (select F_RecCode from T_Rec_RegRecords where T_Rec_RegRecords.F_CallId=T_Call_CallRecords.CallId) like '" + workordercode + "'";
973
+            }
974
+
975
+
976
+            if (strpageindex.Trim() != "")
977
+            {
978
+                pageindex = Convert.ToInt32(strpageindex);
979
+            }
980
+
981
+            if (strpagesize.Trim() != "")
982
+            {
983
+                pagesize = Convert.ToInt32(strpagesize);
984
+            }
985
+            int recordCount = 0;
986
+            DataTable dt = BLL.PagerBLL.GetListPager(
987
+                "T_Call_CallRecords WITH(NOLOCK) left join T_Sys_UserAccount on UserCode=F_UserCode  ",
988
+                "CallRecordsId",
989
+                @" CallNumber,FilePath,CallType,DealType,CallState,
990
+                    UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
991
+                    (select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
992
+                     where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName,
993
+     case when (select COUNT(1) from dbo.T_Rec_RegRecords where F_CallId = T_Call_CallRecords.CallId)>0 then 
994
+                     CallId else 0 end as 
995
+                       CallId
996
+",
997
+                sql,
998
+                "ORDER BY CallRecordsId desc",
999
+                pagesize,
1000
+                pageindex,
1001
+                true,
1002
+                out recordCount);
1003
+
1004
+            //dt.Columns.Add("CusName");
1005
+            //dt.Columns.Add("CusDepName");
1006
+
1007
+            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
1008
+            var users = new BLL.T_Sys_UserAccount().GetModelList("");
1009
+
1010
+            foreach (DataRow dr in dt.Rows)
1011
+            {
1012
+                string path = dr["FilePath"] != null ? dr["FilePath"].ToString() : "";
1013
+                if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
1014
+                {
1015
+                    var ym = config.F_ParamValue;
1016
+                    if (ym.Substring(ym.Length - 1) == "/")
1017
+                    {
1018
+                        ym = ym.Substring(0, ym.Length - 1);
1019
+                    }
1020
+                    dr["FilePath"] = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
1021
+                }
1022
+            }
1023
+
1024
+            var obj = new
1025
+            {
1026
+                state = "success",
1027
+                message = "成功",
1028
+                rows = dt,
1029
+                total = recordCount
1030
+            };
1031
+
1032
+            return obj.ToJson();
1033
+
1034
+
1035
+           
1036
+        }
1037
+
1038
+
1039
+
1040
+
879 1041
     }
880 1042
 }