zhaohongpeng před 8 roky
rodič
revize
9866083874

+ 93 - 0
src/main/java/com/uas/platform/b2c/fa/payment/controller/PinganTradeController.java

@@ -0,0 +1,93 @@
+package com.uas.platform.b2c.fa.payment.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
+import com.uas.platform.b2c.fa.payment.service.BankReceiptsService;
+import com.uas.platform.b2c.fa.payment.service.PinganTradeService;
+import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+import org.apache.http.HttpStatus;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+
+/**
+ * 会员交易接口
+ *
+ * @author pengzh 2017-1-10
+ */
+@RestController
+@RequestMapping(value = "/pinganTrade")
+public class PinganTradeController {
+
+    private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
+    private final PinganTradeService pinganTradeService;
+
+    @Autowired
+    public PinganTradeController(PinganTradeService pinganTradeService) {
+        this.pinganTradeService = pinganTradeService;
+    }
+
+
+
+    /**
+     * 会员间交易
+     *
+     * @param isPersonal
+     * @return
+     */
+    @RequestMapping(value = "pay", method = RequestMethod.POST)
+    public String pay(Boolean isPersonal) {
+        String str = pinganTradeService.pay(isPersonal);
+        logger.log("平安支付控制器", "会员间交易", "会员间交易");
+        return str;
+    }
+
+    /**
+     * 会员提现(验证短信验证码)【6085】
+     *
+     * @param isPersonal
+     * @return
+     */
+    @RequestMapping(value = "/withdrawCash/verification")
+    public String withdrawCashVerification(Boolean isPersonal)  {
+        String str = pinganTradeService.withdrawCashVerification(isPersonal);
+        logger.log("平安支付控制器", "6085", "会员提现");
+        return str;
+    }
+
+
+    /** 888888888888888888888888888888888
+     * 申请提现或支付短信动态码【6082】
+     * @param isPersonal
+     * @return String
+     */
+    @RequestMapping(value = "/getSMSVerification",method = RequestMethod.GET)
+    public String getSMSVerification(Boolean isPersonal) {
+        String resultStr = pinganTradeService.getSMSVerification(isPersonal);
+        return resultStr;
+    }
+
+    /**
+     * 会员充值(在途)【6056】
+     *
+     * @param isPersonal
+     * @return String
+     */
+    @RequestMapping(value = "/recharge",method = RequestMethod.POST)
+    public String rechargeMember(Boolean isPersonal) {
+        return pinganTradeService.rechargeMember(isPersonal);
+    }
+
+
+
+
+
+}

+ 71 - 0
src/main/java/com/uas/platform/b2c/fa/payment/service/PinganTradeService.java

@@ -0,0 +1,71 @@
+package com.uas.platform.b2c.fa.payment.service;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+
+/**
+ * 平安的facade层
+ *
+ * Created by yujia on 2017/12/20.
+ */
+public interface PinganTradeService {
+
+
+    /**
+     * 会员间交易
+     * @param isPersonal
+     * @return
+     */
+    String pay(Boolean isPersonal);
+
+    /**
+     * 会员提现(验证短信验证码)【6085】
+     * @param isPersonal
+     * @return
+     */
+    String withdrawCashVerification(Boolean isPersonal);
+
+
+
+    /**
+     * 申请提现或支付短信动态码【6082】
+     * @param isPersonal
+     * @return String
+     */
+    String getSMSVerification(Boolean isPersonal);
+
+
+    /**
+     * 会员充值(在途)【6056】
+     *
+     * @param isPersonal
+     * @return String
+     */
+    @RequestMapping(value = "/recharge",method = RequestMethod.POST)
+    String rechargeMember(Boolean isPersonal);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 139 - 0
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/PinganTradeServiceImpl.java

@@ -0,0 +1,139 @@
+package com.uas.platform.b2c.fa.payment.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.platform.b2c.fa.payment.constant.B2CField;
+import com.uas.platform.b2c.fa.payment.constant.PingAnField;
+import com.uas.platform.b2c.fa.payment.constant.StringConstant;
+import com.uas.platform.b2c.fa.payment.service.BankReceiptsService;
+import com.uas.platform.b2c.fa.payment.service.PinganTradeService;
+import com.uas.platform.b2c.fa.payment.support.UserInfoSupport;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.client.RestTemplate;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 平安service 的impl
+ *
+ * @author yuj 2017-12-20 20:32
+ */
+@Service
+public class PinganTradeServiceImpl implements PinganTradeService {
+
+    private final RestTemplate restTemplate;
+
+    private final UserInfoSupport userInfoSupport;
+
+    @Autowired
+    public PinganTradeServiceImpl(RestTemplate restTemplate, UserInfoSupport userInfoSupport) {
+        this.restTemplate = restTemplate;
+        this.userInfoSupport = userInfoSupport;
+    }
+
+    /**
+     * 会员间交易
+     * @param isPersonal
+     * @return
+     */
+    @Override
+    public String pay(Boolean isPersonal) {
+        HashMap<String, String> map = new HashMap<>();
+        Map<String, String> infoMap = userInfoSupport.getUserInfoMap(isPersonal);
+        map.put("FuncFlag","6");
+        map.put("OutCustAcctId","3239000000006038");
+        map.put("OutThirdCustId","1000103422100010342311");
+        map.put("OutCustName","yuj");
+        map.put("InCustAcctId","3239000000006028");
+        map.put("InThirdCustId","10001034100010342311");
+        map.put("TranAmount","10");
+        map.put("TranFee","1");
+        map.put("TranType","01");
+        map.put("CcyCode","RMB");
+        map.put("ThirdHtId","210241041004");
+        //  map.put("SerialNo","3239000000006038");
+        map.put("MessageCode","1111111");
+        map.put("useruu","1000103422");
+        String resultStr = restTemplate.postForObject("http://192.168.253.212:20280/pingan/trade/pay", map, String.class);
+        return resultStr;
+    }
+
+
+    /**
+     * 短会员提现(验证短信验证码)【6085】
+     * @param isPersonal
+     * @return
+     */
+    @Override
+    public String withdrawCashVerification(Boolean isPersonal) {
+        HashMap<String, String> map = new HashMap<>();
+        Map<String, String> infoMap = userInfoSupport.getUserInfoMap(isPersonal);
+        map.put("CustAcctId","3239000000006038");
+        map.put("ThirdCustId","1000103422100010342311");
+        map.put("CustName","yuj");
+        map.put("OutAcctId","1000103422100010342311");
+        map.put("OutAcctIdName","1000103422100010342311");
+        map.put("CcyCode","RMB");
+        map.put("TranAmount","1000103422100010342311");
+        map.put("HandFee","1000103422100010342311");
+        map.put("SerialNo","1000103422100010342311");
+        map.put("MessageCode","1000103422100010342311");
+        map.put("Note","");
+        map.put("WebSign","");
+        String resultStr = restTemplate.postForObject("http://192.168.253.212:20280/pingan/trade/withdrawCash/verification", map, String.class);
+        return resultStr;
+    }
+
+    /**
+     * 申请提现或支付短信动态码【6082】
+     * @param isPersonal
+     * @return String
+     */
+    @Override
+    public String getSMSVerification(Boolean isPersonal) {
+        HashMap<String, String> map = new HashMap<>();
+        map.put("CustAcctId","3239000000006038");
+        map.put("ThirdCustId","1000103422100010342311");
+        map.put("TranType","2");
+        map.put("TranAmount","10");
+        map.put("ThirdHtId","");
+        map.put("useruu","1000103422");
+        map.put("AcctId","");
+        map.put("ThirdHtId","210241041004");
+        String resultStr = restTemplate.postForObject("http://192.168.253.212:20280/pingan/trade/getSMSVerification", map, String.class);
+        return resultStr;
+    }
+
+
+    /**
+     * 会员充值(在途)【6056】
+     *
+     * @param isPersonal
+     * @return String
+     */
+    public String rechargeMember(Boolean isPersonal) {
+        HashMap<String, String> map = new HashMap<>();
+        map.put("CustAcctId","3239000000006038");
+        map.put("ThirdCustId","1000103422100010342311");
+        map.put("TranType","2");
+        map.put("TranAmount","10");
+        map.put("CcyCode","RMB");
+        map.put("useruu","1000103422");
+        map.put("enuu","1000103423");
+        map.put("isPersonal","1");
+        map.put("dissociative","0");
+        map.put("Note","0");
+        String resultStr = restTemplate.postForObject("http://192.168.253.212:20280/pingan/trade/recharge", map, String.class);
+        return resultStr;
+    }
+
+
+
+
+}