|
@@ -218,6 +218,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
218
|
218
|
changeNotice.setCustomerName(customer.getName());
|
219
|
219
|
changeNotice.setNoticeType(CommConstant.NOTICE_TYPE_STATUS_CHANGE);
|
220
|
220
|
changeNotice.setContent("状态 到访");
|
|
221
|
+ bkNoticeMapper.insert(changeNotice);
|
221
|
222
|
}
|
222
|
223
|
}
|
223
|
224
|
customerVisit.setRealtyConsultant(params.getRealtyConsultant());
|
|
@@ -422,6 +423,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
422
|
423
|
changeNotice.setCustomerName(customer.getName());
|
423
|
424
|
changeNotice.setNoticeType(CommConstant.NOTICE_TYPE_STATUS_CHANGE);
|
424
|
425
|
changeNotice.setContent("状态 认筹");
|
|
426
|
+ bkNoticeMapper.insert(changeNotice);
|
425
|
427
|
}
|
426
|
428
|
}
|
427
|
429
|
|
|
@@ -656,9 +658,14 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
656
|
658
|
return i == null ? 0 : i;
|
657
|
659
|
}
|
658
|
660
|
|
659
|
|
- private void processCommission(MarkingSignatoryCustomerDTO params, ChannelCustomer customer, TaPerson recommendPerson, String bizType, TaBuilding taBuilding) {
|
|
661
|
+ private void processCommission(MarkingSignatoryCustomerDTO params, ChannelCustomer customer, TaPerson recommendPerson, String bizType, TaBuilding taBuilding) throws Exception {
|
660
|
662
|
if (null == recommendPerson) return;
|
661
|
663
|
|
|
664
|
+ // 校验数据, 总佣金 - 已结 < 当前结算
|
|
665
|
+ if (intIfNvl(params.getTotalCommission()) - intIfNvl(params.getSettledCommission()) < intIfNvl(params.getCurrentCommission())) {
|
|
666
|
+ throw new Exception("结算佣金填写错误");
|
|
667
|
+ }
|
|
668
|
+
|
662
|
669
|
// 为了防止数据有改动, 比如更新操作
|
663
|
670
|
// 那么需要把原来的值减掉,再使用新的值
|
664
|
671
|
Integer totalCommission = intIfNvl(recommendPerson.getTotalCommission()) -
|
|
@@ -699,7 +706,8 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
699
|
706
|
}
|
700
|
707
|
|
701
|
708
|
// 生成成交喜报
|
702
|
|
- BkNotice bkNotice = bkNoticeMapper.getByPerson(CommConstant.NOTICE_TYPE_DEAL, recommendPerson.getName(), customer.getCustomerId());
|
|
709
|
+ BkNotice bkNotice = bkNoticeMapper.getByPerson(CommConstant.NOTICE_TYPE_DEAL, recommendPerson.getPersonId(), customer.getCustomerId());
|
|
710
|
+ String content = String.format("佣金 %.2f 元", (float) intIfNvl(params.getTotalCommission()) / 100 );
|
703
|
711
|
if (null == bkNotice) {
|
704
|
712
|
bkNotice = new BkNotice();
|
705
|
713
|
bkNotice.setOrgId(taBuilding.getOrgId().toString());
|
|
@@ -712,8 +720,11 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
712
|
720
|
bkNotice.setCustomerName(customer.getName());
|
713
|
721
|
// 佣金消息
|
714
|
722
|
bkNotice.setNoticeType(CommConstant.NOTICE_TYPE_DEAL);
|
715
|
|
- bkNotice.setContent(String.format("佣金 %.2f 元", (float) intIfNvl(params.getTotalCommission()) / 100 ));
|
|
723
|
+ bkNotice.setContent(content);
|
716
|
724
|
bkNoticeMapper.insert(bkNotice);
|
|
725
|
+ } else {
|
|
726
|
+ bkNotice.setContent(content);
|
|
727
|
+ bkNoticeMapper.updateById(bkNotice);
|
717
|
728
|
}
|
718
|
729
|
}
|
719
|
730
|
|