|
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
using CallCenter.Utility;
|
|
2
|
2
|
using CallCenterApi.Common;
|
|
3
|
3
|
using CallCenterApi.Interface.Controllers.Base;
|
|
|
4
|
+using CallCenterApi.Interface.Models.Dto;
|
|
4
|
5
|
using System;
|
|
5
|
6
|
using System.Collections.Generic;
|
|
6
|
7
|
using System.Data;
|
|
|
@@ -113,23 +114,54 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
113
|
114
|
/// 根据来电号码获取客户信息
|
|
114
|
115
|
/// </summary>
|
|
115
|
116
|
/// <returns></returns>
|
|
116
|
|
- public ActionResult GetCustomerByTel()
|
|
|
117
|
+ public ActionResult GetCustomerByTel(string tel)
|
|
117
|
118
|
{
|
|
118
|
119
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
119
|
120
|
if (Request.IsAuthenticated)
|
|
120
|
121
|
{
|
|
121
|
|
- DataTable dt = new DataTable();
|
|
122
|
|
-
|
|
123
|
|
- string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
|
|
|
122
|
+
|
|
124
|
123
|
BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
|
|
125
|
|
- dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
|
|
126
|
|
-
|
|
127
|
|
- res = Success("客户信息加载成功", dt);
|
|
|
124
|
+ var cusmodel=bll.GetModelByTel(tel);
|
|
|
125
|
+ CustomerDto cusdto = new CustomerDto();
|
|
|
126
|
+ if (cusmodel != null)
|
|
|
127
|
+ {
|
|
|
128
|
+ cusdto.id = cusmodel.F_CustomerId;
|
|
|
129
|
+ cusdto.cusname = cusmodel.F_CustomerName;
|
|
|
130
|
+ cusdto.mobile = cusmodel.F_Mobile;
|
|
|
131
|
+ cusdto.telphone = cusmodel.F_Telephone;
|
|
|
132
|
+ cusdto.countryid = cusmodel.F_CityID.Value;
|
|
|
133
|
+ cusdto.country = cusmodel.F_City;
|
|
|
134
|
+ cusdto.address = cusmodel.F_Address;
|
|
|
135
|
+ res = Success("获取成功", cusdto);
|
|
|
136
|
+ }
|
|
|
137
|
+ else
|
|
|
138
|
+ {
|
|
|
139
|
+ res = Error("暂无此用户");
|
|
|
140
|
+ }
|
|
128
|
141
|
|
|
129
|
142
|
}
|
|
130
|
143
|
return res;
|
|
131
|
144
|
}
|
|
132
|
145
|
|
|
|
146
|
+ #region 20180509调整前
|
|
|
147
|
+ //public ActionResult GetCustomerByTel()
|
|
|
148
|
+ //{
|
|
|
149
|
+ // ActionResult res = NoToken("未知错误,请重新登录");
|
|
|
150
|
+ // if (Request.IsAuthenticated)
|
|
|
151
|
+ // {
|
|
|
152
|
+ // DataTable dt = new DataTable();
|
|
|
153
|
+
|
|
|
154
|
+ // string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
|
|
|
155
|
+ // BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
|
|
|
156
|
+ // dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
|
|
|
157
|
+
|
|
|
158
|
+ // res = Success("客户信息加载成功", dt);
|
|
|
159
|
+
|
|
|
160
|
+ // }
|
|
|
161
|
+ // return res;
|
|
|
162
|
+ //}
|
|
|
163
|
+ #endregion
|
|
|
164
|
+
|
|
133
|
165
|
/// <summary>
|
|
134
|
166
|
/// 根据来电号码获取最近的callid
|
|
135
|
167
|
/// </summary>
|