|
|
@@ -18,10 +18,11 @@ using System.Text.RegularExpressions;
|
|
18
|
18
|
using System.IRepositories.Call;
|
|
19
|
19
|
using System.Model.Call;
|
|
20
|
20
|
using System.Utility.Encrypt;
|
|
|
21
|
+using System.IRepositories.Bus;
|
|
21
|
22
|
|
|
22
|
23
|
namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
23
|
24
|
{
|
|
24
|
|
- [Authorize]
|
|
|
25
|
+ // [Authorize]
|
|
25
|
26
|
[Produces("application/json")]
|
|
26
|
27
|
[Route("api/[controller]")]
|
|
27
|
28
|
public class VipInfoController : BaseController
|
|
|
@@ -33,8 +34,9 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
33
|
34
|
private readonly ISMS_InternalMessagesReposytory _sys_internalMessagesrepository;
|
|
34
|
35
|
private readonly ICall_CallRecordsRepository busCallRecordsRepository;
|
|
35
|
36
|
private readonly Ipoint_agentRepository _point_agentrepository;
|
|
|
37
|
+ private readonly IBus_OrderRepository busOrderRepository;
|
|
36
|
38
|
public VipInfoController(ICus_VipInfoRepository cus_vip_infoRepository, ISys_UserAccountRepository sys_user_accountRepository, ICus_MsgRepository cus_msgRepository,IConfiguration configuration,
|
|
37
|
|
- ISMS_InternalMessagesReposytory sys_internalMessagesrepository, ICall_CallRecordsRepository _busCallRecordsRepository, Ipoint_agentRepository point_agentrepository)
|
|
|
39
|
+ ISMS_InternalMessagesReposytory sys_internalMessagesrepository, ICall_CallRecordsRepository _busCallRecordsRepository, Ipoint_agentRepository point_agentrepository, IBus_OrderRepository _busOrderRepository)
|
|
38
|
40
|
{
|
|
39
|
41
|
_cus_vip_infoRepository = cus_vip_infoRepository;
|
|
40
|
42
|
_sys_user_accountRepository = sys_user_accountRepository;
|
|
|
@@ -43,6 +45,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
43
|
45
|
_sys_internalMessagesrepository = sys_internalMessagesrepository;
|
|
44
|
46
|
busCallRecordsRepository = _busCallRecordsRepository;
|
|
45
|
47
|
_point_agentrepository = point_agentrepository;
|
|
|
48
|
+ busOrderRepository = _busOrderRepository;
|
|
46
|
49
|
}
|
|
47
|
50
|
|
|
48
|
51
|
[HttpGet]
|
|
|
@@ -139,6 +142,9 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
139
|
142
|
return Content(obj.ToJson());
|
|
140
|
143
|
}
|
|
141
|
144
|
|
|
|
145
|
+
|
|
|
146
|
+
|
|
|
147
|
+
|
|
142
|
148
|
/// <summary>
|
|
143
|
149
|
/// 获取会员信息详情
|
|
144
|
150
|
/// </summary>
|
|
|
@@ -157,7 +163,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
157
|
163
|
if (model != null)
|
|
158
|
164
|
{
|
|
159
|
165
|
var modellist = await _cus_msgRepository.GetListALL(x => x.F_VipInfoID == model.F_ID);
|
|
160
|
|
- var viplist = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1&& x.F_Recommender == model.F_Name&&(x .F_RecommenderTel ==model .F_Phone || x.F_RecommenderTel == model.F_Mobile &&x.F_RecommenderTel == model.F_Mobile1));
|
|
|
166
|
+ var viplist = await _cus_vip_infoRepository.GetListALL(x => x.F_State == 1&& x.F_RecommenderID == model.F_ID );
|
|
161
|
167
|
var obj =new
|
|
162
|
168
|
{
|
|
163
|
169
|
model,
|
|
|
@@ -174,7 +180,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
174
|
180
|
/// 号码加密
|
|
175
|
181
|
/// </summary>
|
|
176
|
182
|
/// <param name="id"></param>
|
|
177
|
|
- /// <param name="type"></param>
|
|
|
183
|
+ /// <param name="type"></ param>
|
|
178
|
184
|
/// <returns></returns>
|
|
179
|
185
|
[HttpGet("encryptphone")]
|
|
180
|
186
|
public async Task<IActionResult> GetEncrypt(int id,int type=0)
|
|
|
@@ -201,6 +207,218 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
201
|
207
|
return Error("加密失败!");
|
|
202
|
208
|
|
|
203
|
209
|
}
|
|
|
210
|
+
|
|
|
211
|
+ /// <summary>
|
|
|
212
|
+ /// 档案合并
|
|
|
213
|
+ /// </summary>
|
|
|
214
|
+ /// <param name="input"></param>
|
|
|
215
|
+ /// <returns></returns>
|
|
|
216
|
+ [HttpPost("Merge")]
|
|
|
217
|
+ public async Task<IActionResult> Merge(int MainID=0,int ViceID=0)
|
|
|
218
|
+ {
|
|
|
219
|
+ if (MainID<=0)
|
|
|
220
|
+ return Error("请选择主档案");
|
|
|
221
|
+ if (ViceID<=0)
|
|
|
222
|
+ return Error("请选择副档案");
|
|
|
223
|
+
|
|
|
224
|
+ var model = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == MainID && x.F_State == (int)EnumDelState.Enabled);
|
|
|
225
|
+ if (model == null)
|
|
|
226
|
+ return Error("操作失败,主档案不存在");
|
|
|
227
|
+ var model1 = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == ViceID && x.F_State == (int)EnumDelState.Enabled);
|
|
|
228
|
+ if (model1 == null)
|
|
|
229
|
+ return Error("操作失败,副档案不存在");
|
|
|
230
|
+
|
|
|
231
|
+
|
|
|
232
|
+ string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
|
|
|
233
|
+ var modelInfo = new T_Cus_VipInfo();
|
|
|
234
|
+ //model.F_VIPCode = input.vipcode;//会员卡号
|
|
|
235
|
+ modelInfo.F_Name = model.F_Name;
|
|
|
236
|
+ modelInfo.F_Birthday = model.F_Birthday;
|
|
|
237
|
+ modelInfo.F_Phone = model.F_Phone;
|
|
|
238
|
+ modelInfo.F_RecommenderID = model.F_RecommenderID;
|
|
|
239
|
+ modelInfo.F_Recommender = model.F_Recommender;
|
|
|
240
|
+ modelInfo.F_RecommenderTel = model.F_RecommenderTel;
|
|
|
241
|
+ modelInfo.F_Sex = model.F_Sex;
|
|
|
242
|
+ modelInfo.F_Label = model.F_Label;
|
|
|
243
|
+ modelInfo.F_Note = model.F_Note;
|
|
|
244
|
+ modelInfo.F_City = model.F_City;
|
|
|
245
|
+ modelInfo.F_Nickname = model.F_Nickname;
|
|
|
246
|
+ modelInfo.F_Address = model.F_Address;
|
|
|
247
|
+ modelInfo.F_Address1 = model.F_Address1;
|
|
|
248
|
+ modelInfo.F_Age = model.F_Age;
|
|
|
249
|
+
|
|
|
250
|
+ if (!string.IsNullOrEmpty(model.F_Mobile))
|
|
|
251
|
+ {
|
|
|
252
|
+ if (!string.IsNullOrEmpty(model1.F_Mobile))
|
|
|
253
|
+ {
|
|
|
254
|
+ modelInfo.F_Mobile += "," + model1.F_Mobile;
|
|
|
255
|
+ string [] Mobile = modelInfo.F_Mobile.Split(',');
|
|
|
256
|
+ var Mobilelist= Mobile.Distinct().ToList();
|
|
|
257
|
+ string phone = "";
|
|
|
258
|
+ foreach (var it in Mobilelist)
|
|
|
259
|
+ {
|
|
|
260
|
+ if (phone == "")
|
|
|
261
|
+ phone += it;
|
|
|
262
|
+ else
|
|
|
263
|
+ phone += "," + it;
|
|
|
264
|
+ }
|
|
|
265
|
+ modelInfo.F_Mobile = phone;
|
|
|
266
|
+ }
|
|
|
267
|
+
|
|
|
268
|
+ }
|
|
|
269
|
+ else
|
|
|
270
|
+ {
|
|
|
271
|
+ if (!string.IsNullOrEmpty(model1.F_Mobile))
|
|
|
272
|
+ {
|
|
|
273
|
+ modelInfo.F_Mobile = model1.F_Mobile;
|
|
|
274
|
+ }
|
|
|
275
|
+
|
|
|
276
|
+ }
|
|
|
277
|
+
|
|
|
278
|
+ modelInfo.F_Province = model.F_Province;
|
|
|
279
|
+ modelInfo.F_Area = model.F_Area;
|
|
|
280
|
+ modelInfo.F_Town = model.F_Town;
|
|
|
281
|
+ modelInfo.F_Postcode = model.F_Postcode;
|
|
|
282
|
+ modelInfo.F_Province1 = model.F_Province1;
|
|
|
283
|
+ modelInfo.F_Area1 = model.F_Area1;
|
|
|
284
|
+ modelInfo.F_Town1 = model.F_Town1;
|
|
|
285
|
+ modelInfo.F_City1 = model.F_City1;
|
|
|
286
|
+ modelInfo.F_Address1 = model.F_Address1;
|
|
|
287
|
+ modelInfo.F_Province2 = model.F_Province2;
|
|
|
288
|
+ modelInfo.F_Area2 = model.F_Area2;
|
|
|
289
|
+ modelInfo.F_Town2 = model.F_Town2;
|
|
|
290
|
+ modelInfo.F_City2 = model.F_City2;
|
|
|
291
|
+ modelInfo.F_Address2 = model.F_Address2;
|
|
|
292
|
+ modelInfo.F_Postcode1 = model.F_Postcode1;
|
|
|
293
|
+ modelInfo.F_ShoeSize = model.F_ShoeSize;
|
|
|
294
|
+ modelInfo.F_Score = model .F_Score + model1.F_Score;
|
|
|
295
|
+ modelInfo.F_Money = model.F_Money + model1.F_Money;
|
|
|
296
|
+ modelInfo.F_TotalScore = model.F_TotalScore + model1.F_TotalScore;
|
|
|
297
|
+ modelInfo.F_Saleperson = user;
|
|
|
298
|
+ modelInfo.F_Type = model.F_Type;
|
|
|
299
|
+ modelInfo.F_CreateBy = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value; //"8000";
|
|
|
300
|
+ modelInfo.F_CreateOn = model.F_CreateOn;
|
|
|
301
|
+ modelInfo.F_State = (int)EnumDelState.Enabled;
|
|
|
302
|
+ modelInfo.F_GiftYear = model.F_GiftYear;
|
|
|
303
|
+ modelInfo.F_Firstcalltime = model.F_Firstcalltime;
|
|
|
304
|
+ modelInfo.F_Lastholetime = model.F_Lastholetime;
|
|
|
305
|
+ var res = await _cus_vip_infoRepository.Add(modelInfo);
|
|
|
306
|
+ if (res > 0)
|
|
|
307
|
+ {
|
|
|
308
|
+ model .F_State = (int)EnumDelState.Delete;
|
|
|
309
|
+ model.F_ParentID = res;
|
|
|
310
|
+ await _cus_vip_infoRepository.Update(model);
|
|
|
311
|
+ model1.F_State = (int)EnumDelState.Delete;
|
|
|
312
|
+ model1.F_ParentID = res;
|
|
|
313
|
+ await _cus_vip_infoRepository.Update(model1);
|
|
|
314
|
+ return Success("合并成功");
|
|
|
315
|
+ }
|
|
|
316
|
+ else
|
|
|
317
|
+ {
|
|
|
318
|
+ return Error("合并失败");
|
|
|
319
|
+ }
|
|
|
320
|
+ }
|
|
|
321
|
+ /// <summary>
|
|
|
322
|
+ /// 档案拆分
|
|
|
323
|
+ /// </summary>
|
|
|
324
|
+ /// <param name="input"></param>
|
|
|
325
|
+ /// <returns></returns>
|
|
|
326
|
+ [HttpPost("SplitvIP")]
|
|
|
327
|
+ public async Task<IActionResult> SplitvIP(int id)
|
|
|
328
|
+ {
|
|
|
329
|
+ if (id <= 0)
|
|
|
330
|
+ return Error("请选择要拆分档案");
|
|
|
331
|
+ var model = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == id && x.F_State == (int)EnumDelState.Enabled);
|
|
|
332
|
+ if (model == null)
|
|
|
333
|
+ return Error("操作失败,档案不存在");
|
|
|
334
|
+ var call = await busCallRecordsRepository.GetListALL(x => x.CusId==model .F_ID );
|
|
|
335
|
+ if (call!=null && call.Count >0)
|
|
|
336
|
+ return Error("操作失败,该档案已产生新的信息,不可拆分");
|
|
|
337
|
+ var order = await busOrderRepository.GetListALL(x => x.F_VipId == model.F_ID);
|
|
|
338
|
+ if (order != null && order.Count > 0)
|
|
|
339
|
+ return Error("操作失败,该档案已产生新的信息,不可拆分");
|
|
|
340
|
+ var modellist = await _cus_vip_infoRepository.GetListALL (x => x.F_ParentID == id && x.F_State == (int)EnumDelState.Delete );
|
|
|
341
|
+ if (modellist == null|| modellist.Count <=0)
|
|
|
342
|
+ return Error("操作失败,该档案未进行过合并");
|
|
|
343
|
+
|
|
|
344
|
+ string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
|
|
|
345
|
+ int res = 0;
|
|
|
346
|
+ foreach (var it in modellist)
|
|
|
347
|
+ {
|
|
|
348
|
+ // var ml = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == item);
|
|
|
349
|
+ it.F_State = (int)EnumDelState.Enabled ;
|
|
|
350
|
+ if (_cus_vip_infoRepository.Update(it).Result)
|
|
|
351
|
+ res += 1;
|
|
|
352
|
+ }
|
|
|
353
|
+ if (res == modellist.Count)
|
|
|
354
|
+ {
|
|
|
355
|
+ model .F_State = (int)EnumDelState.Delete ;
|
|
|
356
|
+ await _cus_vip_infoRepository.Update(model);
|
|
|
357
|
+ return Success("拆分成功");
|
|
|
358
|
+
|
|
|
359
|
+ }
|
|
|
360
|
+
|
|
|
361
|
+ else
|
|
|
362
|
+ return Error ("部分档案拆分成功");
|
|
|
363
|
+ }
|
|
|
364
|
+
|
|
|
365
|
+
|
|
|
366
|
+ /// <summary>
|
|
|
367
|
+ /// 获取会员所有手机号
|
|
|
368
|
+ /// </summary>
|
|
|
369
|
+ /// <param name="input"></param>
|
|
|
370
|
+ /// <returns></returns>
|
|
|
371
|
+ [HttpGet("getVipMobie")]
|
|
|
372
|
+ public async Task<IActionResult> GetVipMobie(int id)
|
|
|
373
|
+ {
|
|
|
374
|
+ if (id <= 0)
|
|
|
375
|
+ return Error("请选择会员");
|
|
|
376
|
+ var model = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == id && x.F_State == (int)EnumDelState.Enabled);
|
|
|
377
|
+ if (model == null)
|
|
|
378
|
+ return Error("操作失败,会员不存在");
|
|
|
379
|
+ List<string> Mobile = new List<string>();
|
|
|
380
|
+ Mobile.Add(model.F_Phone);
|
|
|
381
|
+ if (!string.IsNullOrEmpty (model.F_Mobile) )
|
|
|
382
|
+ {
|
|
|
383
|
+ var modellist = model.F_Mobile.Split(',');
|
|
|
384
|
+ foreach (var it in modellist)
|
|
|
385
|
+ {
|
|
|
386
|
+ Mobile.Add(it);
|
|
|
387
|
+ }
|
|
|
388
|
+ }
|
|
|
389
|
+ return Success("获取成功", Mobile);
|
|
|
390
|
+
|
|
|
391
|
+ }
|
|
|
392
|
+ /// <summary>
|
|
|
393
|
+ /// 通过手机号获取会员列表
|
|
|
394
|
+ /// </summary>
|
|
|
395
|
+ /// <param name="id"></param>
|
|
|
396
|
+ /// <param name="type"></param>
|
|
|
397
|
+ /// <returns></returns>
|
|
|
398
|
+ [HttpGet("getphone")]
|
|
|
399
|
+ public async Task<IActionResult> Getphone(string phone)
|
|
|
400
|
+ {
|
|
|
401
|
+ List<IConditionalModel> conModels = new List<IConditionalModel>();
|
|
|
402
|
+ #region 条件筛选
|
|
|
403
|
+ conModels.Add(new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal, FieldValue = ((int)EnumDelState.Enabled).ToString() });
|
|
|
404
|
+ if (string.IsNullOrEmpty(phone))
|
|
|
405
|
+ return Error("请输入号码");
|
|
|
406
|
+
|
|
|
407
|
+ conModels.Add(new ConditionalCollections()
|
|
|
408
|
+ {
|
|
|
409
|
+ ConditionalList = new List<KeyValuePair<WhereType, ConditionalModel>>()
|
|
|
410
|
+ {
|
|
|
411
|
+ new KeyValuePair<WhereType, ConditionalModel>(WhereType.And, new ConditionalModel() { FieldName = "F_Phone", ConditionalType = ConditionalType.Like, FieldValue = phone }),
|
|
|
412
|
+ new KeyValuePair<WhereType, ConditionalModel>( WhereType.Or , new ConditionalModel() { FieldName = "F_Mobile", ConditionalType = ConditionalType.Like, FieldValue = phone }),
|
|
|
413
|
+ }
|
|
|
414
|
+ });
|
|
|
415
|
+ #endregion
|
|
|
416
|
+
|
|
|
417
|
+ var list = await _cus_vip_infoRepository.GetListALL (conModels, "F_CreateOn desc");
|
|
|
418
|
+ return Success ("获取成功", list);
|
|
|
419
|
+
|
|
|
420
|
+ }
|
|
|
421
|
+
|
|
204
|
422
|
/// <summary>
|
|
205
|
423
|
/// 号码解密
|
|
206
|
424
|
/// </summary>
|
|
|
@@ -251,7 +469,6 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
251
|
469
|
};
|
|
252
|
470
|
return Content(obj.ToJson());
|
|
253
|
471
|
}
|
|
254
|
|
-
|
|
255
|
472
|
/// <summary>
|
|
256
|
473
|
/// 添加会员
|
|
257
|
474
|
/// </summary>
|
|
|
@@ -291,16 +508,14 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
291
|
508
|
point_Agent.agent = user;
|
|
292
|
509
|
var phone = _point_agentrepository.Add(point_Agent);
|
|
293
|
510
|
}
|
|
|
511
|
+ model.F_RecommenderID = input.F_RecommenderID;
|
|
294
|
512
|
model.F_Recommender = input.recommender;
|
|
295
|
|
- if (!string .IsNullOrEmpty (input.recommendertel))
|
|
|
513
|
+ if (!string.IsNullOrEmpty(input.recommendertel))
|
|
296
|
514
|
{
|
|
297
|
515
|
if (!valtel(input.recommendertel))
|
|
298
|
516
|
return Error("手机号必须为11位数字");
|
|
299
|
517
|
model.F_RecommenderTel = input.recommendertel;
|
|
300
|
518
|
}
|
|
301
|
|
-
|
|
302
|
|
-
|
|
303
|
|
-
|
|
304
|
519
|
model.F_Sex = input.sex;
|
|
305
|
520
|
model.F_Label = input.label;
|
|
306
|
521
|
model.F_Note = input.note;
|
|
|
@@ -311,47 +526,26 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
311
|
526
|
model.F_Age = input.age;
|
|
312
|
527
|
if (!string .IsNullOrEmpty (input .mobile ))
|
|
313
|
528
|
{
|
|
314
|
|
- if (!valtel(input.mobile))
|
|
315
|
|
- return Error("手机号必须为11位数字");
|
|
316
|
|
- model.F_Mobile = input.mobile;
|
|
317
|
|
- var _point = await _point_agentrepository.GetListALL(x => x.caller == input.mobile);
|
|
318
|
|
- if (_point == null && _point.Count() <= 0)
|
|
|
529
|
+ string[] mobile1 = input.mobile.TrimEnd(',').Split(',');
|
|
|
530
|
+ foreach (var it in mobile1)
|
|
319
|
531
|
{
|
|
320
|
|
- point_agent point_Agent = new point_agent();
|
|
321
|
|
- point_Agent.caller = input.mobile;
|
|
322
|
|
- point_Agent.agent = user;
|
|
323
|
|
- var phone = _point_agentrepository.Add(point_Agent);
|
|
324
|
|
- }
|
|
325
|
|
- }
|
|
326
|
|
- if (!string.IsNullOrEmpty(input.mobile1))
|
|
327
|
|
- {
|
|
328
|
|
- if (!valtel(input.mobile1))
|
|
329
|
|
- return Error("手机号必须为11位数字");
|
|
330
|
|
- model.F_Mobile1 = input.mobile1;
|
|
331
|
|
- var _point = await _point_agentrepository.GetListALL(x => x.caller == input.mobile1);
|
|
332
|
|
- if (_point == null && _point.Count() <= 0)
|
|
333
|
|
- {
|
|
334
|
|
- point_agent point_Agent = new point_agent();
|
|
335
|
|
- point_Agent.caller = input.mobile1;
|
|
336
|
|
- point_Agent.agent = user;
|
|
337
|
|
- var phone = _point_agentrepository.Add(point_Agent);
|
|
338
|
|
- }
|
|
339
|
|
- }
|
|
340
|
|
- if (!string.IsNullOrEmpty(input.mobile2))
|
|
341
|
|
- {
|
|
342
|
|
- if (!valtel(input.mobile2))
|
|
343
|
|
- return Error("手机号必须为11位数字");
|
|
344
|
|
- model.F_Mobile2 = input.mobile2;
|
|
345
|
|
- var _point = await _point_agentrepository.GetListALL(x => x.caller == input.mobile2);
|
|
346
|
|
- if (_point == null && _point.Count() <= 0)
|
|
347
|
|
- {
|
|
348
|
|
- point_agent point_Agent = new point_agent();
|
|
349
|
|
- point_Agent.caller = input.mobile2;
|
|
350
|
|
- point_Agent.agent = user;
|
|
351
|
|
- var phone = _point_agentrepository.Add(point_Agent);
|
|
|
532
|
+ if (!valtel(it))
|
|
|
533
|
+ return Error("手机号必须为11位数字");
|
|
|
534
|
+
|
|
|
535
|
+ var _point = await _point_agentrepository.GetListALL(x => x.caller == it);
|
|
|
536
|
+ if (_point == null && _point.Count() <= 0)
|
|
|
537
|
+ {
|
|
|
538
|
+ point_agent point_Agent = new point_agent();
|
|
|
539
|
+ point_Agent.caller = it;
|
|
|
540
|
+ point_Agent.agent = user;
|
|
|
541
|
+ var phone = _point_agentrepository.Add(point_Agent);
|
|
|
542
|
+ }
|
|
352
|
543
|
}
|
|
|
544
|
+ model.F_Mobile = input.mobile.TrimEnd(',');
|
|
353
|
545
|
}
|
|
354
|
546
|
|
|
|
547
|
+
|
|
|
548
|
+
|
|
355
|
549
|
model.F_Province = input.province;
|
|
356
|
550
|
model.F_Area = input.area;
|
|
357
|
551
|
model.F_Town = input.town;
|
|
|
@@ -359,8 +553,17 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
359
|
553
|
model.F_Province1 = input.province1;
|
|
360
|
554
|
model.F_Area1 = input.area1;
|
|
361
|
555
|
model.F_Town1 = input.town1;
|
|
362
|
|
- model.F_Postcode1 = input.postcode1;
|
|
363
|
556
|
model.F_City1 = input.city1;
|
|
|
557
|
+ model.F_Address1 = input.address1;
|
|
|
558
|
+
|
|
|
559
|
+
|
|
|
560
|
+ model.F_Province2 = input.province2;
|
|
|
561
|
+ model.F_Area2 = input.area2;
|
|
|
562
|
+ model.F_Town2 = input.town2;
|
|
|
563
|
+ model.F_City2= input.city2;
|
|
|
564
|
+ model.F_Address2 = input.address2;
|
|
|
565
|
+
|
|
|
566
|
+ model.F_Postcode1 = input.postcode1;
|
|
364
|
567
|
model.F_ShoeSize = input.shoesize;
|
|
365
|
568
|
model.F_Score = input.score;
|
|
366
|
569
|
model.F_Money = input.money;
|
|
|
@@ -379,7 +582,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
379
|
582
|
model.F_GiftYear = DateTime.Now.Year.ToString();
|
|
380
|
583
|
}
|
|
381
|
584
|
}
|
|
382
|
|
- var call = await busCallRecordsRepository.GetListALL(x => x.CallState == 1 || (x.Caller == input.phone || x.Caller == input.mobile || x.Caller == input.mobile1 || x.Caller == input.mobile2) || (x.Callee == input.phone || x.Callee == input.mobile || x.Callee == input.mobile1 || x.Callee == input.mobile2));
|
|
|
585
|
+ var call = await busCallRecordsRepository.GetListALL(x => x.CallState == 1 || x.Caller == input.phone);
|
|
383
|
586
|
if (call!=null && call.Count >0)
|
|
384
|
587
|
{
|
|
385
|
588
|
model.F_Firstcalltime = call[0].BeginTime;
|
|
|
@@ -388,7 +591,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
388
|
591
|
|
|
389
|
592
|
|
|
390
|
593
|
|
|
391
|
|
- if (await _cus_vip_infoRepository.GetCount(x => x.F_Mobile == model.F_Mobile && x.F_Name == input.name) > 0)
|
|
|
594
|
+ if (await _cus_vip_infoRepository.GetCount(x => x.F_Mobile == model.F_Mobile && x.F_Name == input.name&&x.F_State ==1) > 0)
|
|
392
|
595
|
{
|
|
393
|
596
|
return Error("添加失败,存在相同会员信息");
|
|
394
|
597
|
}
|
|
|
@@ -402,7 +605,6 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
402
|
605
|
return Error("添加失败");
|
|
403
|
606
|
}
|
|
404
|
607
|
}
|
|
405
|
|
-
|
|
406
|
608
|
/// <summary>
|
|
407
|
609
|
/// 修改会员信息
|
|
408
|
610
|
/// </summary>
|
|
|
@@ -444,6 +646,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
444
|
646
|
point_Agent.agent = user;
|
|
445
|
647
|
var phone = _point_agentrepository.Add(point_Agent);
|
|
446
|
648
|
}
|
|
|
649
|
+ model.F_RecommenderID = input.F_RecommenderID;
|
|
447
|
650
|
model.F_Recommender = input.recommender;
|
|
448
|
651
|
if (!string.IsNullOrEmpty(input.recommendertel))
|
|
449
|
652
|
{
|
|
|
@@ -464,45 +667,24 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
464
|
667
|
model.F_Age = input.age;
|
|
465
|
668
|
if (!string.IsNullOrEmpty(input.mobile))
|
|
466
|
669
|
{
|
|
467
|
|
- if (!valtel(input.mobile))
|
|
468
|
|
- return Error("手机号必须为11位数字");
|
|
469
|
|
- model.F_Mobile = input.mobile;
|
|
470
|
|
- var _point = await _point_agentrepository.GetListALL(x => x.caller == input.mobile);
|
|
471
|
|
- if (_point == null && _point.Count() <= 0)
|
|
|
670
|
+ string[] mobile1 = input.mobile.TrimEnd(',').Split(',');
|
|
|
671
|
+ foreach (var it in mobile1)
|
|
472
|
672
|
{
|
|
473
|
|
- point_agent point_Agent = new point_agent();
|
|
474
|
|
- point_Agent.caller = input.mobile;
|
|
475
|
|
- point_Agent.agent = user;
|
|
476
|
|
- var phone = _point_agentrepository.Add(point_Agent);
|
|
477
|
|
- }
|
|
478
|
|
- }
|
|
479
|
|
- if (!string.IsNullOrEmpty(input.mobile1))
|
|
480
|
|
- {
|
|
481
|
|
- if (!valtel(input.mobile1))
|
|
482
|
|
- return Error("手机号必须为11位数字");
|
|
483
|
|
- model.F_Mobile1 = input.mobile1; var _point = await _point_agentrepository.GetListALL(x => x.caller == input.mobile1);
|
|
484
|
|
- if (_point == null && _point.Count() <= 0)
|
|
485
|
|
- {
|
|
486
|
|
- point_agent point_Agent = new point_agent();
|
|
487
|
|
- point_Agent.caller = input.mobile1;
|
|
488
|
|
- point_Agent.agent = user;
|
|
489
|
|
- var phone = _point_agentrepository.Add(point_Agent);
|
|
490
|
|
- }
|
|
491
|
|
- }
|
|
492
|
|
- if (!string.IsNullOrEmpty(input.mobile2))
|
|
493
|
|
- {
|
|
494
|
|
- if (!valtel(input.mobile2))
|
|
495
|
|
- return Error("手机号必须为11位数字");
|
|
496
|
|
- model.F_Mobile2 = input.mobile2;
|
|
497
|
|
- model.F_Mobile1 = input.mobile1; var _point = await _point_agentrepository.GetListALL(x => x.caller == input.mobile2);
|
|
498
|
|
- if (_point == null && _point.Count() <= 0)
|
|
499
|
|
- {
|
|
500
|
|
- point_agent point_Agent = new point_agent();
|
|
501
|
|
- point_Agent.caller = input.mobile2;
|
|
502
|
|
- point_Agent.agent = user;
|
|
503
|
|
- var phone = _point_agentrepository.Add(point_Agent);
|
|
|
673
|
+ if (!valtel(it))
|
|
|
674
|
+ return Error("手机号必须为11位数字");
|
|
|
675
|
+
|
|
|
676
|
+ var _point = await _point_agentrepository.GetListALL(x => x.caller == it);
|
|
|
677
|
+ if (_point == null && _point.Count() <= 0)
|
|
|
678
|
+ {
|
|
|
679
|
+ point_agent point_Agent = new point_agent();
|
|
|
680
|
+ point_Agent.caller = it;
|
|
|
681
|
+ point_Agent.agent = user;
|
|
|
682
|
+ var phone = _point_agentrepository.Add(point_Agent);
|
|
|
683
|
+ }
|
|
504
|
684
|
}
|
|
|
685
|
+ model.F_Mobile = input.mobile.TrimEnd(',');
|
|
505
|
686
|
}
|
|
|
687
|
+
|
|
506
|
688
|
model.F_Province = input.province;
|
|
507
|
689
|
model.F_Area = input.area;
|
|
508
|
690
|
model.F_Town = input.town;
|
|
|
@@ -516,6 +698,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
516
|
698
|
model.F_Score = input.score;
|
|
517
|
699
|
model.F_Money = input.money;
|
|
518
|
700
|
model.F_TotalScore = input.totalscore;
|
|
|
701
|
+ model.F_Province2 = input.province2;
|
|
|
702
|
+ model.F_Area2 = input.area2;
|
|
|
703
|
+ model.F_Town2 = input.town2;
|
|
|
704
|
+ model.F_City2 = input.city2;
|
|
|
705
|
+ model.F_Address2 = input.address2;
|
|
519
|
706
|
//model.F_Saleperson = input.saleperson;
|
|
520
|
707
|
//model.F_Contact = input.contact;
|
|
521
|
708
|
model.F_Type = input.type;
|
|
|
@@ -531,7 +718,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
531
|
718
|
}
|
|
532
|
719
|
}
|
|
533
|
720
|
}
|
|
534
|
|
- var call = await busCallRecordsRepository.GetListALL(x => x.CallState == 1 || (x.Caller == input.phone || x.Caller == input.mobile || x.Caller == input.mobile1 || x.Caller == input.mobile2) || (x.Callee == input.phone || x.Callee == input.mobile || x.Callee == input.mobile1 || x.Callee == input.mobile2));
|
|
|
721
|
+ var call = await busCallRecordsRepository.GetListALL(x => x.CallState == 1 || x.Caller == input.phone);
|
|
535
|
722
|
if (call != null && call.Count > 0)
|
|
536
|
723
|
{
|
|
537
|
724
|
model.F_Firstcalltime = call[0].BeginTime;
|
|
|
@@ -543,7 +730,6 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
543
|
730
|
return Success("修改成功");
|
|
544
|
731
|
return Error("修改失败");
|
|
545
|
732
|
}
|
|
546
|
|
-
|
|
547
|
733
|
/// <summary>
|
|
548
|
734
|
/// 删除会员信息 by ids
|
|
549
|
735
|
/// </summary>
|
|
|
@@ -574,6 +760,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
574
|
760
|
else
|
|
575
|
761
|
return Error("请选择要删除的记录");
|
|
576
|
762
|
}
|
|
|
763
|
+
|
|
577
|
764
|
/// <summary>
|
|
578
|
765
|
/// 判断号码必须为十一位数字
|
|
579
|
766
|
/// </summary>
|