Sfoglia il codice sorgente

获取通话记录接口

gaobingyue 5 anni fa
parent
commit
68e5248117

+ 39 - 16
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/BusinessDockController.cs

35
             string methodName = new System.Diagnostics.StackTrace(true).GetFrame(1).GetMethod().Name;   //事件源
35
             string methodName = new System.Diagnostics.StackTrace(true).GetFrame(1).GetMethod().Name;   //事件源
36
            //验证文件是否存在
36
            //验证文件是否存在
37
             // LogInterface.WriteLog(this.GetType().ToString() + " -- " + methodName + "\r\n" + ajresult.state + "|" + ajresult.data + ajresult.message); //日志
37
             // LogInterface.WriteLog(this.GetType().ToString() + " -- " + methodName + "\r\n" + ajresult.state + "|" + ajresult.data + ajresult.message); //日志
38
-            var jsonMsg = new AjaxResult { state = ajresult.state, message = ajresult.message, data = ajresult.data }.ToJson();
38
+            var jsonMsg = new AjaxResult { state = ajresult.state, message = ajresult.message, data = ajresult.data, page = ajresult.page, pagesize = ajresult.pagesize }.ToJson();
39
             return Content(jsonMsg);
39
             return Content(jsonMsg);
40
         }
40
         }
41
 
41
 
138
             string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
138
             string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
139
             string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
139
             string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
140
             string content = HttpUtility.UrlDecode(RequestString.GetQueryString("content"));//查收详情
140
             string content = HttpUtility.UrlDecode(RequestString.GetQueryString("content"));//查收详情
141
-            string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
141
+            //string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
142
+            string usercode = "0";
142
 
143
 
143
 
144
 
144
             //using (TransactionScope scope = new TransactionScope(
145
             //using (TransactionScope scope = new TransactionScope(
163
                 //    ajresult.message = "工单编号不能为空";
164
                 //    ajresult.message = "工单编号不能为空";
164
                 //    return Process();
165
                 //    return Process();
165
                 //}
166
                 //}
166
-                if (string.IsNullOrEmpty(usercode))
167
-                {
168
-                    ajresult.state = (int)CodeStatus.必填字段为空;
169
-                    ajresult.message = "工号不能为空";
170
-                    return Process();
171
-                }
167
+                //if (string.IsNullOrEmpty(usercode))
168
+                //{
169
+                //    ajresult.state = (int)CodeStatus.必填字段为空;
170
+                //    ajresult.message = "工号不能为空";
171
+                //    return Process();
172
+                //}
172
 
173
 
173
                 if (!Common.CodeValidate.ICodeValidateGridding(uuid, port_password))
174
                 if (!Common.CodeValidate.ICodeValidateGridding(uuid, port_password))
174
                 {
175
                 {
191
                     }
192
                     }
192
                     else
193
                     else
193
                     {
194
                     {
194
-                        ajresult.state = (int)CodeStatus.SUCCESS;
195
+
196
+
197
+
198
+                string strpageindex = RequestString.GetQueryString("page");
199
+                int pageindex = 1;
200
+                //每页条数
201
+                string strpagesize = RequestString.GetQueryString("pagesize");
202
+                int pagesize = 10;
203
+                if (strpageindex.Trim() != "")
204
+                {
205
+                    pageindex = Convert.ToInt32(strpageindex);
206
+                }
207
+
208
+                if (strpagesize.Trim() != "")
209
+                {
210
+                    pagesize = Convert.ToInt32(strpagesize);
211
+                }
212
+
213
+
214
+                ajresult.state = (int)CodeStatus.SUCCESS;
195
                         ajresult.message = "操作成功";
215
                         ajresult.message = "操作成功";
216
+                ajresult.page = pageindex;
217
+                ajresult.pagesize = pagesize;
196
                         ajresult.data = obj1[2];  //反馈ID
218
                         ajresult.data = obj1[2];  //反馈ID
197
                     }
219
                     }
198
 
220
 
228
             string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
250
             string port_password = HttpUtility.UrlDecode(RequestString.GetQueryString("port_password"));   //加密信息(安全验证用)
229
             string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
251
             string uuid = HttpUtility.UrlDecode(RequestString.GetQueryString("uuid"));          //客户唯一标识(安全验证用)
230
             string content = HttpUtility.UrlDecode(RequestString.GetQueryString("content"));//查收详情
252
             string content = HttpUtility.UrlDecode(RequestString.GetQueryString("content"));//查收详情
231
-            string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
253
+            //string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
254
+            string usercode = "0";
232
             int id = Convert.ToInt32(HttpUtility.UrlDecode(RequestString.GetQueryString("callid")));
255
             int id = Convert.ToInt32(HttpUtility.UrlDecode(RequestString.GetQueryString("callid")));
233
 
256
 
234
             //#region 参数验证
257
             //#region 参数验证
245
                 return Process();
268
                 return Process();
246
             }
269
             }
247
 
270
 
248
-            if (string.IsNullOrEmpty(usercode))
249
-            {
250
-                ajresult.state = (int)CodeStatus.必填字段为空;
251
-                ajresult.message = "工号不能为空";
252
-                return Process();
253
-            }
271
+            //if (string.IsNullOrEmpty(usercode))
272
+            //{
273
+            //    ajresult.state = (int)CodeStatus.必填字段为空;
274
+            //    ajresult.message = "工号不能为空";
275
+            //    return Process();
276
+            //}
254
 
277
 
255
             if (!Common.CodeValidate.ICodeValidateGridding(uuid, port_password))
278
             if (!Common.CodeValidate.ICodeValidateGridding(uuid, port_password))
256
             {
279
             {

+ 21 - 62
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

812
             string tableInfo = "";
812
             string tableInfo = "";
813
             using (TransactionScope trans = new TransactionScope())
813
             using (TransactionScope trans = new TransactionScope())
814
             {
814
             {
815
-                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userCode);
815
+                //Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userCode);
816
 
816
 
817
-                if (userModel!=null)
818
-                {
817
+                //if (userModel!=null)
818
+                //{
819
 
819
 
820
                     //数据
820
                     //数据
821
                     //
821
                     //
823
 
823
 
824
                     state = "true";
824
                     state = "true";
825
                     msgss = "获取成功";
825
                     msgss = "获取成功";
826
+                
826
 
827
 
827
-
828
-
829
-
830
-
831
-
832
-
833
-
834
-                    //获取通话记录信息 
835
-
836
-                    string sql = @"select 
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
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
-                    //                    }
857
-
858
-
859
-
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 = "获取成功";
877
-
878
-
879
-                }
880
-                else
881
-                {
882
-                    state = "false";
883
-                    msgss = "无法获取userCode工号信息,工号为" + userCode ;
828
+                //}
829
+                //else
830
+                //{
831
+                //    state = "false";
832
+                //    msgss = "无法获取userCode工号信息,工号为" + userCode ;
884
                     
833
                     
885
-                }
834
+                //}
886
 
835
 
887
             }
836
             }
888
 
837
 
949
             }
898
             }
950
             if (phone != null && phone.Trim() != "")
899
             if (phone != null && phone.Trim() != "")
951
             {
900
             {
952
-                sql += " and CallNumber like '%" + phone + "%'";
901
+                sql += " and( 1=0 ";
902
+                //string str = "A,B,C,D,E,F,G";
903
+                string[] strArr = phone.Split(',');//根据逗号分隔字符串str
904
+                for (int i=0;i<strArr.Length;i++) {
905
+                    if (strArr[i].Trim() != "") { 
906
+                    sql += " or CallNumber like '%" + strArr[i] + "%'";
907
+                    }
908
+                }
909
+                sql += "  ) ";
910
+
911
+                //sql += " and CallNumber like '%" + phone + "%'";
953
             }
912
             }
954
             if (callstate.Trim() != "")
913
             if (callstate.Trim() != "")
955
             {
914
             {