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