|
|
@@ -188,7 +188,109 @@ namespace CallCenterApi.Interface.Controllers.customer
|
|
188
|
188
|
return Error("参数传输失败");
|
|
189
|
189
|
}
|
|
190
|
190
|
}
|
|
|
191
|
+ public class Sales
|
|
|
192
|
+ {
|
|
|
193
|
+ public string name;
|
|
|
194
|
+ }
|
|
|
195
|
+ public class Salesman
|
|
|
196
|
+ {
|
|
|
197
|
+ public string name;
|
|
|
198
|
+ public string phone;
|
|
|
199
|
+ public int areaid;
|
|
|
200
|
+ public string area;
|
|
|
201
|
+ public int branchid;
|
|
|
202
|
+ public string branch;
|
|
|
203
|
+ public List<Salesmanproduct> product;
|
|
|
204
|
+ }
|
|
|
205
|
+ public class Salesmanproduct
|
|
|
206
|
+ {
|
|
|
207
|
+ public string product;
|
|
|
208
|
+ }
|
|
|
209
|
+ public ActionResult GetSalesman(string Salesman)
|
|
|
210
|
+ {
|
|
|
211
|
+ string sql = " F_IsDelete = 0 ";
|
|
191
|
212
|
|
|
|
213
|
+ if (!string.IsNullOrEmpty(Salesman))
|
|
|
214
|
+ {
|
|
|
215
|
+ sql += $" and F_Salesman = '" + Salesman.Trim() + "'";
|
|
|
216
|
+ }
|
|
|
217
|
+ var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(sql);
|
|
|
218
|
+
|
|
|
219
|
+ Salesman salesmen = new Salesman();
|
|
|
220
|
+ salesmen.product = new List<Salesmanproduct>();
|
|
|
221
|
+ foreach (var it in userModel)
|
|
|
222
|
+ {
|
|
|
223
|
+ salesmen.name = it.F_Salesman;
|
|
|
224
|
+ if (string.IsNullOrEmpty (salesmen.phone))
|
|
|
225
|
+ {
|
|
|
226
|
+ if (!string.IsNullOrEmpty(it.F_SalesPhone))
|
|
|
227
|
+ {
|
|
|
228
|
+ salesmen.phone = it.F_SalesPhone;
|
|
|
229
|
+ }
|
|
|
230
|
+ }
|
|
|
231
|
+ if (string.IsNullOrEmpty(salesmen.area))
|
|
|
232
|
+ {
|
|
|
233
|
+ if (!string.IsNullOrEmpty(it.F_AreaID))
|
|
|
234
|
+ {
|
|
|
235
|
+ var area = deptbll.GetModel(it.F_AreaID);
|
|
|
236
|
+ if (area !=null )
|
|
|
237
|
+ {
|
|
|
238
|
+ salesmen.areaid = area.F_DeptId ;
|
|
|
239
|
+ salesmen.area = area.F_DeptName;
|
|
|
240
|
+ }
|
|
|
241
|
+
|
|
|
242
|
+ }
|
|
|
243
|
+ }
|
|
|
244
|
+ if (string.IsNullOrEmpty(salesmen.branch))
|
|
|
245
|
+ {
|
|
|
246
|
+ if (!string.IsNullOrEmpty(it.F_BranchID))
|
|
|
247
|
+ {
|
|
|
248
|
+ var branch = deptbll.GetModel(it.F_BranchID);
|
|
|
249
|
+ if (branch != null)
|
|
|
250
|
+ {
|
|
|
251
|
+ salesmen.branchid = branch.F_DeptId;
|
|
|
252
|
+ salesmen.branch = branch.F_DeptName;
|
|
|
253
|
+ }
|
|
|
254
|
+ }
|
|
|
255
|
+ }
|
|
|
256
|
+ if (salesmen.product.Exists(x => x.product == it.F_Product) == false && !string.IsNullOrEmpty(it.F_Product))
|
|
|
257
|
+ {
|
|
|
258
|
+ Salesmanproduct model = new Salesmanproduct();
|
|
|
259
|
+ model.product = it.F_Product;
|
|
|
260
|
+ salesmen.product.Add(model);
|
|
|
261
|
+ }
|
|
|
262
|
+ }
|
|
|
263
|
+ return Success("获取成功", salesmen);
|
|
|
264
|
+ }
|
|
|
265
|
+ public ActionResult GetSales(string Province, string City, string Country)
|
|
|
266
|
+ {
|
|
|
267
|
+ string sql = " F_IsDelete = 0 ";
|
|
|
268
|
+
|
|
|
269
|
+ if (!string .IsNullOrEmpty (Province))
|
|
|
270
|
+ {
|
|
|
271
|
+ sql += $" and F_AddressProvince = '" + Province.Trim() + "'";
|
|
|
272
|
+ }
|
|
|
273
|
+ if (!string.IsNullOrEmpty(City))
|
|
|
274
|
+ {
|
|
|
275
|
+ sql += $" and F_AddressCity = '" + City.Trim() + "'";
|
|
|
276
|
+ }
|
|
|
277
|
+ if (!string.IsNullOrEmpty(Country))
|
|
|
278
|
+ {
|
|
|
279
|
+ sql += $" and F_AddressCountry = '" + Country.Trim() + "'"; ;
|
|
|
280
|
+ }
|
|
|
281
|
+ var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList( sql);
|
|
|
282
|
+ List<Sales> salesmen = new List<Sales>();
|
|
|
283
|
+ foreach (var it in userModel)
|
|
|
284
|
+ {
|
|
|
285
|
+ if (salesmen.Exists(x => x.name == it.F_Salesman) == false&&!string .IsNullOrEmpty (it.F_Salesman))
|
|
|
286
|
+ {
|
|
|
287
|
+ Sales model = new Sales();
|
|
|
288
|
+ model.name = it.F_Salesman;
|
|
|
289
|
+ salesmen.Add(model);
|
|
|
290
|
+ }
|
|
|
291
|
+ }
|
|
|
292
|
+ return Success("获取成功", salesmen);
|
|
|
293
|
+ }
|
|
192
|
294
|
/// <summary>
|
|
193
|
295
|
/// 通过来电号码获取来电弹屏左侧客户信息
|
|
194
|
296
|
/// </summary>
|
|
|
@@ -197,7 +299,7 @@ namespace CallCenterApi.Interface.Controllers.customer
|
|
197
|
299
|
{
|
|
198
|
300
|
if (!string.IsNullOrWhiteSpace(tel))
|
|
199
|
301
|
{
|
|
200
|
|
- var sql = $" and (F_SalesPhone like '%" + tel.Trim() + "%' or F_LegalPhone like '%" + tel.Trim() + "%')";
|
|
|
302
|
+ var sql = $" and F_LegalPhone = '" + tel.Trim() + "'";
|
|
201
|
303
|
var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
|
|
202
|
304
|
if (userModel.Count() > 0)
|
|
203
|
305
|
{
|