|
@@ -347,14 +347,16 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
347
|
347
|
LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
348
|
348
|
channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
|
349
|
349
|
ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
|
350
|
|
- customer.setPreparatoryDate(LocalDateTime.now());
|
351
|
|
- channelCustomerMapper.updateById(customer);
|
|
350
|
+ if (null != customer) {
|
|
351
|
+ customer.setPreparatoryDate(LocalDateTime.now());
|
|
352
|
+ channelCustomerMapper.updateById(customer);
|
|
353
|
+ }
|
352
|
354
|
|
353
|
355
|
CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
|
354
|
356
|
customerPreparatory.setCreateDate(LocalDateTime.now());
|
355
|
|
- customerPreparatory.setBuildingId(customer.getBuildingId());
|
356
|
|
- customerPreparatory.setRecommendPerson(customer.getRecommendPerson());
|
357
|
|
- TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
|
|
357
|
+ customerPreparatory.setBuildingId(taRecommendCustomer.getBuildingId());
|
|
358
|
+ customerPreparatory.setRecommendPerson(taRecommendCustomer.getRecommendPerson());
|
|
359
|
+ TaPerson recommendPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
|
358
|
360
|
if (null != recommendPerson) {
|
359
|
361
|
customerPreparatory.setRealtyConsultantName(recommendPerson.getName());
|
360
|
362
|
}
|
|
@@ -363,7 +365,8 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
363
|
365
|
if (null != channelPerson) {
|
364
|
366
|
customerPreparatory.setRealtyConsultantName(channelPerson.getName());
|
365
|
367
|
}
|
366
|
|
- customerPreparatory.setOrgId(customer.getOrgId());
|
|
368
|
+ customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
|
|
369
|
+ customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
|
367
|
370
|
customerPreparatoryMapper.insert(customerPreparatory);
|
368
|
371
|
return ResponseBean.success("审核成功");
|
369
|
372
|
}
|
|
@@ -384,12 +387,14 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
384
|
387
|
LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
385
|
388
|
channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
|
386
|
389
|
ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
|
387
|
|
- customer.setCommissionDate(LocalDateTime.now());
|
388
|
|
- channelCustomerMapper.updateById(customer);
|
|
390
|
+ if (null != customer) {
|
|
391
|
+ customer.setCommissionDate(LocalDateTime.now());
|
|
392
|
+ channelCustomerMapper.updateById(customer);
|
|
393
|
+ }
|
389
|
394
|
|
390
|
|
- customerSignatory.setBuildingId(customer.getBuildingId());
|
391
|
|
- customerSignatory.setRecommendPerson(customer.getRecommendPerson());
|
392
|
|
- TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
|
|
395
|
+ customerSignatory.setBuildingId(taRecommendCustomer.getBuildingId());
|
|
396
|
+ customerSignatory.setRecommendPerson(taRecommendCustomer.getRecommendPerson());
|
|
397
|
+ TaPerson recommendPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
|
393
|
398
|
if (null != recommendPerson) {
|
394
|
399
|
customerSignatory.setRealtyConsultantName(recommendPerson.getName());
|
395
|
400
|
}
|
|
@@ -398,7 +403,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
398
|
403
|
if (null != channelPerson) {
|
399
|
404
|
customerSignatory.setRealtyConsultantName(channelPerson.getName());
|
400
|
405
|
}
|
401
|
|
- customerSignatory.setOrgId(customer.getOrgId());
|
|
406
|
+ customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
|
402
|
407
|
customerSignatory.setCreateDate(LocalDateTime.now());
|
403
|
408
|
customerSignatory.setType("commission");
|
404
|
409
|
customerSignatoryMapper.insert(customerSignatory);
|
|
@@ -422,14 +427,16 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
422
|
427
|
LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
423
|
428
|
channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
|
424
|
429
|
ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
|
425
|
|
- customer.setSignedDate(LocalDateTime.now());
|
426
|
|
- customer.setRealtyConsultant(customerSignatory.getRealtyConsultant());
|
427
|
|
- channelCustomerMapper.updateById(customer);
|
|
430
|
+ if (null != customer) {
|
|
431
|
+ customer.setSignedDate(LocalDateTime.now());
|
|
432
|
+ customer.setRealtyConsultant(customerSignatory.getRealtyConsultant());
|
|
433
|
+ channelCustomerMapper.updateById(customer);
|
|
434
|
+ }
|
428
|
435
|
|
429
|
436
|
customerSignatory.setCreateDate(LocalDateTime.now());
|
430
|
|
- customerSignatory.setBuildingId(customer.getBuildingId());
|
431
|
|
- customerSignatory.setRecommendPerson(customer.getRecommendPerson());
|
432
|
|
- TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
|
|
437
|
+ customerSignatory.setBuildingId(taRecommendCustomer.getBuildingId());
|
|
438
|
+ customerSignatory.setRecommendPerson(taRecommendCustomer.getRecommendPerson());
|
|
439
|
+ TaPerson recommendPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
|
433
|
440
|
if (null != recommendPerson) {
|
434
|
441
|
customerSignatory.setRealtyConsultantName(recommendPerson.getName());
|
435
|
442
|
}
|
|
@@ -438,7 +445,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
438
|
445
|
if (null != channelPerson) {
|
439
|
446
|
customerSignatory.setRealtyConsultantName(channelPerson.getName());
|
440
|
447
|
}
|
441
|
|
- customerSignatory.setOrgId(customer.getOrgId());
|
|
448
|
+ customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
|
442
|
449
|
customerSignatory.setType("signatory");
|
443
|
450
|
customerSignatoryMapper.insert(customerSignatory);
|
444
|
451
|
return ResponseBean.success("审核成功");
|