Commit d1deb9507fec392ae9f1dc1318f6d8bf5db6262a
1 parent
7b139315
fix(*): 提供更新购车日期接口
- 提供更新购车日期接口 **
Showing
6 changed files
with
106 additions
and
16 deletions
fw-valhalla-sdk/pom.xml
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/api/CustomerApiService.java
... | ... | @@ -4,10 +4,12 @@ import cn.fw.data.base.domain.common.Message; |
4 | 4 | import cn.fw.valhalla.sdk.param.*; |
5 | 5 | import cn.fw.valhalla.sdk.result.*; |
6 | 6 | import org.springframework.cloud.openfeign.FeignClient; |
7 | -import org.springframework.web.bind.annotation.*; | |
7 | +import org.springframework.web.bind.annotation.GetMapping; | |
8 | +import org.springframework.web.bind.annotation.PostMapping; | |
9 | +import org.springframework.web.bind.annotation.RequestBody; | |
10 | +import org.springframework.web.bind.annotation.RequestParam; | |
8 | 11 | |
9 | 12 | import javax.validation.Valid; |
10 | - | |
11 | 13 | import java.util.List; |
12 | 14 | |
13 | 15 | /** |
... | ... | @@ -25,10 +27,18 @@ public interface CustomerApiService { |
25 | 27 | * @param customerParams |
26 | 28 | * @return |
27 | 29 | */ |
28 | - @Deprecated | |
29 | 30 | @PostMapping("/save") |
30 | 31 | Message<Boolean> addCustomer(@Valid @RequestBody CustomerParams customerParams); |
31 | 32 | |
33 | + | |
34 | + /** | |
35 | + * 更新保有客档案购车时间 | |
36 | + * | |
37 | + * @param updateBuyDateParams | |
38 | + */ | |
39 | + @PostMapping("/update/buyDate") | |
40 | + Message<Void> updateCustomerBuyDate(@Valid @RequestBody CustomerUpdateBuyDateParams updateBuyDateParams); | |
41 | + | |
32 | 42 | /** |
33 | 43 | * 新增或更新售后保有客档案 |
34 | 44 | * | ... | ... |
fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerUpdateBuyDateParams.java
0 → 100644
1 | +package cn.fw.valhalla.sdk.param; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Data; | |
5 | +import lombok.NoArgsConstructor; | |
6 | + | |
7 | +import javax.validation.constraints.NotBlank; | |
8 | +import javax.validation.constraints.NotNull; | |
9 | +import java.util.Date; | |
10 | + | |
11 | +/** | |
12 | + * 保有客信息 | |
13 | + * | |
14 | + * @author Kurisu | |
15 | + */ | |
16 | +@Data | |
17 | +@AllArgsConstructor | |
18 | +@NoArgsConstructor | |
19 | +public class CustomerUpdateBuyDateParams { | |
20 | + /** | |
21 | + * 车架号 | |
22 | + */ | |
23 | + @NotBlank(message = "车架号不能为空") | |
24 | + private String frameNo; | |
25 | + /** | |
26 | + * 购车时间/开票时间 | |
27 | + * 时间戳 | |
28 | + */ | |
29 | + @NotNull(message = "开票时间不能为空") | |
30 | + private Date buyDate; | |
31 | + /** | |
32 | + * 集团id | |
33 | + */ | |
34 | + @NotNull(message = "集团id不能为空") | |
35 | + private Long groupId; | |
36 | +} | |
0 | 37 | \ No newline at end of file | ... | ... |
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... | ... | @@ -9,15 +9,19 @@ import cn.fw.valhalla.domain.vo.customer.CarArchiveVO; |
9 | 9 | import cn.fw.valhalla.sdk.api.CustomerApiService; |
10 | 10 | import cn.fw.valhalla.sdk.param.*; |
11 | 11 | import cn.fw.valhalla.sdk.result.*; |
12 | -import cn.fw.valhalla.service.bus.cust.*; | |
12 | +import cn.fw.valhalla.service.bus.cust.ContactBizService; | |
13 | +import cn.fw.valhalla.service.bus.cust.CustomerBizService; | |
14 | +import cn.fw.valhalla.service.bus.cust.CustomerChangeBizService; | |
15 | +import cn.fw.valhalla.service.bus.cust.PickUpCustomerService; | |
13 | 16 | import lombok.extern.slf4j.Slf4j; |
14 | 17 | import org.apache.commons.lang.StringUtils; |
15 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
16 | 19 | import org.springframework.web.bind.annotation.*; |
17 | 20 | |
18 | 21 | import javax.validation.Valid; |
19 | - | |
20 | -import java.util.*; | |
22 | +import java.util.ArrayList; | |
23 | +import java.util.List; | |
24 | +import java.util.Objects; | |
21 | 25 | |
22 | 26 | import static cn.fw.common.businessvalidator.Validator.BV; |
23 | 27 | import static cn.fw.common.web.util.ResultBuilder.success; |
... | ... | @@ -59,11 +63,19 @@ public class CustomerApiServiceImpl implements CustomerApiService { |
59 | 63 | return success(added); |
60 | 64 | } |
61 | 65 | |
66 | + @PostMapping("/update/buyDate") | |
67 | + @Override | |
68 | + @ControllerMethod("更新保有客档案购车时间") | |
69 | + public Message<Void> updateCustomerBuyDate(CustomerUpdateBuyDateParams updateBuyDateParams) { | |
70 | + customerBiz.updateCustomerBuyDate(updateBuyDateParams.getFrameNo(), updateBuyDateParams.getBuyDate(), updateBuyDateParams.getGroupId()); | |
71 | + return success(); | |
72 | + } | |
73 | + | |
62 | 74 | @Override |
63 | 75 | @PostMapping("/new/save") |
64 | 76 | @ControllerMethod("新增或更新售后保有客档案") |
65 | 77 | public Message<Long> saveCustomer(@Valid @RequestBody final CustomerSaveReq param) { |
66 | - return success(changeBizService.saveCustomer(BeanUtils.copy(param,NewCustomerDTO.class))); | |
78 | + return success(changeBizService.saveCustomer(BeanUtils.copy(param, NewCustomerDTO.class))); | |
67 | 79 | } |
68 | 80 | |
69 | 81 | @Override | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... | ... | @@ -7,25 +7,40 @@ import cn.fw.common.web.auth.LoginAuthBean; |
7 | 7 | import cn.fw.valhalla.common.constant.RoleCode; |
8 | 8 | import cn.fw.valhalla.common.utils.BeanUtils; |
9 | 9 | import cn.fw.valhalla.common.utils.DateUtil; |
10 | -import cn.fw.valhalla.domain.db.*; | |
10 | +import cn.fw.valhalla.domain.db.CompanyWechatJoin; | |
11 | +import cn.fw.valhalla.domain.db.MemberVehicle; | |
12 | +import cn.fw.valhalla.domain.db.WechatSubscribe; | |
11 | 13 | import cn.fw.valhalla.domain.db.customer.*; |
12 | -import cn.fw.valhalla.domain.db.follow.*; | |
13 | -import cn.fw.valhalla.domain.db.pool.*; | |
14 | +import cn.fw.valhalla.domain.db.follow.ClueTask; | |
15 | +import cn.fw.valhalla.domain.db.follow.FollowClue; | |
16 | +import cn.fw.valhalla.domain.db.follow.FollowRecord; | |
17 | +import cn.fw.valhalla.domain.db.pool.PublicCluePool; | |
18 | +import cn.fw.valhalla.domain.db.pool.PublicPool; | |
19 | +import cn.fw.valhalla.domain.db.pool.StammkundePool; | |
14 | 20 | import cn.fw.valhalla.domain.dto.CustomerDetailDto; |
15 | 21 | import cn.fw.valhalla.domain.enums.*; |
16 | -import cn.fw.valhalla.domain.query.*; | |
22 | +import cn.fw.valhalla.domain.query.CustomCustomerQuery; | |
23 | +import cn.fw.valhalla.domain.query.CustomerQueryVO; | |
24 | +import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO; | |
17 | 25 | import cn.fw.valhalla.domain.vo.customer.*; |
18 | 26 | import cn.fw.valhalla.domain.vo.setting.SettingVO; |
19 | 27 | import cn.fw.valhalla.rpc.angel.dto.InsuranceDTO; |
20 | -import cn.fw.valhalla.rpc.erp.dto.*; | |
28 | +import cn.fw.valhalla.rpc.erp.dto.PostUserDTO; | |
29 | +import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; | |
30 | +import cn.fw.valhalla.rpc.erp.dto.UserRoleDataRangeDTO; | |
21 | 31 | import cn.fw.valhalla.rpc.member.MemberRpcService; |
22 | 32 | import cn.fw.valhalla.rpc.member.dto.MemberUserDTO; |
23 | 33 | import cn.fw.valhalla.rpc.oop.OopService; |
24 | 34 | import cn.fw.valhalla.rpc.oop.dto.ShopDTO; |
25 | 35 | import cn.fw.valhalla.rpc.oop.dto.SpecDTO; |
26 | 36 | import cn.fw.valhalla.sdk.enums.CusTypeEnum; |
27 | -import cn.fw.valhalla.sdk.param.*; | |
28 | -import cn.fw.valhalla.sdk.result.*; | |
37 | +import cn.fw.valhalla.sdk.param.ChangeSpecCodeReq; | |
38 | +import cn.fw.valhalla.sdk.param.CustomerParams; | |
39 | +import cn.fw.valhalla.sdk.param.CustomerQueryReq; | |
40 | +import cn.fw.valhalla.sdk.result.BasicsCustomerDTO; | |
41 | +import cn.fw.valhalla.sdk.result.CustomerInfoDto; | |
42 | +import cn.fw.valhalla.sdk.result.MemberVehicleDTO; | |
43 | +import cn.fw.valhalla.sdk.result.ReceptionResultDto; | |
29 | 44 | import cn.fw.valhalla.service.bus.StammkundeBizService; |
30 | 45 | import cn.fw.valhalla.service.bus.setting.SettingBizService; |
31 | 46 | import cn.fw.valhalla.service.data.*; |
... | ... | @@ -720,6 +735,7 @@ public class CustomerBizService extends AbstractCustomerService { |
720 | 735 | return renderDto(customer); |
721 | 736 | } |
722 | 737 | |
738 | + | |
723 | 739 | /** |
724 | 740 | * 是否关联了档案 |
725 | 741 | * |
... | ... | @@ -773,6 +789,22 @@ public class CustomerBizService extends AbstractCustomerService { |
773 | 789 | return Objects.nonNull(cid); |
774 | 790 | } |
775 | 791 | |
792 | + /** | |
793 | + * 更新购车日期 | |
794 | + * @param vin | |
795 | + * @param date | |
796 | + * @param groupId | |
797 | + */ | |
798 | + @Transactional(rollbackFor = Exception.class) | |
799 | + public void updateCustomerBuyDate(final String vin, final Date date, final Long groupId) { | |
800 | + Customer customer = customerService.queryByFrameNo(vin, groupId); | |
801 | + if (Objects.isNull(customer)) { | |
802 | + return; | |
803 | + } | |
804 | + customer.setBuyDate(date); | |
805 | + customerService.updateById(customer); | |
806 | + } | |
807 | + | |
776 | 808 | public List<CarArchiveVO> memberCarList(final Long memberId, final Long groupId) { |
777 | 809 | BV.notNull(groupId, () -> "集团ID不能为空"); |
778 | 810 | List<CarArchiveVO> list = this.defaultCustomer(memberId); | ... | ... |
pom.xml