Commit e58807756de0b2a9062b63b57b7cbf7840924a57
1 parent
84662125
新增维护车型代码的api接口
Showing
6 changed files
with
101 additions
and
2 deletions
fw-valhalla-sdk/pom.xml
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
... | ... | @@ -3,6 +3,7 @@ package cn.fw.valhalla.sdk.api; |
3 | 3 | import cn.fw.data.base.domain.common.Message; |
4 | 4 | import cn.fw.valhalla.sdk.param.ChangeAdviserReq; |
5 | 5 | import cn.fw.valhalla.sdk.param.ChangePlateNoReq; |
6 | +import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq; | |
6 | 7 | import cn.fw.valhalla.sdk.param.CustomerParams; |
7 | 8 | import cn.fw.valhalla.sdk.result.CarArchiveDTO; |
8 | 9 | import cn.fw.valhalla.sdk.result.CustomerContactDto; |
... | ... | @@ -131,11 +132,22 @@ public interface CustomerApiService { |
131 | 132 | * @param customerId |
132 | 133 | * @param specCode |
133 | 134 | * @return |
135 | + * @deprecated {@link #updateSpecCode} | |
134 | 136 | */ |
137 | + @Deprecated | |
135 | 138 | @GetMapping("/modifySpecCode") |
136 | 139 | Message<Boolean> modifySpecCode(@RequestParam("customerId") Long customerId, @RequestParam("specCode") String specCode); |
137 | 140 | |
138 | 141 | /** |
142 | + * 修改车型代码 | |
143 | + * | |
144 | + * @param changeSpecCodeReq | |
145 | + * @return | |
146 | + */ | |
147 | + @PostMapping("/modify/spec_code") | |
148 | + Message<Boolean> updateSpecCode(@Valid @RequestBody ChangeSpecCodeReq changeSpecCodeReq); | |
149 | + | |
150 | + /** | |
139 | 151 | * 查询顾问能否接车 |
140 | 152 | * |
141 | 153 | * @param userId | ... | ... |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/ChangeSpecCodeReq.java
0 → 100644
1 | +package cn.fw.valhalla.sdk.param; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Data; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.ToString; | |
7 | + | |
8 | +import javax.validation.constraints.NotBlank; | |
9 | +import javax.validation.constraints.NotNull; | |
10 | + | |
11 | +/** | |
12 | + * @author : kurisu | |
13 | + * @className : ChangeSpecCodeReq | |
14 | + * @description : 车型代码变更 | |
15 | + * @date: 2022-03-18 11:38 | |
16 | + */ | |
17 | +@Data | |
18 | +@AllArgsConstructor | |
19 | +@NoArgsConstructor | |
20 | +@ToString | |
21 | +public class ChangeSpecCodeReq { | |
22 | + /** | |
23 | + * 车架号 | |
24 | + */ | |
25 | + @NotNull(message = "档案id不能为空") | |
26 | + private Long customerId; | |
27 | + /** | |
28 | + * 品牌id | |
29 | + */ | |
30 | + private Long brandId; | |
31 | + /** | |
32 | + * 品牌名称 | |
33 | + */ | |
34 | + private String brandName; | |
35 | + /** | |
36 | + * 车系id | |
37 | + */ | |
38 | + private Long seriesId; | |
39 | + /** | |
40 | + * 车系名称 | |
41 | + */ | |
42 | + private String seriesName; | |
43 | + /** | |
44 | + * 车系id | |
45 | + */ | |
46 | + private Long specId; | |
47 | + /** | |
48 | + * 车系名称 | |
49 | + */ | |
50 | + private String specName; | |
51 | + /** | |
52 | + * 车型代码 | |
53 | + */ | |
54 | + @NotBlank(message = "车型代码不能为空") | |
55 | + private String specCode; | |
56 | +} | ... | ... |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... | ... | @@ -7,6 +7,7 @@ import cn.fw.valhalla.domain.vo.customer.CarArchiveVO; |
7 | 7 | import cn.fw.valhalla.sdk.api.CustomerApiService; |
8 | 8 | import cn.fw.valhalla.sdk.param.ChangeAdviserReq; |
9 | 9 | import cn.fw.valhalla.sdk.param.ChangePlateNoReq; |
10 | +import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq; | |
10 | 11 | import cn.fw.valhalla.sdk.param.CustomerParams; |
11 | 12 | import cn.fw.valhalla.sdk.result.CarArchiveDTO; |
12 | 13 | import cn.fw.valhalla.sdk.result.CustomerContactDto; |
... | ... | @@ -166,6 +167,7 @@ public class CustomerApiServiceImpl implements CustomerApiService { |
166 | 167 | return success(contactBizService.queryContactInfo(customerId, memberId)); |
167 | 168 | } |
168 | 169 | |
170 | + @Deprecated | |
169 | 171 | @Override |
170 | 172 | @GetMapping("/modifySpecCode") |
171 | 173 | @ControllerMethod("修改档案车型代码") |
... | ... | @@ -174,6 +176,13 @@ public class CustomerApiServiceImpl implements CustomerApiService { |
174 | 176 | } |
175 | 177 | |
176 | 178 | @Override |
179 | + @PostMapping("/modify/spec_code") | |
180 | + @ControllerMethod("修改档案车型代码") | |
181 | + public Message<Boolean> updateSpecCode(@Valid @RequestBody ChangeSpecCodeReq changeSpecCodeReq) { | |
182 | + return success(customerBiz.fixSpecCode(changeSpecCodeReq)); | |
183 | + } | |
184 | + | |
185 | + @Override | |
177 | 186 | @GetMapping("/queryReceivable") |
178 | 187 | @ControllerMethod("查询能否接车") |
179 | 188 | public Message<ReceptionResultDto> queryReceivable(@RequestParam("userId") Long userId, @RequestParam("plateNo") String plateNo) { | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... | ... | @@ -31,6 +31,7 @@ import cn.fw.valhalla.rpc.member.MemberRpcService; |
31 | 31 | import cn.fw.valhalla.rpc.member.dto.MemberUserDTO; |
32 | 32 | import cn.fw.valhalla.rpc.oop.dto.ShopDTO; |
33 | 33 | import cn.fw.valhalla.rpc.oop.dto.SpecDTO; |
34 | +import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq; | |
34 | 35 | import cn.fw.valhalla.sdk.param.CustomerParams; |
35 | 36 | import cn.fw.valhalla.sdk.param.CustomerQueryReq; |
36 | 37 | import cn.fw.valhalla.sdk.result.CustomerInfoDto; |
... | ... | @@ -283,7 +284,9 @@ public class CustomerBizService extends AbstractCustomerService { |
283 | 284 | * @param customerId |
284 | 285 | * @param specCode |
285 | 286 | * @return |
287 | + * @deprecated | |
286 | 288 | */ |
289 | + @Deprecated | |
287 | 290 | public boolean modifySpecCode(Long customerId, String specCode) { |
288 | 291 | Customer customer = customerService.queryById(customerId); |
289 | 292 | BV.notNull(customer, () -> "档案不存在"); |
... | ... | @@ -292,6 +295,25 @@ public class CustomerBizService extends AbstractCustomerService { |
292 | 295 | } |
293 | 296 | |
294 | 297 | /** |
298 | + * 修改车型代码 | |
299 | + * | |
300 | + * @param req | |
301 | + * @return | |
302 | + */ | |
303 | + public boolean fixSpecCode(ChangeSpecCodeReq req) { | |
304 | + Customer customer = customerService.queryById(req.getCustomerId()); | |
305 | + BV.notNull(customer, () -> "档案不存在"); | |
306 | + customer.setBrandId(req.getBrandId()); | |
307 | + customer.setBrandName(req.getBrandName()); | |
308 | + customer.setSeriesId(req.getSeriesId()); | |
309 | + customer.setSeriesName(req.getSeriesName()); | |
310 | + customer.setSpecId(req.getSpecId()); | |
311 | + customer.setSpecName(req.getSpecName()); | |
312 | + customer.setSpecCode(req.getSpecCode()); | |
313 | + return customerService.updateById(customer); | |
314 | + } | |
315 | + | |
316 | + /** | |
295 | 317 | * 查询能否接车 |
296 | 318 | * |
297 | 319 | * @param userId | ... | ... |
pom.xml