Commit ff8e5911d5cd25fb5f34881407337ce2af3bb913

Authored by jiangchengyong
1 parent 2765bc38

店铺 资金相关接口 update

mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShopBuyerRPCImpl.java
@@ -10,13 +10,14 @@ import com.b2c.myapp.sdk.MyAppClient; @@ -10,13 +10,14 @@ import com.b2c.myapp.sdk.MyAppClient;
10 import com.diligrp.mobsite.getway.domain.except.ServiceException; 10 import com.diligrp.mobsite.getway.domain.except.ServiceException;
11 import com.diligrp.mobsite.getway.rpc.ShopBuyerRPC; 11 import com.diligrp.mobsite.getway.rpc.ShopBuyerRPC;
12 import org.apache.log4j.Logger; 12 import org.apache.log4j.Logger;
  13 +import org.springframework.stereotype.Service;
13 14
14 import javax.annotation.Resource; 15 import javax.annotation.Resource;
15 -import java.util.List;  
16 16
17 /** 17 /**
18 * Created by jiangchengyong on 2017/1/10. 18 * Created by jiangchengyong on 2017/1/10.
19 */ 19 */
  20 +@Service
20 public class ShopBuyerRPCImpl implements ShopBuyerRPC { 21 public class ShopBuyerRPCImpl implements ShopBuyerRPC {
21 private final static Logger log = Logger.getLogger(ShopBuyerRPCImpl.class); 22 private final static Logger log = Logger.getLogger(ShopBuyerRPCImpl.class);
22 @Resource 23 @Resource
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShopRPCImpl.java
@@ -4,6 +4,10 @@ import com.b2c.myapp.common.api.shop.input.ShopListInput; @@ -4,6 +4,10 @@ import com.b2c.myapp.common.api.shop.input.ShopListInput;
4 import com.b2c.myapp.common.api.shop.input.ShopSaveInput; 4 import com.b2c.myapp.common.api.shop.input.ShopSaveInput;
5 import com.b2c.myapp.common.api.shop.input.ShopUpdateInput; 5 import com.b2c.myapp.common.api.shop.input.ShopUpdateInput;
6 import com.b2c.myapp.common.api.shop.output.ShopOutput; 6 import com.b2c.myapp.common.api.shop.output.ShopOutput;
  7 +import com.b2c.myapp.common.utils.BaseOutput;
  8 +import com.b2c.myapp.sdk.MyAppClient;
  9 +import com.diligrp.mobsite.getway.domain.common.ResultCode;
  10 +import com.diligrp.mobsite.getway.domain.except.ServiceException;
7 import com.diligrp.mobsite.getway.domain.protocol.ProductCategory; 11 import com.diligrp.mobsite.getway.domain.protocol.ProductCategory;
8 import com.diligrp.mobsite.getway.domain.protocol.ShopIntroduction; 12 import com.diligrp.mobsite.getway.domain.protocol.ShopIntroduction;
9 import com.diligrp.mobsite.getway.domain.protocol.shop.model.ShopInfo; 13 import com.diligrp.mobsite.getway.domain.protocol.shop.model.ShopInfo;
@@ -12,6 +16,7 @@ import org.slf4j.Logger; @@ -12,6 +16,7 @@ import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 16 import org.slf4j.LoggerFactory;
13 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
14 18
  19 +import javax.annotation.Resource;
15 import java.util.List; 20 import java.util.List;
16 21
17 /** 22 /**
@@ -19,23 +24,35 @@ import java.util.List; @@ -19,23 +24,35 @@ import java.util.List;
19 * <B>Copyright</B> Copyright (c) 2015 www.diligrp.com All rights reserved. <br /> 24 * <B>Copyright</B> Copyright (c) 2015 www.diligrp.com All rights reserved. <br />
20 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br /> 25 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
21 * <B>Company</B> 地利集团 26 * <B>Company</B> 地利集团
22 - * @createTime 2015年6月10日 下午1:40:41  
23 - * @author zhangshirui 27 + * @createTime 2017年1月10日 下午1:40:41
  28 + * @author jiangchengyong
24 */ 29 */
25 @Service 30 @Service
26 public class ShopRPCImpl implements ShopRPC { 31 public class ShopRPCImpl implements ShopRPC {
27 32
28 private Logger logger = LoggerFactory.getLogger(ShopRPCImpl.class); 33 private Logger logger = LoggerFactory.getLogger(ShopRPCImpl.class);
29 34
  35 + @Resource
  36 + private MyAppClient myAppClient;
30 /** 37 /**
31 * @param shopSaveInput 店铺基本信息 38 * @param shopSaveInput 店铺基本信息
32 * @return Integer 39 * @return Integer
33 * @comment 创建店铺 40 * @comment 创建店铺
34 - * @author kelan 41 + * @author jiangchengyong
35 * @time 2016/11/29 19:03 42 * @time 2016/11/29 19:03
36 */ 43 */
37 @Override 44 @Override
38 public Integer createShopInfo(ShopSaveInput shopSaveInput) { 45 public Integer createShopInfo(ShopSaveInput shopSaveInput) {
  46 + BaseOutput<Integer> output = null;
  47 + try{
  48 + output = myAppClient.getShopInfoService().createShopInfo(shopSaveInput);
  49 + if(output.getCode().equals(200)){
  50 + return output.getData();
  51 + }
  52 + }catch (Exception e){
  53 + logger.info("调用创建店铺接口出错:",e);
  54 + throw new ServiceException(ResultCode.NETWORK_FAILED);
  55 + }
39 return null; 56 return null;
40 } 57 }
41 58
@@ -43,11 +60,21 @@ public class ShopRPCImpl implements ShopRPC { @@ -43,11 +60,21 @@ public class ShopRPCImpl implements ShopRPC {
43 * @param sellerId 卖家id 60 * @param sellerId 卖家id
44 * @return ShopOutput 61 * @return ShopOutput
45 * @comment 通过卖家id获取店铺信息 62 * @comment 通过卖家id获取店铺信息
46 - * @author kelan 63 + * @author jiangchengyong
47 * @time 2016/11/29 18:54 64 * @time 2016/11/29 18:54
48 */ 65 */
49 @Override 66 @Override
50 public ShopOutput getShopBySellerId(Long sellerId) { 67 public ShopOutput getShopBySellerId(Long sellerId) {
  68 + BaseOutput<ShopOutput> output = null;
  69 + try{
  70 + output = myAppClient.getShopInfoService().getShopBySellerId(sellerId);
  71 + if(output.getCode().equals(200)){
  72 + return output.getData();
  73 + }
  74 + }catch (Exception e){
  75 + logger.info("调用通过卖家id获取店铺信息接口出错:",e);
  76 + throw new ServiceException(ResultCode.NETWORK_FAILED);
  77 + }
51 return null; 78 return null;
52 } 79 }
53 80
@@ -55,11 +82,21 @@ public class ShopRPCImpl implements ShopRPC { @@ -55,11 +82,21 @@ public class ShopRPCImpl implements ShopRPC {
55 * @param shopId 店铺id 82 * @param shopId 店铺id
56 * @return ShopOutput 83 * @return ShopOutput
57 * @comment 通过店铺id获取店铺信息 84 * @comment 通过店铺id获取店铺信息
58 - * @author kelan 85 + * @author jiangchengyong
59 * @time 2016/12/2 10:15 86 * @time 2016/12/2 10:15
60 */ 87 */
61 @Override 88 @Override
62 public ShopOutput getShopByShopId(Long shopId) { 89 public ShopOutput getShopByShopId(Long shopId) {
  90 + BaseOutput<ShopOutput> output = null;
  91 + try{
  92 + output = myAppClient.getShopInfoService().getShopByShopId(shopId);
  93 + if(output.getCode().equals(200)){
  94 + return output.getData();
  95 + }
  96 + }catch (Exception e){
  97 + logger.info("调用通过店铺id获取店铺信息接口出错:",e);
  98 + throw new ServiceException(ResultCode.NETWORK_FAILED);
  99 + }
63 return null; 100 return null;
64 } 101 }
65 102
@@ -67,11 +104,21 @@ public class ShopRPCImpl implements ShopRPC { @@ -67,11 +104,21 @@ public class ShopRPCImpl implements ShopRPC {
67 * @param shopListInput 多字段条件查询 104 * @param shopListInput 多字段条件查询
68 * @return ShopOutput 105 * @return ShopOutput
69 * @comment 多字段条件查询店铺信息 106 * @comment 多字段条件查询店铺信息
70 - * @author kelan 107 + * @author jiangchengyong
71 * @time 2016/11/30 10:00 108 * @time 2016/11/30 10:00
72 */ 109 */
73 @Override 110 @Override
74 public ShopOutput getShopInfo(ShopListInput shopListInput) { 111 public ShopOutput getShopInfo(ShopListInput shopListInput) {
  112 + BaseOutput<ShopOutput> output = null;
  113 + try{
  114 + output = myAppClient.getShopInfoService().getShopInfo(shopListInput);
  115 + if(output.getCode().equals(200)){
  116 + return output.getData();
  117 + }
  118 + }catch (Exception e){
  119 + logger.info("调用多字段条件查询店铺信息接口出错:",e);
  120 + throw new ServiceException(ResultCode.NETWORK_FAILED);
  121 + }
75 return null; 122 return null;
76 } 123 }
77 124
@@ -79,11 +126,21 @@ public class ShopRPCImpl implements ShopRPC { @@ -79,11 +126,21 @@ public class ShopRPCImpl implements ShopRPC {
79 * @param shopUpdateInput 126 * @param shopUpdateInput
80 * @return Integer 127 * @return Integer
81 * @comment 修改店铺基本信息 128 * @comment 修改店铺基本信息
82 - * @author kelan 129 + * @author jiangchengyong
83 * @time 2016/11/30 15:43 130 * @time 2016/11/30 15:43
84 */ 131 */
85 @Override 132 @Override
86 public Boolean modifyShopBasicInfo(ShopUpdateInput shopUpdateInput) { 133 public Boolean modifyShopBasicInfo(ShopUpdateInput shopUpdateInput) {
  134 + BaseOutput<Boolean> output = null;
  135 + try{
  136 + output = myAppClient.getShopInfoService().modifyShopBasicInfo(shopUpdateInput);
  137 + if(output.getCode().equals(200)){
  138 + return output.getData();
  139 + }
  140 + }catch (Exception e){
  141 + logger.info("调用修改店铺基本信息接口出错:",e);
  142 + throw new ServiceException(ResultCode.NETWORK_FAILED);
  143 + }
87 return null; 144 return null;
88 } 145 }
89 } 146 }