diff --git a/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java b/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java index 4d69235..ffeb0fc 100644 --- a/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java +++ b/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java @@ -4,12 +4,10 @@ import cn.fw.data.base.domain.common.Message; import cn.fw.valhalla.sdk.param.*; import cn.fw.valhalla.sdk.result.*; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.*; import javax.validation.Valid; + import java.util.List; /** @@ -37,7 +35,7 @@ public interface CustomerApiService { * @param updateBuyDateParams */ @PostMapping("/update/buyDate") - Message updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams); + Message updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams); /** * 新增或更新售后保有客档案 @@ -235,4 +233,15 @@ public interface CustomerApiService { */ @GetMapping("/query/by/keyword") Message> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId); + + /** + * 通过车架号查询认证车辆信息 + * + * @param vin 车架号 + * @return 认证车辆 + */ + @GetMapping("/query/vehicle/by/vin") + Message queryVehicle(@RequestParam("vin") String vin); + + } diff --git a/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/MemberVehicleDTO.java b/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/MemberVehicleDTO.java index 1c39dd6..7bf2ced 100644 --- a/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/MemberVehicleDTO.java +++ b/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/MemberVehicleDTO.java @@ -14,6 +14,18 @@ import java.util.Date; @Data public class MemberVehicleDTO { /** + * 会员id + */ + private Long memberId; + /** + * 会员姓名 + */ + private String memberName; + /** + * 会员手机号 + */ + private String memberPhone; + /** * 所有者 */ private String name; diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java index 38a6e17..b392b49 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java @@ -97,7 +97,6 @@ public class CustomerApiServiceImpl implements CustomerApiService { @GetMapping("/query/by/mobile") @ControllerMethod("通过电话号码查询保有客档案列表") public Message> queryByMobile(@RequestParam("mobile") String mobile, Long groupId) { - BV.isTrue(StringUtils.isNotBlank(mobile), "手机号不正确"); List list = customerBiz.queryByMobile(mobile, groupId); List dtoList = new ArrayList<>(); for (CustomerDetailDto customer : list) { @@ -265,10 +264,17 @@ public class CustomerApiServiceImpl implements CustomerApiService { return success(); } - @GetMapping("/query/by/keyword") @Override + @GetMapping("/query/by/keyword") @ControllerMethod("通过关键字查询档案列表") public Message> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId) { return success(customerBiz.queryByKeyword(keyword, groupId)); } + + @Override + @GetMapping("/query/vehicle/by/vin") + @ControllerMethod("查询车辆认证信息") + public Message queryVehicle(@RequestParam("vin") final String vin) { + return success(customerBiz.queryVehicleByVin(vin)); + } } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java index 0b41cee..77ae804 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java @@ -1018,6 +1018,19 @@ public class CustomerBizService extends AbstractCustomerService { } + public MemberVehicleDTO queryVehicleByVin(String vin) { + MemberVehicle memberVehicle = memberVehicleService.getVehicle(vin); + if (Objects.isNull(memberVehicle)) { + return null; + } + MemberVehicleDTO dto = BeanUtils.copy(memberVehicle, MemberVehicleDTO.class); + dto.setCusType(memberVehicle.getCusType().getValue()); + dto.setUseType(memberVehicle.getUseType().getValue()); + MemberUserDTO member = memberRpcService.user(memberVehicle.getMemberId()); + dto.setMemberPhone(Objects.nonNull(member) ? member.getPhone() : null); + return dto; + } + private AffiliationRecord createEntity(CustomerDetailDto customer) { AffiliationRecord record = new AffiliationRecord();