Commit 4ee5bb9c02e2676f960fdf3749713130b48a2a0a

Authored by 夏天
1 parent e425ea85

新增档案接口

fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
... ... @@ -25,10 +25,20 @@ public interface CustomerApiService {
25 25 * @param customerParams
26 26 * @return
27 27 */
  28 + @Deprecated
28 29 @PostMapping("/save")
29 30 Message<Boolean> addCustomer(@Valid @RequestBody CustomerParams customerParams);
30 31  
31 32 /**
  33 + * 新增或更新售后保有客档案
  34 + *
  35 + * @param param 档案参数
  36 + * @return 售后保有客档案
  37 + */
  38 + @PostMapping("/new/save")
  39 + Message<Long> saveCustomer(@Valid @RequestBody CustomerSaveReq param);
  40 +
  41 + /**
32 42 * 查询保有客档案信息
33 43 *
34 44 * @param customerId
... ...
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerSaveReq.java 0 → 100644
  1 +package cn.fw.valhalla.sdk.param;
  2 +
  3 +import cn.fw.common.web.annotation.LoginContextField;
  4 +import lombok.Data;
  5 +import lombok.ToString;
  6 +
  7 +import javax.validation.constraints.NotBlank;
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * @author : xiatian
  14 + * @date: 2022-06-08
  15 + */
  16 +@Data
  17 +@ToString
  18 +public class CustomerSaveReq {
  19 + private Long id;
  20 +
  21 + @NotNull(message = "会员id不能为空")
  22 + private Long memberId;
  23 + /**
  24 + * 车牌号
  25 + */
  26 + @NotBlank(message = "车牌号不能为空")
  27 + private String plateNo;
  28 + /**
  29 + * 车架号
  30 + */
  31 + @NotBlank(message = "车架号不能为空")
  32 + private String frameNo;
  33 + /**
  34 + * 发动机号
  35 + */
  36 + private String engineNo;
  37 + /**
  38 + * 行驶证注册日期
  39 + */
  40 + @NotNull(message = "行驶证注册日期不能为空")
  41 + private Date regDate;
  42 + /**
  43 + * 车型代码
  44 + */
  45 + private String specCode;
  46 + /**
  47 + * 品牌id
  48 + */
  49 + private Long brandId;
  50 + /**
  51 + * 品牌名称
  52 + */
  53 + private String brandName;
  54 + /**
  55 + * 车系id
  56 + */
  57 + private Long seriesId;
  58 + /**
  59 + * 车系名称
  60 + */
  61 + private String seriesName;
  62 + /**
  63 + * 车型id
  64 + */
  65 + private Long specId;
  66 + /**
  67 + * 车型名称
  68 + */
  69 + private String specName;
  70 +
  71 + /**
  72 + * 使用性质 1:非运营 2:运营
  73 + */
  74 + @NotNull(message = "使用性质不能为空")
  75 + private Integer useType;
  76 + /**
  77 + * 车辆所有者
  78 + */
  79 + @NotBlank(message = "车辆所有者名称不能为空")
  80 + private String name;
  81 +
  82 + /**
  83 + * 客户类型;1:个人;2:单位
  84 + */
  85 + @NotNull(message = "客户类型不能为空")
  86 + private Integer cusType;
  87 + /**
  88 + * 顾问id
  89 + */
  90 + @NotNull(message = "顾问id不能为空")
  91 + private Long adviserId;
  92 + /**
  93 + * 所属服务站
  94 + */
  95 + @NotNull(message = "服务站Id不能为空")
  96 + private Long shopId;
  97 + /**
  98 + * 集团id
  99 + */
  100 + @LoginContextField(LoginContextField.Name.GROUP_ID)
  101 + private Long groupId;
  102 +}
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... ... @@ -2,7 +2,9 @@ package cn.fw.valhalla.controller.api;
2 2  
3 3 import cn.fw.common.web.annotation.ControllerMethod;
4 4 import cn.fw.data.base.domain.common.Message;
  5 +import cn.fw.valhalla.common.utils.BeanUtils;
5 6 import cn.fw.valhalla.domain.dto.CustomerDetailDto;
  7 +import cn.fw.valhalla.domain.dto.NewCustomerDTO;
6 8 import cn.fw.valhalla.domain.vo.customer.CarArchiveVO;
7 9 import cn.fw.valhalla.sdk.api.CustomerApiService;
8 10 import cn.fw.valhalla.sdk.param.*;
... ... @@ -10,7 +12,6 @@ import cn.fw.valhalla.sdk.result.*;
10 12 import cn.fw.valhalla.service.bus.cust.*;
11 13 import lombok.extern.slf4j.Slf4j;
12 14 import org.apache.commons.lang.StringUtils;
13   -import org.springframework.beans.BeanUtils;
14 15 import org.springframework.beans.factory.annotation.Autowired;
15 16 import org.springframework.web.bind.annotation.*;
16 17  
... ... @@ -59,6 +60,13 @@ public class CustomerApiServiceImpl implements CustomerApiService {
59 60 }
60 61  
61 62 @Override
  63 + @PostMapping("/new/save")
  64 + @ControllerMethod("新增或更新售后保有客档案")
  65 + public Message<Long> saveCustomer(@Valid final CustomerSaveReq param) {
  66 + return success(changeBizService.saveCustomer(BeanUtils.copy(param,NewCustomerDTO.class)));
  67 + }
  68 +
  69 + @Override
62 70 @GetMapping("/query/by/id")
63 71 @ControllerMethod("通过id查询保有客档案")
64 72 public Message<CustomerInfoDto> queryById(@RequestParam("customerId") Long customerId) {
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CustomerController.java
... ... @@ -276,13 +276,4 @@ public class CustomerController {
276 276 public Message<List<CarArchiveVO>> memberCarList(@CurrentUser LoginAuthBean currentUser, @RequestParam(value = "memberId", required = false) final Long memberId) {
277 277 return success(customerBizService.memberCarList(memberId, currentUser.getGroupId()));
278 278 }
279   -
280   - @PostMapping("/save")
281   - @ControllerMethod("新增档案信息")
282   - public Message<Long> saveCustomer(@Validated @RequestBody final NewCustomerDTO dto) {
283   - customerChangeBiz.saveCustomer(dto);
284   - return success();
285   - }
286   -
287   -
288 279 }
... ...