张延森 2 年之前
父節點
當前提交
a84b88c5e4

+ 18
- 3
src/main/java/com/yunzhi/marketing/broker/entity/BkNotice.java 查看文件

27
     private static final long serialVersionUID = 1L;
27
     private static final long serialVersionUID = 1L;
28
 
28
 
29
     @ApiModelProperty(value = "公告ID")
29
     @ApiModelProperty(value = "公告ID")
30
-    @TableId(value = "notice_id", type = IdType.INPUT)
31
-    private String noticeId;
30
+    @TableId(value = "notice_id", type = IdType.AUTO)
31
+    private Integer noticeId;
32
+
33
+    @ApiModelProperty(value = "消息类型")
34
+    private String noticeType;
32
 
35
 
33
     @ApiModelProperty(value = "楼盘ID")
36
     @ApiModelProperty(value = "楼盘ID")
34
     private String buildingId;
37
     private String buildingId;
35
 
38
 
36
     @ApiModelProperty(value = "楼盘名称")
39
     @ApiModelProperty(value = "楼盘名称")
37
-    private String builidngName;
40
+    private String buildingName;
41
+
42
+    @ApiModelProperty(value = "经纪人ID")
43
+    private String personId;
44
+
45
+    @ApiModelProperty(value = "经纪人名称")
46
+    private String personName;
47
+
48
+    @ApiModelProperty(value = "客户ID")
49
+    private String customerId;
50
+
51
+    @ApiModelProperty(value = "客户名称")
52
+    private String customerName;
38
 
53
 
39
     @ApiModelProperty(value = "公告内容")
54
     @ApiModelProperty(value = "公告内容")
40
     private String content;
55
     private String content;

+ 4
- 0
src/main/java/com/yunzhi/marketing/broker/mapper/BkNoticeMapper.java 查看文件

3
 import com.yunzhi.marketing.broker.entity.BkNotice;
3
 import com.yunzhi.marketing.broker.entity.BkNotice;
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6
 
7
 
7
 /**
8
 /**
8
  * <p>
9
  * <p>
15
 @Mapper
16
 @Mapper
16
 public interface BkNoticeMapper extends BaseMapper<BkNotice> {
17
 public interface BkNoticeMapper extends BaseMapper<BkNotice> {
17
 
18
 
19
+    BkNotice getByPerson(@Param("noticeType") String noticeType,
20
+                         @Param("personId") String personId,
21
+                         @Param("customerId") String customerId);
18
 }
22
 }

+ 7
- 2
src/main/java/com/yunzhi/marketing/common/CommConstant.java 查看文件

958
      * 课程授权人员类型
958
      * 课程授权人员类型
959
      */
959
      */
960
     public static final String CURRICULUM_TYPE_AGENT = "1";
960
     public static final String CURRICULUM_TYPE_AGENT = "1";
961
-    public static final String CURRICULUM_TYPE_COUSULTANT = "2";
962
-    public static final String CURRICULUM_TYPE_COUSULTANT_AND_AGENT = "3";
961
+    public static final String CURRICULUM_TYPE_CONSULTANT = "2";
962
+    public static final String CURRICULUM_TYPE_CONSULTANT_AND_AGENT = "3";
963
 
963
 
964
     /**
964
     /**
965
      * 渠道报备客户审核结果
965
      * 渠道报备客户审核结果
971
      * 根机构ID
971
      * 根机构ID
972
      */
972
      */
973
     public static final String ROOT_INSTITUTION = "1"; // 原来是 01 估计是个 bug
973
     public static final String ROOT_INSTITUTION = "1"; // 原来是 01 估计是个 bug
974
+
975
+    /** 成交喜报 **/
976
+    public static final String NOTICE_TYPE_DEAL = "deal";
977
+    /** 客户状态变成 **/
978
+    public static final String NOTICE_TYPE_STATUS_CHANGE = "status-change";
974
 }
979
 }
975
 
980
 

+ 2
- 2
src/main/java/com/yunzhi/marketing/xlk/controller/CurriculumController.java 查看文件

298
         }
298
         }
299
 
299
 
300
         switch (requireRole) {
300
         switch (requireRole) {
301
-            case CommConstant.CURRICULUM_TYPE_COUSULTANT_AND_AGENT:
301
+            case CommConstant.CURRICULUM_TYPE_CONSULTANT_AND_AGENT:
302
                 return CommConstant.PERSON_ESTATE_CHANNEL.equals(personType) || CommConstant.PERSON_REALTY_CONSULTANT.equals(personType);
302
                 return CommConstant.PERSON_ESTATE_CHANNEL.equals(personType) || CommConstant.PERSON_REALTY_CONSULTANT.equals(personType);
303
-            case CommConstant.CURRICULUM_TYPE_COUSULTANT:
303
+            case CommConstant.CURRICULUM_TYPE_CONSULTANT:
304
                 return CommConstant.PERSON_REALTY_CONSULTANT.equals(personType);
304
                 return CommConstant.PERSON_REALTY_CONSULTANT.equals(personType);
305
             case CommConstant.CURRICULUM_TYPE_AGENT:
305
             case CommConstant.CURRICULUM_TYPE_AGENT:
306
                 return CommConstant.PERSON_ESTATE_CHANNEL.equals(personType);
306
                 return CommConstant.PERSON_ESTATE_CHANNEL.equals(personType);

+ 52
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java 查看文件

8
 import com.yunzhi.marketing.broker.entity.BkAccountRecord;
8
 import com.yunzhi.marketing.broker.entity.BkAccountRecord;
9
 import com.yunzhi.marketing.broker.entity.BkAgentRule;
9
 import com.yunzhi.marketing.broker.entity.BkAgentRule;
10
 import com.yunzhi.marketing.broker.entity.BkInviteRecord;
10
 import com.yunzhi.marketing.broker.entity.BkInviteRecord;
11
+import com.yunzhi.marketing.broker.entity.BkNotice;
11
 import com.yunzhi.marketing.broker.mapper.BkAccountRecordMapper;
12
 import com.yunzhi.marketing.broker.mapper.BkAccountRecordMapper;
12
 import com.yunzhi.marketing.broker.mapper.BkAgentRuleMapper;
13
 import com.yunzhi.marketing.broker.mapper.BkAgentRuleMapper;
13
 import com.yunzhi.marketing.broker.mapper.BkInviteRecordMapper;
14
 import com.yunzhi.marketing.broker.mapper.BkInviteRecordMapper;
15
+import com.yunzhi.marketing.broker.mapper.BkNoticeMapper;
14
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
16
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
15
 import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
17
 import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
16
 import com.yunzhi.marketing.common.CommConstant;
18
 import com.yunzhi.marketing.common.CommConstant;
81
     @Autowired
83
     @Autowired
82
     private BkAccountRecordMapper bkAccountRecordMapper;
84
     private BkAccountRecordMapper bkAccountRecordMapper;
83
 
85
 
86
+    @Autowired
87
+    private BkNoticeMapper bkNoticeMapper;
88
+
84
     /**
89
     /**
85
      * 审核
90
      * 审核
86
      *
91
      *
632
             bkAccountRecord.setCreateDate(LocalDateTime.now());
637
             bkAccountRecord.setCreateDate(LocalDateTime.now());
633
             bkAccountRecordMapper.insert(bkAccountRecord);
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
 
698
 
661
         bkInviteRecord.setReferralFee(agentRule.getReferralFee());
699
         bkInviteRecord.setReferralFee(agentRule.getReferralFee());
662
         bkInviteRecordMapper.updateById(bkInviteRecord);
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
 }

+ 3
- 3
src/main/java/com/yunzhi/marketing/xlk/service/impl/CurriculumServiceImpl.java 查看文件

44
     public IPage<Curriculum> getWxList(IPage<Curriculum> pg, String name, TaPerson person) {
44
     public IPage<Curriculum> getWxList(IPage<Curriculum> pg, String name, TaPerson person) {
45
         List<String> roleList = new ArrayList<>();
45
         List<String> roleList = new ArrayList<>();
46
         if (CommConstant.PERSON_REALTY_CONSULTANT.equals(person.getPersonType())) {
46
         if (CommConstant.PERSON_REALTY_CONSULTANT.equals(person.getPersonType())) {
47
-            roleList.add(CommConstant.CURRICULUM_TYPE_COUSULTANT);
48
-            roleList.add(CommConstant.CURRICULUM_TYPE_COUSULTANT_AND_AGENT);
47
+            roleList.add(CommConstant.CURRICULUM_TYPE_CONSULTANT);
48
+            roleList.add(CommConstant.CURRICULUM_TYPE_CONSULTANT_AND_AGENT);
49
         } else if (CommConstant.PERSON_ESTATE_CHANNEL.equals(person.getPersonType())) {
49
         } else if (CommConstant.PERSON_ESTATE_CHANNEL.equals(person.getPersonType())) {
50
             roleList.add(CommConstant.CURRICULUM_TYPE_AGENT);
50
             roleList.add(CommConstant.CURRICULUM_TYPE_AGENT);
51
-            roleList.add(CommConstant.CURRICULUM_TYPE_COUSULTANT_AND_AGENT);
51
+            roleList.add(CommConstant.CURRICULUM_TYPE_CONSULTANT_AND_AGENT);
52
         } else {
52
         } else {
53
             roleList.add("*");
53
             roleList.add("*");
54
         }
54
         }

+ 10
- 0
src/main/resources/mapper/BkNoticeMapper.xml 查看文件

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.yunzhi.marketing.broker.mapper.BkNoticeMapper">
3
 <mapper namespace="com.yunzhi.marketing.broker.mapper.BkNoticeMapper">
4
 
4
 
5
+    <select id="getByPerson" resultType="com.yunzhi.marketing.broker.entity.BkNotice">
6
+        SELECT
7
+            *
8
+        FROM
9
+            bk_notice t
10
+        WHERE
11
+            t.notice_type = #{noticeType}
12
+          AND t.person_id = #{personId}
13
+          AND t.customer_id = #{customerId}
14
+    </select>
5
 </mapper>
15
 </mapper>