Commit 6af1f4a8297bd9e524ca140ef6eea16ba30e7e30

Authored by 张志伟
1 parent 714c2054

:construction: 线索池新增字段

fw-valhalla-dao/src/main/resources/mapper/CustomerCluePoolMapper.xml
... ... @@ -26,10 +26,12 @@
26 26 t1.finish_user_id finish_user_id,
27 27 t1.finish_user_name finish_user,
28 28 t1.finish_shop_id finish_shop_id,
29   - t1.finish_shop_name finish_shop
  29 + t1.finish_shop_name finish_shop,
  30 + t4.expires loan_expires
30 31 FROM customer_clue_pool t1
31 32 left join customer t2 on t1.referer_id = t2.id
32 33 left join accident_pool t3 on t1.referer_id = t3.id
  34 + left join customer_loan_info t4 on t2.frame_no = t4.frame_no and t2.group_id = t4.group_id
33 35 <where>
34 36 t1.clue_status != 1
35 37 <if test="condition.type !=null">
... ... @@ -53,6 +55,12 @@
53 55 <if test="condition.startTime !=null">
54 56 and DATE_FORMAT(t1.start_time, '%Y-%m') = DATE_FORMAT(#{condition.startTime}, '%Y-%m')
55 57 </if>
  58 + <if test="condition.loanCustomer !=null and condition.loanCustomer == 1">
  59 + and t4.expires > now()
  60 + </if>
  61 + <if test="condition.loanCustomer !=null and condition.loanCustomer == 0">
  62 + and t4.expires &lt;= now()
  63 + </if>
56 64 <if test="condition.shopIds !=null">
57 65 and t1.original_shop_id in
58 66 <foreach collection="condition.shopIds" item="id" index="index" open="(" close=")" separator=",">
... ... @@ -102,6 +110,7 @@
102 110 FROM customer_clue_pool t1
103 111 left join customer t2 on t1.referer_id = t2.id
104 112 left join accident_pool t3 on t1.referer_id = t3.id
  113 + left join customer_loan_info t4 on t2.frame_no = t4.frame_no and t2.group_id = t4.group_id
105 114 <where>
106 115 t1.clue_status != 1
107 116 <if test="condition.type !=null">
... ... @@ -125,6 +134,12 @@
125 134 <if test="condition.startTime !=null">
126 135 and DATE_FORMAT(t1.start_time, '%Y-%m') = DATE_FORMAT(#{condition.startTime}, '%Y-%m')
127 136 </if>
  137 + <if test="condition.loanCustomer !=null and condition.loanCustomer == 1">
  138 + and t4.expires > now()
  139 + </if>
  140 + <if test="condition.loanCustomer !=null and condition.loanCustomer == 0">
  141 + and t4.expires &lt;= now()
  142 + </if>
128 143 <if test="condition.comShops !=null">
129 144 and t1.finish_shop_id in
130 145 <foreach collection="condition.comShops" item="id" index="index" open="(" close=")" separator=",">
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/CustomerCluePoolDTO.java
... ... @@ -98,4 +98,8 @@ public class CustomerCluePoolDTO {
98 98 * 战败时间
99 99 */
100 100 private Date defeatTime;
  101 + /**
  102 + * 贷款到期时间
  103 + */
  104 + private Date loanExpires;
101 105 }
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/query/CustomerCluePoolQueryVO.java
... ... @@ -14,6 +14,7 @@ import java.time.ZoneId;
14 14 import java.util.Arrays;
15 15 import java.util.Date;
16 16 import java.util.List;
  17 +import java.util.Objects;
17 18 import java.util.stream.Collectors;
18 19  
19 20 /**
... ... @@ -36,11 +37,22 @@ public class CustomerCluePoolQueryVO extends PoolQuery {
36 37 private String comShops;
37 38 private String frameNo;
38 39 /**
  40 + * 贷款期客户
  41 + */
  42 + private Boolean loanCustomer;
  43 + /**
39 44 * 管理门店范围
40 45 */
41 46 private String scope;
42 47  
43 48  
  49 + public Integer getLoanCustomer() {
  50 + if (Objects.isNull(loanCustomer)) {
  51 + return null;
  52 + }
  53 + return loanCustomer ? 1 : 0;
  54 + }
  55 +
44 56 public Date getStartTime() {
45 57 if (StringUtils.isNotBlank(startTime) && NumberUtils.isDigits(startTime)) {
46 58 LocalDateTime localDateTime = Instant.ofEpochMilli(NumberUtils.toLong(startTime)).atZone(ZoneId.systemDefault()).toLocalDateTime();
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/CustomerCluePoolVO.java
... ... @@ -28,6 +28,10 @@ public class CustomerCluePoolVO {
28 28 */
29 29 private String frameNo;
30 30 /**
  31 + * 是否是贷款客户
  32 + */
  33 + private Boolean loanCustomer;
  34 + /**
31 35 * 购车时间
32 36 */
33 37 private Date buyDate;
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java
... ... @@ -234,6 +234,9 @@ public class PoolBizService {
234 234 CustomerCluePoolVO vo = new CustomerCluePoolVO();
235 235 BeanUtils.copyProperties(poolDTO, vo);
236 236 vo.setStatus(poolDTO.getClueStatus());
  237 + if (Objects.nonNull(poolDTO.getLoanExpires())) {
  238 + vo.setLoanCustomer(DateUtil.date2LocalDate(poolDTO.getLoanExpires()).isAfter(LocalDate.now()));
  239 + }
237 240 if (ClueStatusEnum.COMPLETE.getValue().equals(poolDTO.getClueStatus()) && scope.contains(poolDTO.getFinishShopId())) {
238 241 vo.setStatus(ClueStatusEnum.COMPLETE.getValue());
239 242 }
... ...