Commit 47a22cf4ef007ddc2dfa6ac16ecc6f0efb182af6

Authored by jiangchengyong
1 parent bf4a0fab

资金管理 update

mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/FundTradeRPCImpl.java
@@ -3,22 +3,43 @@ package com.diligrp.mobsite.getway.rpc.impl; @@ -3,22 +3,43 @@ package com.diligrp.mobsite.getway.rpc.impl;
3 import com.b2c.myapp.common.api.fundTrade.input.FundTradeListInput; 3 import com.b2c.myapp.common.api.fundTrade.input.FundTradeListInput;
4 import com.b2c.myapp.common.api.fundTrade.input.FundTradeSaveInput; 4 import com.b2c.myapp.common.api.fundTrade.input.FundTradeSaveInput;
5 import com.b2c.myapp.common.api.fundTrade.output.FundTradeOutput; 5 import com.b2c.myapp.common.api.fundTrade.output.FundTradeOutput;
  6 +import com.b2c.myapp.common.utils.BaseOutput;
6 import com.b2c.myapp.common.utils.base.Page; 7 import com.b2c.myapp.common.utils.base.Page;
  8 +import com.b2c.myapp.sdk.MyAppClient;
  9 +import com.diligrp.mobsite.getway.domain.except.ServiceException;
7 import com.diligrp.mobsite.getway.rpc.FundTradeRPC; 10 import com.diligrp.mobsite.getway.rpc.FundTradeRPC;
  11 +import org.apache.log4j.Logger;
  12 +import org.springframework.stereotype.Component;
  13 +
  14 +import javax.annotation.Resource;
8 15
9 /** 16 /**
10 * Created by jiangchengyong on 2017/1/19. 17 * Created by jiangchengyong on 2017/1/19.
11 */ 18 */
  19 +@Component
12 public class FundTradeRPCImpl implements FundTradeRPC { 20 public class FundTradeRPCImpl implements FundTradeRPC {
  21 + private final static Logger log = Logger.getLogger(FundTradeRPCImpl.class);
  22 + @Resource
  23 + private MyAppClient myAppClient;
13 /** 24 /**
14 - * @param FundTradeListInput 25 + * @param fundTradeListInput
15 * @return BaseOutput<Page<FundTradeOutput>> 26 * @return BaseOutput<Page<FundTradeOutput>>
16 * @comment 多条件查询储值卡资金交易明细 27 * @comment 多条件查询储值卡资金交易明细
17 * @author kelan 28 * @author kelan
18 * @time 2016/12/8 10:36 29 * @time 2016/12/8 10:36
19 */ 30 */
20 @Override 31 @Override
21 - public Page<FundTradeOutput> queryFundTrade(FundTradeListInput FundTradeListInput) { 32 + public Page<FundTradeOutput> queryFundTrade(FundTradeListInput fundTradeListInput) {
  33 + BaseOutput<Page<FundTradeOutput>> output = null;
  34 + try {
  35 + output = myAppClient.getFundTradeService().queryFundTrade(fundTradeListInput);
  36 + if(output.getCode().equals(200)){
  37 + return output.getData();
  38 + }
  39 + } catch (Exception e) {
  40 + log.error("多条件查询储值卡资金交易明细接口出错:msg={}",e);
  41 + throw new ServiceException();
  42 + }
22 return null; 43 return null;
23 } 44 }
24 45
@@ -30,6 +51,16 @@ public class FundTradeRPCImpl implements FundTradeRPC { @@ -30,6 +51,16 @@ public class FundTradeRPCImpl implements FundTradeRPC {
30 */ 51 */
31 @Override 52 @Override
32 public Boolean fundTrade(FundTradeSaveInput fundTradeSaveInput) { 53 public Boolean fundTrade(FundTradeSaveInput fundTradeSaveInput) {
  54 + BaseOutput<Boolean> output = null;
  55 + try {
  56 + output = myAppClient.getFundTradeService().fundTrade(fundTradeSaveInput);
  57 + if(output.getCode().equals(200)){
  58 + return output.getData();
  59 + }
  60 + } catch (Exception e) {
  61 + log.error("储值卡交易接口出错:msg={}",e);
  62 + throw new ServiceException();
  63 + }
33 return null; 64 return null;
34 } 65 }
35 } 66 }