张延森 2 年前
父节点
当前提交
3dde686c51

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

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

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

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
4
 import com.yunzhi.marketing.xlk.entity.CustomerPreparatory;
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 CustomerPreparatoryMapper extends BaseMapper<CustomerPreparatory> {
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
         }
441
         }
442
         customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
442
         customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
443
         customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
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
         if (StringUtils.isEmpty(customerPreparatory.getCustomerPreparatoryId())) {
451
         if (StringUtils.isEmpty(customerPreparatory.getCustomerPreparatoryId())) {
445
             customerPreparatoryMapper.insert(customerPreparatory);
452
             customerPreparatoryMapper.insert(customerPreparatory);
446
         } else {
453
         } else {

+ 9
- 0
src/main/resources/mapper/xlk/CustomerPreparatoryMapper.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.xlk.mapper.CustomerPreparatoryMapper">
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
 </mapper>
14
 </mapper>