Commit 37a9df0d342bff54507e61e9b86c5d06a96e11ee

Authored by 张志伟
1 parent 25c2fc65

:bug: v1.1.0 小程序新增贷款期状态查询

fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/customer/CarArchiveVO.java
... ... @@ -40,6 +40,10 @@ public class CarArchiveVO {
40 40 */
41 41 private String carName;
42 42 /**
  43 + * 车架号
  44 + */
  45 + private String frameNo;
  46 + /**
43 47 * 车辆图片
44 48 */
45 49 private String image;
... ... @@ -60,6 +64,10 @@ public class CarArchiveVO {
60 64 */
61 65 private Long shopId;
62 66 /**
  67 + * 集团id
  68 + */
  69 + private Long groupId;
  70 + /**
63 71 * 座位数
64 72 */
65 73 private Integer seatCnt;
... ... @@ -84,6 +92,18 @@ public class CarArchiveVO {
84 92 */
85 93 private String adviserName;
86 94 /**
  95 + * 是否是贷款客户
  96 + */
  97 + private boolean loanCustomer;
  98 + /**
  99 + * 分期期数
  100 + */
  101 + private Integer periods;
  102 + /**
  103 + * 贷款到期时间
  104 + */
  105 + private Date expires;
  106 + /**
87 107 * 商家信息
88 108 */
89 109 private DealerItem dealerInfoVO;
... ... @@ -96,10 +116,12 @@ public class CarArchiveVO {
96 116 vo.setCarId(customer.getId());
97 117 vo.setPlateNo(customer.getPlateNo());
98 118 vo.setSeriesId(customer.getSeriesId());
  119 + vo.setFrameNo(customer.getFrameNo());
99 120 vo.setSpecId(customer.getSpecId());
100 121 vo.setCarName(customer.getSeriesName().concat(" ").concat(Optional.ofNullable(customer.getSpecName()).orElse("")));
101 122 vo.setCusId(customer.getId());
102 123 vo.setShopId(customer.getShopId());
  124 + vo.setGroupId(customer.getGroupId());
103 125 vo.setAdviserId(customer.getAdviserId());
104 126 //固定座位数为5
105 127 vo.setSeatCnt(5);
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... ... @@ -39,6 +39,7 @@ import org.springframework.context.ApplicationEventPublisher;
39 39 import org.springframework.stereotype.Service;
40 40 import org.springframework.transaction.annotation.Transactional;
41 41  
  42 +import java.time.LocalDate;
42 43 import java.time.LocalDateTime;
43 44 import java.util.*;
44 45 import java.util.stream.Collectors;
... ... @@ -551,6 +552,7 @@ public class CustomerBizService extends AbstractCustomerService {
551 552 vo.setDealerInfoVO(createDeal(vo.getShopId()));
552 553 vo.setOwner(true);
553 554 vo.setOwnerName(user.getRealName());
  555 + loanCustomer(vo);
554 556 }).collect(Collectors.toList());
555 557 }
556 558 return new ArrayList<>();
... ... @@ -627,4 +629,17 @@ public class CustomerBizService extends AbstractCustomerService {
627 629 log.error("新增客户贷款信息失败:", e);
628 630 }
629 631 }
  632 +
  633 + private void loanCustomer(CarArchiveVO vo) {
  634 + CustomerLoanInfo loanInfo = customerLoanInfoService.getOne(Wrappers.<CustomerLoanInfo>lambdaQuery()
  635 + .eq(CustomerLoanInfo::getGroupId, vo.getGroupId())
  636 + .eq(CustomerLoanInfo::getFrameNo, vo.getFrameNo())
  637 + .last(" limit 1 ")
  638 + );
  639 + if (Objects.nonNull(loanInfo)) {
  640 + vo.setLoanCustomer(LocalDate.now().isBefore(DateUtil.date2LocalDate(loanInfo.getExpires())));
  641 + vo.setExpires(loanInfo.getExpires());
  642 + vo.setPeriods(loanInfo.getPeriods());
  643 + }
  644 + }
630 645 }
... ...