|
|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|