|
@@ -8,9 +8,11 @@ import com.yunzhi.marketing.base.ResponseBean;
|
8
|
8
|
import com.yunzhi.marketing.broker.entity.BkAccountRecord;
|
9
|
9
|
import com.yunzhi.marketing.broker.entity.BkAgentRule;
|
10
|
10
|
import com.yunzhi.marketing.broker.entity.BkInviteRecord;
|
|
11
|
+import com.yunzhi.marketing.broker.entity.BkNotice;
|
11
|
12
|
import com.yunzhi.marketing.broker.mapper.BkAccountRecordMapper;
|
12
|
13
|
import com.yunzhi.marketing.broker.mapper.BkAgentRuleMapper;
|
13
|
14
|
import com.yunzhi.marketing.broker.mapper.BkInviteRecordMapper;
|
|
15
|
+import com.yunzhi.marketing.broker.mapper.BkNoticeMapper;
|
14
|
16
|
import com.yunzhi.marketing.center.taUser.entity.TaUser;
|
15
|
17
|
import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
|
16
|
18
|
import com.yunzhi.marketing.common.CommConstant;
|
|
@@ -81,6 +83,9 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
81
|
83
|
@Autowired
|
82
|
84
|
private BkAccountRecordMapper bkAccountRecordMapper;
|
83
|
85
|
|
|
86
|
+ @Autowired
|
|
87
|
+ private BkNoticeMapper bkNoticeMapper;
|
|
88
|
+
|
84
|
89
|
/**
|
85
|
90
|
* 审核
|
86
|
91
|
*
|
|
@@ -632,6 +637,39 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
632
|
637
|
bkAccountRecord.setCreateDate(LocalDateTime.now());
|
633
|
638
|
bkAccountRecordMapper.insert(bkAccountRecord);
|
634
|
639
|
}
|
|
640
|
+
|
|
641
|
+ // 生成节点变更通知
|
|
642
|
+ BkNotice changeNotice = new BkNotice();
|
|
643
|
+ changeNotice.setOrgId(taBuilding.getOrgId().toString());
|
|
644
|
+ changeNotice.setInstitutionId(taBuilding.getInstitutionId());
|
|
645
|
+ changeNotice.setBuildingId(taBuilding.getBuildingId());
|
|
646
|
+ changeNotice.setBuildingName(taBuilding.getBuildingName());
|
|
647
|
+ changeNotice.setPersonId(recommendPerson.getPersonId());
|
|
648
|
+ changeNotice.setPersonName(StringUtils.ifNull(recommendPerson.getName(), recommendPerson.getNickname()));
|
|
649
|
+ changeNotice.setCustomerId(customer.getCustomerId());
|
|
650
|
+ changeNotice.setCustomerName(customer.getName());
|
|
651
|
+ changeNotice.setNoticeType(CommConstant.NOTICE_TYPE_STATUS_CHANGE);
|
|
652
|
+ changeNotice.setContent(String.format("状态 %s", getStatusDesc(bizType)));
|
|
653
|
+ bkNoticeMapper.insert(changeNotice);
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+ // 生成成交喜报
|
|
657
|
+ BkNotice bkNotice = bkNoticeMapper.getByPerson(CommConstant.NOTICE_TYPE_DEAL, recommendPerson.getName(), customer.getCustomerId());
|
|
658
|
+ if (null == bkNotice) {
|
|
659
|
+ bkNotice = new BkNotice();
|
|
660
|
+ bkNotice.setOrgId(taBuilding.getOrgId().toString());
|
|
661
|
+ bkNotice.setInstitutionId(taBuilding.getInstitutionId());
|
|
662
|
+ bkNotice.setBuildingId(taBuilding.getBuildingId());
|
|
663
|
+ bkNotice.setBuildingName(taBuilding.getBuildingName());
|
|
664
|
+ bkNotice.setPersonId(recommendPerson.getPersonId());
|
|
665
|
+ bkNotice.setPersonName(StringUtils.ifNull(recommendPerson.getName(), recommendPerson.getNickname()));
|
|
666
|
+ bkNotice.setCustomerId(customer.getCustomerId());
|
|
667
|
+ bkNotice.setCustomerName(customer.getName());
|
|
668
|
+ // 佣金消息
|
|
669
|
+ bkNotice.setNoticeType(CommConstant.NOTICE_TYPE_DEAL);
|
|
670
|
+ bkNotice.setContent(String.format("佣金 %d", params.getTotalCommission()));
|
|
671
|
+ bkNoticeMapper.insert(bkNotice);
|
|
672
|
+ }
|
635
|
673
|
}
|
636
|
674
|
|
637
|
675
|
/**
|
|
@@ -660,5 +698,19 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
|
660
|
698
|
|
661
|
699
|
bkInviteRecord.setReferralFee(agentRule.getReferralFee());
|
662
|
700
|
bkInviteRecordMapper.updateById(bkInviteRecord);
|
|
701
|
+
|
|
702
|
+ }
|
|
703
|
+
|
|
704
|
+ private String getStatusDesc(String bizType) {
|
|
705
|
+ switch (bizType) {
|
|
706
|
+ case "commission":
|
|
707
|
+ return "结佣";
|
|
708
|
+ case "signatory":
|
|
709
|
+ return "签约";
|
|
710
|
+ case "all-payment":
|
|
711
|
+ return "全款到账";
|
|
712
|
+ default:
|
|
713
|
+ return "未知";
|
|
714
|
+ }
|
663
|
715
|
}
|
664
|
716
|
}
|