Commit 94c87aab62533131a3840454d789a8527b0d1f01
1 parent
ee39ce19
🔲新车上户修改车牌号
Showing
6 changed files
with
84 additions
and
5 deletions
fw-valhalla-sdk/pom.xml
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | <relativePath>../pom.xml</relativePath> | 10 | <relativePath>../pom.xml</relativePath> |
11 | </parent> | 11 | </parent> |
12 | <artifactId>fw-valhalla-sdk</artifactId> | 12 | <artifactId>fw-valhalla-sdk</artifactId> |
13 | - <version>1.1.1</version> | 13 | + <version>1.1.3</version> |
14 | <packaging>jar</packaging> | 14 | <packaging>jar</packaging> |
15 | <name>fw-valhalla-sdk</name> | 15 | <name>fw-valhalla-sdk</name> |
16 | 16 |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
@@ -2,6 +2,7 @@ package cn.fw.valhalla.sdk.api; | @@ -2,6 +2,7 @@ package cn.fw.valhalla.sdk.api; | ||
2 | 2 | ||
3 | import cn.fw.data.base.domain.common.Message; | 3 | import cn.fw.data.base.domain.common.Message; |
4 | import cn.fw.valhalla.sdk.param.ChangeAdviserReq; | 4 | import cn.fw.valhalla.sdk.param.ChangeAdviserReq; |
5 | +import cn.fw.valhalla.sdk.param.ChangePlateNoReq; | ||
5 | import cn.fw.valhalla.sdk.param.CustomerParams; | 6 | import cn.fw.valhalla.sdk.param.CustomerParams; |
6 | import cn.fw.valhalla.sdk.result.CustomerContactDto; | 7 | import cn.fw.valhalla.sdk.result.CustomerContactDto; |
7 | import cn.fw.valhalla.sdk.result.CustomerInfoDto; | 8 | import cn.fw.valhalla.sdk.result.CustomerInfoDto; |
@@ -88,7 +89,7 @@ public interface CustomerApiService { | @@ -88,7 +89,7 @@ public interface CustomerApiService { | ||
88 | * @return 是否变更成功 | 89 | * @return 是否变更成功 |
89 | */ | 90 | */ |
90 | @PostMapping("/change/adviser") | 91 | @PostMapping("/change/adviser") |
91 | - Message<Boolean> changeAdviser(@RequestBody ChangeAdviserReq changeAdviserReq); | 92 | + Message<Boolean> changeAdviser(@Valid @RequestBody ChangeAdviserReq changeAdviserReq); |
92 | 93 | ||
93 | /** | 94 | /** |
94 | * 会员关联商家(专属商家和进站的商家) | 95 | * 会员关联商家(专属商家和进站的商家) |
@@ -140,4 +141,12 @@ public interface CustomerApiService { | @@ -140,4 +141,12 @@ public interface CustomerApiService { | ||
140 | */ | 141 | */ |
141 | @GetMapping("/queryReceivable") | 142 | @GetMapping("/queryReceivable") |
142 | Message<ReceptionResultDto> queryReceivable(@RequestParam("userId") Long userId, @RequestParam("plateNo") String plateNo); | 143 | Message<ReceptionResultDto> queryReceivable(@RequestParam("userId") Long userId, @RequestParam("plateNo") String plateNo); |
144 | + | ||
145 | + /** | ||
146 | + * 修改车牌号 | ||
147 | + * @param changePlateNoReq | ||
148 | + * @return | ||
149 | + */ | ||
150 | + @PostMapping("/updatePlateNo") | ||
151 | + Message<Boolean> updatePlateNo(@Valid @RequestBody ChangePlateNoReq changePlateNoReq); | ||
143 | } | 152 | } |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/ChangePlateNoReq.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 | + * 修改车牌号 | ||
13 | + * @author kurisu | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@NoArgsConstructor | ||
18 | +@ToString | ||
19 | +public class ChangePlateNoReq { | ||
20 | + /** | ||
21 | + * 车架号 | ||
22 | + */ | ||
23 | + @NotBlank(message = "车架号不能为空") | ||
24 | + private String frameNo; | ||
25 | + /** | ||
26 | + * 车牌号 | ||
27 | + */ | ||
28 | + @NotBlank(message = "车牌号不能为空") | ||
29 | + private String plateNo; | ||
30 | + /** | ||
31 | + * 集团id | ||
32 | + */ | ||
33 | + @NotNull(message = "集团id不能为空") | ||
34 | + private Long groupId; | ||
35 | +} |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
@@ -4,6 +4,7 @@ import cn.fw.data.base.domain.common.Message; | @@ -4,6 +4,7 @@ import cn.fw.data.base.domain.common.Message; | ||
4 | import cn.fw.valhalla.domain.dto.CustomerDetailDto; | 4 | import cn.fw.valhalla.domain.dto.CustomerDetailDto; |
5 | import cn.fw.valhalla.sdk.api.CustomerApiService; | 5 | import cn.fw.valhalla.sdk.api.CustomerApiService; |
6 | import cn.fw.valhalla.sdk.param.ChangeAdviserReq; | 6 | import cn.fw.valhalla.sdk.param.ChangeAdviserReq; |
7 | +import cn.fw.valhalla.sdk.param.ChangePlateNoReq; | ||
7 | import cn.fw.valhalla.sdk.param.CustomerParams; | 8 | import cn.fw.valhalla.sdk.param.CustomerParams; |
8 | import cn.fw.valhalla.sdk.result.CustomerContactDto; | 9 | import cn.fw.valhalla.sdk.result.CustomerContactDto; |
9 | import cn.fw.valhalla.sdk.result.CustomerInfoDto; | 10 | import cn.fw.valhalla.sdk.result.CustomerInfoDto; |
@@ -11,6 +12,7 @@ import cn.fw.valhalla.sdk.result.ReceptionResultDto; | @@ -11,6 +12,7 @@ import cn.fw.valhalla.sdk.result.ReceptionResultDto; | ||
11 | import cn.fw.valhalla.service.bus.cust.ContactBizService; | 12 | import cn.fw.valhalla.service.bus.cust.ContactBizService; |
12 | import cn.fw.valhalla.service.bus.cust.CustomerBizService; | 13 | import cn.fw.valhalla.service.bus.cust.CustomerBizService; |
13 | import cn.fw.valhalla.service.bus.cust.CustomerChangeBizService; | 14 | import cn.fw.valhalla.service.bus.cust.CustomerChangeBizService; |
15 | +import cn.fw.valhalla.service.bus.cust.PickUpCustomerService; | ||
14 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
15 | import org.apache.commons.lang.StringUtils; | 17 | import org.apache.commons.lang.StringUtils; |
16 | import org.springframework.beans.BeanUtils; | 18 | import org.springframework.beans.BeanUtils; |
@@ -42,15 +44,18 @@ public class CustomerApiServiceImpl implements CustomerApiService { | @@ -42,15 +44,18 @@ public class CustomerApiServiceImpl implements CustomerApiService { | ||
42 | private final CustomerBizService customerBiz; | 44 | private final CustomerBizService customerBiz; |
43 | private final CustomerChangeBizService changeBizService; | 45 | private final CustomerChangeBizService changeBizService; |
44 | private final ContactBizService contactBizService; | 46 | private final ContactBizService contactBizService; |
47 | + private final PickUpCustomerService pickUpCustomerService; | ||
45 | 48 | ||
46 | 49 | ||
47 | @Autowired | 50 | @Autowired |
48 | CustomerApiServiceImpl(final CustomerBizService customerBiz, | 51 | CustomerApiServiceImpl(final CustomerBizService customerBiz, |
49 | final CustomerChangeBizService changeBizService, | 52 | final CustomerChangeBizService changeBizService, |
50 | - final ContactBizService contactBizService) { | 53 | + final ContactBizService contactBizService, |
54 | + final PickUpCustomerService pickUpCustomerService) { | ||
51 | this.customerBiz = customerBiz; | 55 | this.customerBiz = customerBiz; |
52 | this.changeBizService = changeBizService; | 56 | this.changeBizService = changeBizService; |
53 | this.contactBizService = contactBizService; | 57 | this.contactBizService = contactBizService; |
58 | + this.pickUpCustomerService = pickUpCustomerService; | ||
54 | } | 59 | } |
55 | 60 | ||
56 | @PostMapping("/save") | 61 | @PostMapping("/save") |
@@ -174,7 +179,7 @@ public class CustomerApiServiceImpl implements CustomerApiService { | @@ -174,7 +179,7 @@ public class CustomerApiServiceImpl implements CustomerApiService { | ||
174 | 179 | ||
175 | @PostMapping("/change/adviser") | 180 | @PostMapping("/change/adviser") |
176 | @Override | 181 | @Override |
177 | - public Message<Boolean> changeAdviser(@RequestBody final ChangeAdviserReq changeAdviserReq) { | 182 | + public Message<Boolean> changeAdviser(@Valid @RequestBody final ChangeAdviserReq changeAdviserReq) { |
178 | final String msg = "修改保有客专属顾问[changeAdviser]"; | 183 | final String msg = "修改保有客专属顾问[changeAdviser]"; |
179 | log.info("{}: param:{}", msg, changeAdviserReq); | 184 | log.info("{}: param:{}", msg, changeAdviserReq); |
180 | try { | 185 | try { |
@@ -255,4 +260,18 @@ public class CustomerApiServiceImpl implements CustomerApiService { | @@ -255,4 +260,18 @@ public class CustomerApiServiceImpl implements CustomerApiService { | ||
255 | return failureWithMessage("查询联系人信息失败"); | 260 | return failureWithMessage("查询联系人信息失败"); |
256 | } | 261 | } |
257 | } | 262 | } |
263 | + | ||
264 | + @Override | ||
265 | + @PostMapping("/updatePlateNo") | ||
266 | + public Message<Boolean> updatePlateNo(@Valid @RequestBody ChangePlateNoReq changePlateNoReq) { | ||
267 | + final String msg = "通过vin修改车牌号[updatePlateNo]"; | ||
268 | + log.info("{}: param:[{}]", msg, changePlateNoReq); | ||
269 | + try { | ||
270 | + return success(pickUpCustomerService.fixPlateNo(changePlateNoReq.getFrameNo(), changePlateNoReq.getPlateNo(), changePlateNoReq.getGroupId()), | ||
271 | + data -> log.info("{}:data[{}]", msg, data)); | ||
272 | + } catch (Exception ex) { | ||
273 | + handleException(ex, e -> log.error("{}失败: param:[{}]", msg, changePlateNoReq, e)); | ||
274 | + return failureWithMessage("通过vin修改车牌号失败"); | ||
275 | + } | ||
276 | + } | ||
258 | } | 277 | } |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/PickUpCustomerService.java
@@ -74,6 +74,22 @@ public class PickUpCustomerService extends AbstractCustomerService { | @@ -74,6 +74,22 @@ public class PickUpCustomerService extends AbstractCustomerService { | ||
74 | } | 74 | } |
75 | 75 | ||
76 | /** | 76 | /** |
77 | + * 修改车牌号 | ||
78 | + * | ||
79 | + * @param frameNo | ||
80 | + * @param plateNo | ||
81 | + * @param groupId | ||
82 | + * @return | ||
83 | + */ | ||
84 | + @Transactional(rollbackFor = Exception.class) | ||
85 | + public Boolean fixPlateNo(String frameNo, String plateNo, Long groupId) { | ||
86 | + Customer customer = customerService.queryByFrameNo(frameNo, groupId); | ||
87 | + BV.notNull(customer, () -> "车架号有误"); | ||
88 | + customer.setPlateNo(plateNo); | ||
89 | + return customerService.updateById(customer); | ||
90 | + } | ||
91 | + | ||
92 | + /** | ||
77 | * 根据vin查询档案 | 93 | * 根据vin查询档案 |
78 | * | 94 | * |
79 | * @param currentUser | 95 | * @param currentUser |
pom.xml
@@ -114,7 +114,7 @@ | @@ -114,7 +114,7 @@ | ||
114 | <dependency> | 114 | <dependency> |
115 | <groupId>cn.fw</groupId> | 115 | <groupId>cn.fw</groupId> |
116 | <artifactId>fw-valhalla-sdk</artifactId> | 116 | <artifactId>fw-valhalla-sdk</artifactId> |
117 | - <version>1.1.1</version> | 117 | + <version>1.1.3</version> |
118 | </dependency> | 118 | </dependency> |
119 | <dependency> | 119 | <dependency> |
120 | <groupId>cn.fw</groupId> | 120 | <groupId>cn.fw</groupId> |