Commit 2b5a0035d91d4a3b311032b796030fa0cde81461
1 parent
ed9fad03
调整车辆认证逻辑
Showing
4 changed files
with
47 additions
and
7 deletions
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; | @@ -4,12 +4,10 @@ import cn.fw.data.base.domain.common.Message; | ||
4 | import cn.fw.valhalla.sdk.param.*; | 4 | import cn.fw.valhalla.sdk.param.*; |
5 | import cn.fw.valhalla.sdk.result.*; | 5 | import cn.fw.valhalla.sdk.result.*; |
6 | import org.springframework.cloud.openfeign.FeignClient; | 6 | import org.springframework.cloud.openfeign.FeignClient; |
7 | -import org.springframework.web.bind.annotation.GetMapping; | ||
8 | -import org.springframework.web.bind.annotation.PostMapping; | ||
9 | -import org.springframework.web.bind.annotation.RequestBody; | ||
10 | -import org.springframework.web.bind.annotation.RequestParam; | 7 | +import org.springframework.web.bind.annotation.*; |
11 | 8 | ||
12 | import javax.validation.Valid; | 9 | import javax.validation.Valid; |
10 | + | ||
13 | import java.util.List; | 11 | import java.util.List; |
14 | 12 | ||
15 | /** | 13 | /** |
@@ -37,7 +35,7 @@ public interface CustomerApiService { | @@ -37,7 +35,7 @@ public interface CustomerApiService { | ||
37 | * @param updateBuyDateParams | 35 | * @param updateBuyDateParams |
38 | */ | 36 | */ |
39 | @PostMapping("/update/buyDate") | 37 | @PostMapping("/update/buyDate") |
40 | - Message<Void> updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams); | 38 | + Message<Void> updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams); |
41 | 39 | ||
42 | /** | 40 | /** |
43 | * 新增或更新售后保有客档案 | 41 | * 新增或更新售后保有客档案 |
@@ -235,4 +233,15 @@ public interface CustomerApiService { | @@ -235,4 +233,15 @@ public interface CustomerApiService { | ||
235 | */ | 233 | */ |
236 | @GetMapping("/query/by/keyword") | 234 | @GetMapping("/query/by/keyword") |
237 | Message<List<BasicsCustomerDTO>> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId); | 235 | Message<List<BasicsCustomerDTO>> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId); |
236 | + | ||
237 | + /** | ||
238 | + * 通过车架号查询认证车辆信息 | ||
239 | + * | ||
240 | + * @param vin 车架号 | ||
241 | + * @return 认证车辆 | ||
242 | + */ | ||
243 | + @GetMapping("/query/vehicle/by/vin") | ||
244 | + Message<MemberVehicleDTO> queryVehicle(@RequestParam("vin") String vin); | ||
245 | + | ||
246 | + | ||
238 | } | 247 | } |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/MemberVehicleDTO.java
@@ -14,6 +14,18 @@ import java.util.Date; | @@ -14,6 +14,18 @@ import java.util.Date; | ||
14 | @Data | 14 | @Data |
15 | public class MemberVehicleDTO { | 15 | public class MemberVehicleDTO { |
16 | /** | 16 | /** |
17 | + * 会员id | ||
18 | + */ | ||
19 | + private Long memberId; | ||
20 | + /** | ||
21 | + * 会员姓名 | ||
22 | + */ | ||
23 | + private String memberName; | ||
24 | + /** | ||
25 | + * 会员手机号 | ||
26 | + */ | ||
27 | + private String memberPhone; | ||
28 | + /** | ||
17 | * 所有者 | 29 | * 所有者 |
18 | */ | 30 | */ |
19 | private String name; | 31 | private String name; |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
@@ -97,7 +97,6 @@ public class CustomerApiServiceImpl implements CustomerApiService { | @@ -97,7 +97,6 @@ public class CustomerApiServiceImpl implements CustomerApiService { | ||
97 | @GetMapping("/query/by/mobile") | 97 | @GetMapping("/query/by/mobile") |
98 | @ControllerMethod("通过电话号码查询保有客档案列表") | 98 | @ControllerMethod("通过电话号码查询保有客档案列表") |
99 | public Message<List<CustomerInfoDto>> queryByMobile(@RequestParam("mobile") String mobile, Long groupId) { | 99 | public Message<List<CustomerInfoDto>> queryByMobile(@RequestParam("mobile") String mobile, Long groupId) { |
100 | - BV.isTrue(StringUtils.isNotBlank(mobile), "手机号不正确"); | ||
101 | List<CustomerDetailDto> list = customerBiz.queryByMobile(mobile, groupId); | 100 | List<CustomerDetailDto> list = customerBiz.queryByMobile(mobile, groupId); |
102 | List<CustomerInfoDto> dtoList = new ArrayList<>(); | 101 | List<CustomerInfoDto> dtoList = new ArrayList<>(); |
103 | for (CustomerDetailDto customer : list) { | 102 | for (CustomerDetailDto customer : list) { |
@@ -265,10 +264,17 @@ public class CustomerApiServiceImpl implements CustomerApiService { | @@ -265,10 +264,17 @@ public class CustomerApiServiceImpl implements CustomerApiService { | ||
265 | return success(); | 264 | return success(); |
266 | } | 265 | } |
267 | 266 | ||
268 | - @GetMapping("/query/by/keyword") | ||
269 | @Override | 267 | @Override |
268 | + @GetMapping("/query/by/keyword") | ||
270 | @ControllerMethod("通过关键字查询档案列表") | 269 | @ControllerMethod("通过关键字查询档案列表") |
271 | public Message<List<BasicsCustomerDTO>> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId) { | 270 | public Message<List<BasicsCustomerDTO>> queryByKeyword(@RequestParam("keyword") String keyword, @RequestParam("groupId") Long groupId) { |
272 | return success(customerBiz.queryByKeyword(keyword, groupId)); | 271 | return success(customerBiz.queryByKeyword(keyword, groupId)); |
273 | } | 272 | } |
273 | + | ||
274 | + @Override | ||
275 | + @GetMapping("/query/vehicle/by/vin") | ||
276 | + @ControllerMethod("查询车辆认证信息") | ||
277 | + public Message<MemberVehicleDTO> queryVehicle(@RequestParam("vin") final String vin) { | ||
278 | + return success(customerBiz.queryVehicleByVin(vin)); | ||
279 | + } | ||
274 | } | 280 | } |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
@@ -1018,6 +1018,19 @@ public class CustomerBizService extends AbstractCustomerService { | @@ -1018,6 +1018,19 @@ public class CustomerBizService extends AbstractCustomerService { | ||
1018 | 1018 | ||
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | + public MemberVehicleDTO queryVehicleByVin(String vin) { | ||
1022 | + MemberVehicle memberVehicle = memberVehicleService.getVehicle(vin); | ||
1023 | + if (Objects.isNull(memberVehicle)) { | ||
1024 | + return null; | ||
1025 | + } | ||
1026 | + MemberVehicleDTO dto = BeanUtils.copy(memberVehicle, MemberVehicleDTO.class); | ||
1027 | + dto.setCusType(memberVehicle.getCusType().getValue()); | ||
1028 | + dto.setUseType(memberVehicle.getUseType().getValue()); | ||
1029 | + MemberUserDTO member = memberRpcService.user(memberVehicle.getMemberId()); | ||
1030 | + dto.setMemberPhone(Objects.nonNull(member) ? member.getPhone() : null); | ||
1031 | + return dto; | ||
1032 | + } | ||
1033 | + | ||
1021 | 1034 | ||
1022 | private AffiliationRecord createEntity(CustomerDetailDto customer) { | 1035 | private AffiliationRecord createEntity(CustomerDetailDto customer) { |
1023 | AffiliationRecord record = new AffiliationRecord(); | 1036 | AffiliationRecord record = new AffiliationRecord(); |