Commit 84afa95a7b15d6ca32296ce8bcb2e6c812bbf757
1 parent
9c844563
时间段 收货地址 实现
Showing
2 changed files
with
97 additions
and
0 deletions
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/DeliveryTimeRPCImpl.java
... | ... | @@ -3,7 +3,11 @@ package com.diligrp.mobsite.getway.rpc.impl; |
3 | 3 | import com.b2c.myapp.common.api.deliveryTime.input.DeliveryTimeListInput; |
4 | 4 | import com.b2c.myapp.common.api.deliveryTime.input.DeliveryTimeSaveInput; |
5 | 5 | import com.b2c.myapp.common.api.deliveryTime.output.DeliveryTimeOutput; |
6 | +import com.b2c.myapp.common.api.fundTrade.output.FundTradeOutput; | |
7 | +import com.b2c.myapp.common.utils.BaseOutput; | |
8 | +import com.b2c.myapp.common.utils.base.Page; | |
6 | 9 | import com.b2c.myapp.sdk.MyAppClient; |
10 | +import com.diligrp.mobsite.getway.domain.except.ServiceException; | |
7 | 11 | import com.diligrp.mobsite.getway.rpc.DeliveryTimeRPC; |
8 | 12 | import org.slf4j.Logger; |
9 | 13 | import org.slf4j.LoggerFactory; |
... | ... | @@ -31,6 +35,16 @@ public class DeliveryTimeRPCImpl implements DeliveryTimeRPC { |
31 | 35 | */ |
32 | 36 | @Override |
33 | 37 | public DeliveryTimeOutput createShopDeliveryTime(DeliveryTimeSaveInput deliveryTimeSaveInput) { |
38 | + BaseOutput<DeliveryTimeOutput> output = null; | |
39 | + try { | |
40 | + output = myAppClient.getDeliveryTimeService().createShopDeliveryTime(deliveryTimeSaveInput); | |
41 | + if(output.getCode().equals(200)){ | |
42 | + return output.getData(); | |
43 | + } | |
44 | + } catch (Exception e) { | |
45 | + logger.error("创建店铺送货时间段接口出错:msg={}",e); | |
46 | + throw new ServiceException(); | |
47 | + } | |
34 | 48 | return null; |
35 | 49 | } |
36 | 50 | |
... | ... | @@ -43,6 +57,16 @@ public class DeliveryTimeRPCImpl implements DeliveryTimeRPC { |
43 | 57 | */ |
44 | 58 | @Override |
45 | 59 | public Boolean deleteShopDeliveryTime(Long... deliveryTimeId) { |
60 | + BaseOutput<Boolean> output = null; | |
61 | + try { | |
62 | + output = myAppClient.getDeliveryTimeService().deleteShopDeliveryTime(deliveryTimeId); | |
63 | + if(output.getCode().equals(200)){ | |
64 | + return output.getData(); | |
65 | + } | |
66 | + } catch (Exception e) { | |
67 | + logger.error("删除店铺送货时间段接口出错:msg={}",e); | |
68 | + throw new ServiceException(); | |
69 | + } | |
46 | 70 | return null; |
47 | 71 | } |
48 | 72 | |
... | ... | @@ -55,6 +79,16 @@ public class DeliveryTimeRPCImpl implements DeliveryTimeRPC { |
55 | 79 | */ |
56 | 80 | @Override |
57 | 81 | public List<DeliveryTimeOutput> queryShopDeliveryTime(DeliveryTimeListInput deliveryTimeListInput) { |
82 | + BaseOutput<List<DeliveryTimeOutput>> output = null; | |
83 | + try { | |
84 | + output = myAppClient.getDeliveryTimeService().queryShopDeliveryTime(deliveryTimeListInput); | |
85 | + if(output.getCode().equals(200)){ | |
86 | + return output.getData(); | |
87 | + } | |
88 | + } catch (Exception e) { | |
89 | + logger.error("查找店铺送货时间段接口出错:msg={}",e); | |
90 | + throw new ServiceException(); | |
91 | + } | |
58 | 92 | return null; |
59 | 93 | } |
60 | 94 | } | ... | ... |
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/PickInfoRPCImpl.java
1 | 1 | package com.diligrp.mobsite.getway.rpc.impl; |
2 | 2 | |
3 | +import com.b2c.myapp.common.api.deliveryTime.output.DeliveryTimeOutput; | |
3 | 4 | import com.b2c.myapp.common.api.pickingInfo.input.PickingInfoSaveInput; |
4 | 5 | import com.b2c.myapp.common.api.pickingInfo.input.PickingInfoUpdateInput; |
5 | 6 | import com.b2c.myapp.common.api.pickingInfo.output.PickingInfoOutput; |
7 | +import com.b2c.myapp.common.utils.BaseOutput; | |
8 | +import com.b2c.myapp.sdk.MyAppClient; | |
9 | +import com.diligrp.mobsite.getway.domain.except.ServiceException; | |
6 | 10 | import com.diligrp.mobsite.getway.rpc.PickInfoRPC; |
11 | +import org.slf4j.Logger; | |
12 | +import org.slf4j.LoggerFactory; | |
13 | +import org.springframework.stereotype.Component; | |
7 | 14 | |
15 | +import javax.annotation.Resource; | |
8 | 16 | import java.util.List; |
9 | 17 | |
10 | 18 | /** |
11 | 19 | * Created by jiangchengyong on 2017/1/12. |
12 | 20 | */ |
21 | +@Component | |
13 | 22 | public class PickInfoRPCImpl implements PickInfoRPC{ |
14 | 23 | |
24 | + private Logger logger = LoggerFactory.getLogger(PickInfoRPCImpl.class); | |
25 | + | |
26 | + @Resource | |
27 | + private MyAppClient myAppClient; | |
15 | 28 | |
16 | 29 | /** |
17 | 30 | * 新增收货人 |
... | ... | @@ -21,6 +34,16 @@ public class PickInfoRPCImpl implements PickInfoRPC{ |
21 | 34 | */ |
22 | 35 | @Override |
23 | 36 | public PickingInfoOutput addPickingInfo(PickingInfoSaveInput pickingInfoSaveInput) { |
37 | + BaseOutput<PickingInfoOutput> output = null; | |
38 | + try { | |
39 | + output = myAppClient.getPickingInfoService().addPickingInfo(pickingInfoSaveInput); | |
40 | + if(output.getCode().equals(200)){ | |
41 | + return output.getData(); | |
42 | + } | |
43 | + } catch (Exception e) { | |
44 | + logger.error("新增收货人接口出错:msg={}",e); | |
45 | + throw new ServiceException(); | |
46 | + } | |
24 | 47 | return null; |
25 | 48 | } |
26 | 49 | |
... | ... | @@ -32,6 +55,16 @@ public class PickInfoRPCImpl implements PickInfoRPC{ |
32 | 55 | */ |
33 | 56 | @Override |
34 | 57 | public Boolean modify(PickingInfoUpdateInput pickingInfoUpdateInput) { |
58 | + BaseOutput<Boolean> output = null; | |
59 | + try { | |
60 | + output = myAppClient.getPickingInfoService().modify(pickingInfoUpdateInput); | |
61 | + if(output.getCode().equals(200)){ | |
62 | + return output.getData(); | |
63 | + } | |
64 | + } catch (Exception e) { | |
65 | + logger.error("修改收货人信息接口出错:msg={}",e); | |
66 | + throw new ServiceException(); | |
67 | + } | |
35 | 68 | return null; |
36 | 69 | } |
37 | 70 | |
... | ... | @@ -43,6 +76,16 @@ public class PickInfoRPCImpl implements PickInfoRPC{ |
43 | 76 | */ |
44 | 77 | @Override |
45 | 78 | public List<PickingInfoOutput> queryPickingInfosByBuyerId(Long buyerId) { |
79 | + BaseOutput<List<PickingInfoOutput>> output = null; | |
80 | + try { | |
81 | + output = myAppClient.getPickingInfoService().queryPickingInfosByBuyerId(buyerId); | |
82 | + if(output.getCode().equals(200)){ | |
83 | + return output.getData(); | |
84 | + } | |
85 | + } catch (Exception e) { | |
86 | + logger.error("按买家ID查询收货人接口出错:msg={}",e); | |
87 | + throw new ServiceException(); | |
88 | + } | |
46 | 89 | return null; |
47 | 90 | } |
48 | 91 | |
... | ... | @@ -55,6 +98,16 @@ public class PickInfoRPCImpl implements PickInfoRPC{ |
55 | 98 | */ |
56 | 99 | @Override |
57 | 100 | public PickingInfoOutput getDefaultPickingInfoByBuyerId(Long buyerId) { |
101 | + BaseOutput<PickingInfoOutput> output = null; | |
102 | + try { | |
103 | + output = myAppClient.getPickingInfoService().getDefaultPickingInfoByBuyerId(buyerId); | |
104 | + if(output.getCode().equals(200)){ | |
105 | + return output.getData(); | |
106 | + } | |
107 | + } catch (Exception e) { | |
108 | + logger.error("根据买家id获取默认收货地址接口出错:msg={}",e); | |
109 | + throw new ServiceException(); | |
110 | + } | |
58 | 111 | return null; |
59 | 112 | } |
60 | 113 | |
... | ... | @@ -67,6 +120,16 @@ public class PickInfoRPCImpl implements PickInfoRPC{ |
67 | 120 | */ |
68 | 121 | @Override |
69 | 122 | public Boolean delPickingInfoById(Long id) { |
123 | + BaseOutput<Boolean> output = null; | |
124 | + try { | |
125 | + output = myAppClient.getPickingInfoService().delPickingInfoById(id); | |
126 | + if(output.getCode().equals(200)){ | |
127 | + return output.getData(); | |
128 | + } | |
129 | + } catch (Exception e) { | |
130 | + logger.error("删除收货地址接口出错:msg={}",e); | |
131 | + throw new ServiceException(); | |
132 | + } | |
70 | 133 | return null; |
71 | 134 | } |
72 | 135 | } | ... | ... |