Commit ede6171421699df1ec7a03284d08d90c97de58f8
1 parent
b6f6af27
新增会员认证车辆接口
Showing
6 changed files
with
106 additions
and
4 deletions
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
... | ... | @@ -66,6 +66,7 @@ public interface CustomerApiService { |
66 | 66 | */ |
67 | 67 | @GetMapping("/query/by/frameNo") |
68 | 68 | Message<CustomerInfoDto> queryByFrameNo(@RequestParam("frameNo") String frameNo, @RequestParam("groupId") Long groupId); |
69 | + | |
69 | 70 | /** |
70 | 71 | * 通过车架号查询车辆信息,包含无档案 |
71 | 72 | * |
... | ... | @@ -187,6 +188,15 @@ public interface CustomerApiService { |
187 | 188 | Message<List<CarArchiveDTO>> queryByMemberId(@RequestParam("memberId") Long memberId); |
188 | 189 | |
189 | 190 | /** |
191 | + * 查询会员认证车辆 | |
192 | + * | |
193 | + * @param memberId 会员id | |
194 | + * @return 认证车辆 | |
195 | + */ | |
196 | + @GetMapping("/query/vehicle/by/memberId") | |
197 | + Message<List<MemberVehicleDTO>> queryVehicleByMemberId(@RequestParam("memberId") Long memberId); | |
198 | + | |
199 | + /** | |
190 | 200 | * 通过发动机号查询档案 |
191 | 201 | * |
192 | 202 | * @param engineNo | ... | ... |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/result/MemberVehicleDTO.java
0 → 100644
1 | +package cn.fw.valhalla.sdk.result; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.util.Date; | |
6 | + | |
7 | +/** | |
8 | + * 会员认证车辆 | |
9 | + * <p> | |
10 | + * create at 2022-06-07 | |
11 | + * | |
12 | + * @author xiatian | |
13 | + */ | |
14 | +@Data | |
15 | +public class MemberVehicleDTO { | |
16 | + /** | |
17 | + * 所有者 | |
18 | + */ | |
19 | + private String name; | |
20 | + | |
21 | + /** | |
22 | + * 车架号 | |
23 | + */ | |
24 | + private String frameNo; | |
25 | + /** | |
26 | + * 车牌号 | |
27 | + */ | |
28 | + private String plateNo; | |
29 | + /** | |
30 | + * 发动机号 | |
31 | + */ | |
32 | + private String engineNo; | |
33 | + /** | |
34 | + * 注册日期 | |
35 | + */ | |
36 | + private Date regDate; | |
37 | + /** | |
38 | + * 品牌 | |
39 | + */ | |
40 | + private String brandName; | |
41 | + /** | |
42 | + * 整车型号 | |
43 | + */ | |
44 | + private String specCode; | |
45 | + /** | |
46 | + * 车辆类型 1:个人 2:单位 | |
47 | + */ | |
48 | + private Integer cusType; | |
49 | + /** | |
50 | + * 使用性质 1:非运营 2:运营 | |
51 | + */ | |
52 | + private Integer useType; | |
53 | +} | ... | ... |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... | ... | @@ -223,6 +223,13 @@ public class CustomerApiServiceImpl implements CustomerApiService { |
223 | 223 | } |
224 | 224 | |
225 | 225 | @Override |
226 | + @GetMapping("/query/vehicle/by/frameNo") | |
227 | + @ControllerMethod("查询会员认证车辆") | |
228 | + public Message<List<MemberVehicleDTO>> queryVehicleByMemberId(@RequestParam("memberId") final Long memberId) { | |
229 | + return success(customerBiz.queryVehicleByMemberId(memberId)); | |
230 | + } | |
231 | + | |
232 | + @Override | |
226 | 233 | @GetMapping("/query/by/engineNo") |
227 | 234 | @ControllerMethod("通过发动机号查询保有客档案") |
228 | 235 | public Message<CustomerInfoDto> queryByEngineNo(@RequestParam("engineNo") String engineNo, @RequestParam("groupId") Long groupId) { | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... | ... | @@ -5,6 +5,7 @@ import cn.fw.common.page.AppPage; |
5 | 5 | import cn.fw.common.web.annotation.DisLock; |
6 | 6 | import cn.fw.common.web.auth.LoginAuthBean; |
7 | 7 | import cn.fw.valhalla.common.constant.RoleCode; |
8 | +import cn.fw.valhalla.common.utils.BeanUtils; | |
8 | 9 | import cn.fw.valhalla.common.utils.DateUtil; |
9 | 10 | import cn.fw.valhalla.domain.db.*; |
10 | 11 | import cn.fw.valhalla.domain.db.customer.*; |
... | ... | @@ -36,7 +37,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
36 | 37 | import lombok.Getter; |
37 | 38 | import lombok.RequiredArgsConstructor; |
38 | 39 | import lombok.extern.slf4j.Slf4j; |
39 | -import org.springframework.beans.BeanUtils; | |
40 | 40 | import org.springframework.beans.factory.annotation.Value; |
41 | 41 | import org.springframework.context.ApplicationEventPublisher; |
42 | 42 | import org.springframework.stereotype.Service; |
... | ... | @@ -596,7 +596,7 @@ public class CustomerBizService extends AbstractCustomerService { |
596 | 596 | * 根据车架号号查询车辆信息 |
597 | 597 | * |
598 | 598 | * @param frameNo 车架号 |
599 | - * @param shopId 门店id | |
599 | + * @param shopId 门店id | |
600 | 600 | * @return 车辆信息 |
601 | 601 | */ |
602 | 602 | public CustomerDetailDto queryVehicleByFrameNo(final String frameNo, final Long shopId) { |
... | ... | @@ -621,7 +621,7 @@ public class CustomerBizService extends AbstractCustomerService { |
621 | 621 | } |
622 | 622 | final List<Customer> customers = customerService.list(Wrappers.<Customer>lambdaQuery() |
623 | 623 | .in(Customer::getBaseId, customerBaseInfoList).eq(Customer::getYn, true) |
624 | - .eq(Customer::getGroupId, shop.getGroupId()).eq(Customer::getShopId,shopId) | |
624 | + .eq(Customer::getGroupId, shop.getGroupId()).eq(Customer::getShopId, shopId) | |
625 | 625 | .isNotNull(Customer::getAdviserId) |
626 | 626 | .orderByDesc(Customer::getUpdateTime)); |
627 | 627 | if (CollectionUtils.isEmpty(customers)) { |
... | ... | @@ -647,7 +647,7 @@ public class CustomerBizService extends AbstractCustomerService { |
647 | 647 | } |
648 | 648 | final List<Customer> customers = customerService.list(Wrappers.<Customer>lambdaQuery() |
649 | 649 | .in(Customer::getBaseId, customerBaseInfoList).eq(Customer::getYn, true) |
650 | - .eq(Customer::getGroupId, shop.getGroupId()).eq(Customer::getShopId,shopId) | |
650 | + .eq(Customer::getGroupId, shop.getGroupId()).eq(Customer::getShopId, shopId) | |
651 | 651 | .isNotNull(Customer::getAdviserId) |
652 | 652 | .orderByDesc(Customer::getUpdateTime)); |
653 | 653 | if (CollectionUtils.isEmpty(customers)) { |
... | ... | @@ -866,6 +866,20 @@ public class CustomerBizService extends AbstractCustomerService { |
866 | 866 | return list; |
867 | 867 | } |
868 | 868 | |
869 | + public List<MemberVehicleDTO> queryVehicleByMemberId(Long memberId) { | |
870 | + List<MemberVehicle> memberVehicleList = memberVehicleService.getMemberVehicle(memberId); | |
871 | + if (CollectionUtils.isEmpty(memberVehicleList)) { | |
872 | + return Collections.emptyList(); | |
873 | + } | |
874 | + return memberVehicleList.stream().map(v -> { | |
875 | + MemberVehicleDTO dto = BeanUtils.copy(v, MemberVehicleDTO.class); | |
876 | + dto.setCusType(v.getCusType().getValue()); | |
877 | + dto.setUseType(v.getUseType().getValue()); | |
878 | + return dto; | |
879 | + }).collect(Collectors.toList()); | |
880 | + | |
881 | + } | |
882 | + | |
869 | 883 | |
870 | 884 | private AffiliationRecord createEntity(CustomerDetailDto customer) { |
871 | 885 | AffiliationRecord record = new AffiliationRecord(); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/MemberVehicleService.java
... | ... | @@ -3,6 +3,8 @@ package cn.fw.valhalla.service.data; |
3 | 3 | import cn.fw.valhalla.domain.db.MemberVehicle; |
4 | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | 5 | |
6 | +import java.util.List; | |
7 | + | |
6 | 8 | /** |
7 | 9 | * 会员认证车辆 |
8 | 10 | * <p> |
... | ... | @@ -18,4 +20,12 @@ public interface MemberVehicleService extends IService<MemberVehicle> { |
18 | 20 | * @return 认证车辆 |
19 | 21 | */ |
20 | 22 | MemberVehicle getMemberVehicle(String frameNo); |
23 | + | |
24 | + /** | |
25 | + * 查询认证车辆 | |
26 | + * | |
27 | + * @param memberId 会员id | |
28 | + * @return 认证车辆 | |
29 | + */ | |
30 | + List<MemberVehicle> getMemberVehicle(Long memberId); | |
21 | 31 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/MemberVehicleServiceImpl.java
... | ... | @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
7 | 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | |
10 | +import java.util.List; | |
11 | + | |
10 | 12 | /** |
11 | 13 | * 会员认证车辆 |
12 | 14 | * <p> |
... | ... | @@ -22,4 +24,10 @@ public class MemberVehicleServiceImpl extends ServiceImpl<MemberVehicleMapper, M |
22 | 24 | return baseMapper.selectOne(Wrappers.<MemberVehicle>lambdaQuery() |
23 | 25 | .eq(MemberVehicle::getYn, Boolean.TRUE).eq(MemberVehicle::getFrameNo, frameNo)); |
24 | 26 | } |
27 | + | |
28 | + @Override | |
29 | + public List<MemberVehicle> getMemberVehicle(final Long memberId) { | |
30 | + return baseMapper.selectList(Wrappers.<MemberVehicle>lambdaQuery() | |
31 | + .eq(MemberVehicle::getYn, Boolean.TRUE).eq(MemberVehicle::getMemberId, memberId)); | |
32 | + } | |
25 | 33 | } | ... | ... |