Commit 70174c2a80cb5140ef704a3a224fb977f34b2b36
1 parent
eaba2975
收货地址Id 校验修改
Showing
3 changed files
with
5 additions
and
6 deletions
myapp-common/src/main/java/com/b2c/myapp/common/api/pickingInfo/input/PickingInfoUpdateInput.java
... | ... | @@ -42,19 +42,16 @@ public class PickingInfoUpdateInput implements Serializable{ |
42 | 42 | * 城市ID |
43 | 43 | */ |
44 | 44 | @ApiModelProperty(value = "城市ID") |
45 | - @NotBlank(message="城市ID不能为空") | |
46 | 45 | private Long addressId; |
47 | 46 | /** |
48 | 47 | * 城市文本 |
49 | 48 | */ |
50 | 49 | @ApiModelProperty(value = "城市文本") |
51 | - @NotBlank(message="城市文本不能为空") | |
52 | 50 | private String addressText; |
53 | 51 | /** |
54 | 52 | * 详细地址 |
55 | 53 | */ |
56 | 54 | @ApiModelProperty(value = "详细地址") |
57 | - @NotBlank(message="详细地址不能为空") | |
58 | 55 | private String addressDetail; |
59 | 56 | /** |
60 | 57 | * 是否为默认1: 非默认2:默认 |
... | ... |
myapp-sdk/src/test/java/com/b2c/myapp/sdk/test/BuyerInfoServiceTest.java
... | ... | @@ -27,7 +27,7 @@ public class BuyerInfoServiceTest { |
27 | 27 | |
28 | 28 | BuyerInfoSaveInput buyerInfoSaveInput = new BuyerInfoSaveInput(); |
29 | 29 | buyerInfoSaveInput.setMobilePhone("13558720641"); |
30 | - buyerInfoSaveInput.setAccountName("jcy001"); | |
30 | +// buyerInfoSaveInput.setAccountName("jcy001"); | |
31 | 31 | BaseOutput<BuyerInfoOutput> output = buyerInfoService.register(buyerInfoSaveInput); |
32 | 32 | System.out.println(output); |
33 | 33 | } |
... | ... |
myapp-web/src/main/java/com/b2c/myapp/service/impl/PickingInfoServiceImpl.java
... | ... | @@ -110,8 +110,10 @@ public class PickingInfoServiceImpl extends BaseServiceImpl<PickingInfo, Long> i |
110 | 110 | @Transactional |
111 | 111 | public Boolean modify(PickingInfoUpdateInput pickingInfoUpdateInput) { |
112 | 112 | Boolean result = false; |
113 | - BaseResp baseResp = websiteClientRPCService.getAddress(pickingInfoUpdateInput.getAddressId().intValue()); | |
114 | - pickingInfoUpdateInput.setAddressText(baseResp.getMsg()); | |
113 | + if(null != pickingInfoUpdateInput.getAddressId()){ | |
114 | + BaseResp baseResp = websiteClientRPCService.getAddress(pickingInfoUpdateInput.getAddressId().intValue()); | |
115 | + pickingInfoUpdateInput.setAddressText(baseResp.getMsg()); | |
116 | + } | |
115 | 117 | //修改收货地址的时候,先判断该地址的【是否默认】字段是否被修改了,根据现在的业务逻辑,只要被修改了那么一定是修改成默认地址 |
116 | 118 | PickingInfo pickingInfo = pickingInfoDao.get(pickingInfoUpdateInput.getId()); |
117 | 119 | if(pickingInfoUpdateInput.getDef() != null && !pickingInfo.getDef().equals(pickingInfoUpdateInput.getDef())){ |
... | ... |