Commit 3145890c08d0a1ae14079db5069491a124fceb7a
1 parent
10322773
sdk新增通过发动机号查询档案接口
Showing
5 changed files
with
60 additions
and
0 deletions
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
... | ... | @@ -162,4 +162,14 @@ public interface CustomerApiService { |
162 | 162 | */ |
163 | 163 | @GetMapping("/queryByMemberId") |
164 | 164 | Message<List<CarArchiveDTO>> queryByMemberId(@RequestParam("memberId") Long memberId); |
165 | + | |
166 | + /** | |
167 | + * 通过发动机号查询档案 | |
168 | + * | |
169 | + * @param engineNo | |
170 | + * @param groupId | |
171 | + * @return | |
172 | + */ | |
173 | + @GetMapping("/query/by/engineNo") | |
174 | + Message<CustomerInfoDto> queryByEngineNo(@RequestParam("engineNo") String engineNo, @RequestParam("groupId") Long groupId); | |
165 | 175 | } | ... | ... |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... | ... | @@ -200,4 +200,20 @@ public class CustomerApiServiceImpl implements CustomerApiService { |
200 | 200 | } |
201 | 201 | return success(list); |
202 | 202 | } |
203 | + | |
204 | + @Override | |
205 | + @GetMapping("/query/by/engineNo") | |
206 | + @ControllerMethod("通过发动机号查询保有客档案") | |
207 | + public Message<CustomerInfoDto> queryByEngineNo(@RequestParam("engineNo") String engineNo, @RequestParam("groupId") Long groupId) { | |
208 | + BV.isTrue(StringUtils.isNotBlank(engineNo), "发动机号号不正确"); | |
209 | + CustomerDetailDto detailDto = customerBiz.queryByEngineNo(engineNo, groupId); | |
210 | + if (Objects.nonNull(detailDto)) { | |
211 | + CustomerInfoDto dto = new CustomerInfoDto(); | |
212 | + BeanUtils.copyProperties(detailDto, dto); | |
213 | + dto.setConsultantId(detailDto.getAdviserId()); | |
214 | + dto.setConsultantName(detailDto.getAdviserName()); | |
215 | + return success(dto); | |
216 | + } | |
217 | + return success(); | |
218 | + } | |
203 | 219 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... | ... | @@ -533,6 +533,21 @@ public class CustomerBizService extends AbstractCustomerService { |
533 | 533 | } |
534 | 534 | |
535 | 535 | /** |
536 | + * 根据发动机号查询所有档案 | |
537 | + * | |
538 | + * @param engineNo | |
539 | + * @param groupId | |
540 | + * @return | |
541 | + */ | |
542 | + public CustomerDetailDto queryByEngineNo(final String engineNo, final Long groupId) { | |
543 | + Customer customer = customerService.queryByEngineNo(engineNo, groupId); | |
544 | + if (Objects.isNull(customer)) { | |
545 | + return null; | |
546 | + } | |
547 | + return renderDto(customer); | |
548 | + } | |
549 | + | |
550 | + /** | |
536 | 551 | * 是否关联了档案 |
537 | 552 | * |
538 | 553 | * @param customerParams | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java
... | ... | @@ -64,6 +64,15 @@ public interface CustomerService extends IService<Customer> { |
64 | 64 | Customer queryByFrameNo(String frameNo, Long groupId); |
65 | 65 | |
66 | 66 | /** |
67 | + * 根据车牌号查询档案信息 | |
68 | + * | |
69 | + * @param engineNo | |
70 | + * @param groupId | |
71 | + * @return | |
72 | + */ | |
73 | + Customer queryByEngineNo(String engineNo, Long groupId); | |
74 | + | |
75 | + /** | |
67 | 76 | * 根据baseId查询档案信息 |
68 | 77 | * |
69 | 78 | * @param baseId | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java
... | ... | @@ -71,6 +71,16 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i |
71 | 71 | } |
72 | 72 | |
73 | 73 | @Override |
74 | + public Customer queryByEngineNo(String engineNo, Long groupId) { | |
75 | + return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery() | |
76 | + .eq(Customer::getEngineNo, engineNo) | |
77 | + .eq(Customer::getYn, Boolean.TRUE) | |
78 | + .eq(Customer::getGroupId, groupId) | |
79 | + .orderByDesc(Customer::getUpdateTime) | |
80 | + .last("limit 1")); | |
81 | + } | |
82 | + | |
83 | + @Override | |
74 | 84 | public List<Customer> queryByBaseId(Long baseId) { |
75 | 85 | return this.list(Wrappers.<Customer>lambdaQuery() |
76 | 86 | .eq(Customer::getBaseId, baseId) | ... | ... |