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

+ 2
- 0
src/main/java/com/yunzhi/marketing/broker/controller/BkAccountRecordController.java 查看文件

@@ -54,6 +54,7 @@ public class BkAccountRecordController extends BaseController {
54 54
     public ResponseBean bkAccountRecordList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55 55
                                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
56 56
                                             @ApiParam("收支类型") @RequestParam(value ="chargeCode", required = false) String chargeCode,
57
+                                            @ApiParam("是否已付佣金") @RequestParam(value ="isPayed", required = false) Boolean isPayed,
57 58
                                             HttpServletRequest request) throws Exception{
58 59
 
59 60
         String personId = getPersonId(request);
@@ -61,6 +62,7 @@ public class BkAccountRecordController extends BaseController {
61 62
         QueryWrapper<BkAccountRecord> queryWrapper = new QueryWrapper<>();
62 63
         queryWrapper.eq("person_id", personId);
63 64
         queryWrapper.eq(!StringUtils.isEmpty(chargeCode),"charge_code", chargeCode);
65
+        queryWrapper.gt(null != isPayed && isPayed, "charges", 0);
64 66
         queryWrapper.orderByDesc("create_date");
65 67
 
66 68
         IPage<BkAccountRecord> result = iBkAccountRecordService.page(pg, queryWrapper);

+ 2
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/CustomerPreparatoryMapper.java 查看文件

@@ -3,6 +3,7 @@ package com.yunzhi.marketing.xlk.mapper;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 /**
8 9
  * <p>
@@ -15,4 +16,5 @@ import org.apache.ibatis.annotations.Mapper;
15 16
 @Mapper
16 17
 public interface CustomerPreparatoryMapper extends BaseMapper<CustomerPreparatory> {
17 18
 
19
+    CustomerPreparatory getByCustomerId(@Param("customerId") String customerId, @Param("buildingId") String buildingId);
18 20
 }

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

@@ -441,6 +441,13 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
441 441
         }
442 442
         customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
443 443
         customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
444
+
445
+        // 校验是否已存在记录
446
+        CustomerPreparatory origin = customerPreparatoryMapper.getByCustomerId(customerPreparatory.getCustomerId(), customerPreparatory.getBuildingId());
447
+        if (origin != null && StringUtils.isEmpty(customerPreparatory.getCustomerPreparatoryId())) {
448
+            customerPreparatory.setCustomerPreparatoryId(origin.getCustomerPreparatoryId());
449
+        }
450
+
444 451
         if (StringUtils.isEmpty(customerPreparatory.getCustomerPreparatoryId())) {
445 452
             customerPreparatoryMapper.insert(customerPreparatory);
446 453
         } else {

+ 9
- 0
src/main/resources/mapper/xlk/CustomerPreparatoryMapper.xml 查看文件

@@ -2,4 +2,13 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.marketing.xlk.mapper.CustomerPreparatoryMapper">
4 4
 
5
+    <select id="getByCustomerId" resultType="com.yunzhi.marketing.xlk.entity.CustomerPreparatory">
6
+        SELECT
7
+            *
8
+        FROM
9
+            `xlk_customer_preparatory` t
10
+        WHERE
11
+            t.customer_id = #{customerId}
12
+          AND t.building_id = #{buildingId}
13
+    </select>
5 14
 </mapper>