|
|
@@ -1,111 +0,0 @@
|
|
|
-package org.jeecg.common;
|
|
|
-
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import org.jeecg.common.utils.PayConst;
|
|
|
-import org.jeecg.common.utils.PayRequest;
|
|
|
-
|
|
|
-public class PayDemo {
|
|
|
-
|
|
|
- public static void main(String[] args) {
|
|
|
- DCAGPDTL();
|
|
|
-// DCAGPCNV();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 账户信息查询
|
|
|
- */
|
|
|
- private static void DCDACCYE() {
|
|
|
- // body
|
|
|
- JSONObject obj_body = new JSONObject();
|
|
|
- //funcode接口名称
|
|
|
- String funcode = PayConst.DCDACCYE;
|
|
|
- obj_body.put("ctnkey", "");
|
|
|
- String result = PayRequest.doRequest(obj_body, funcode);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- JSONObject jsonObject1 = jsonObject.getJSONObject("response");
|
|
|
- JSONObject jsonObjectHead = jsonObject1.getJSONObject("head");
|
|
|
- String resultcode = jsonObjectHead.getString("resultcode");
|
|
|
- //正常响应为SUC0000
|
|
|
- if ("SUC0000".equals(resultcode)) {
|
|
|
- JSONObject jsonObjectBody = jsonObject1.getJSONObject("body");
|
|
|
- JSONArray jsonArray = jsonObjectBody.getJSONArray("actlis");
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
- JSONObject jsonObject2 = jsonArray.getJSONObject(i);
|
|
|
- System.out.println("户口号========" + jsonObject2.get("eacnbr"));
|
|
|
- System.out.println("账号========" + jsonObject2.get("actnbr"));
|
|
|
- }
|
|
|
- System.out.println("head========" + jsonObjectHead.getString("resultcode"));
|
|
|
- System.out.println("body========" + jsonArray);
|
|
|
- } else {
|
|
|
- System.out.println("resultcode========" + jsonObjectHead.getString("resultcode"));
|
|
|
- System.out.println("resultmsg========" + jsonObjectHead.getString("resultmsg"));
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 移动代发查询协议号
|
|
|
- */
|
|
|
- private static void DCAGPCNV() {
|
|
|
- // body
|
|
|
- JSONObject obj_body = new JSONObject();
|
|
|
- //funcode接口名称
|
|
|
- String funcode = PayConst.DCAGPCNV;
|
|
|
- obj_body.put("dbtacc", "755915675610802");
|
|
|
- obj_body.put("ccynbr", "10");
|
|
|
- String result = PayRequest.doRequest(obj_body, funcode);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- JSONObject jsonObject1 = jsonObject.getJSONObject("response");
|
|
|
- JSONObject jsonObjectHead = jsonObject1.getJSONObject("head");
|
|
|
- String resultcode = jsonObjectHead.getString("resultcode");
|
|
|
- //正常响应为SUC0000
|
|
|
- if ("SUC0000".equals(resultcode)) {
|
|
|
- JSONObject jsonObjectBody = jsonObject1.getJSONObject("body");
|
|
|
- JSONArray jsonArray = jsonObjectBody.getJSONArray("cnvlist");
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
- JSONObject jsonObject2 = jsonArray.getJSONObject(i);
|
|
|
-
|
|
|
- }
|
|
|
- System.out.println("head========" + jsonObjectHead.getString("resultcode"));
|
|
|
- System.out.println("body========" + jsonArray);
|
|
|
- } else {
|
|
|
- System.out.println("resultcode========" + jsonObjectHead.getString("resultcode"));
|
|
|
- System.out.println("resultmsg========" + jsonObjectHead.getString("resultmsg"));
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 移动代发每笔明细查询
|
|
|
- */
|
|
|
- public static void DCAGPDTL() {
|
|
|
- // body
|
|
|
- JSONObject obj_body = new JSONObject();
|
|
|
- //funcode接口名称
|
|
|
- String funcode = PayConst.DCAGPDTL;
|
|
|
- obj_body.put("flwsid", "FMAGPB0000000000000000004995"); //批次号码
|
|
|
- obj_body.put("trssts", ""); //W:待交易S:成功E:失败,为空返回所有明细
|
|
|
- obj_body.put("ctnkey", ""); //第一次传空,后续传响应报文中ctnkey字段值
|
|
|
- String result = PayRequest.doRequest(obj_body, funcode);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- JSONObject jsonObject1 = jsonObject.getJSONObject("response");
|
|
|
- JSONObject jsonObjectHead = jsonObject1.getJSONObject("head");
|
|
|
- String resultcode = jsonObjectHead.getString("resultcode");
|
|
|
- //正常响应为SUC0000
|
|
|
- if ("SUC0000".equals(resultcode)) {
|
|
|
- JSONObject jsonObjectBody = jsonObject1.getJSONObject("body");
|
|
|
- JSONArray jsonArray = jsonObjectBody.getJSONArray("tradeList");
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
- JSONObject jsonObject2 = jsonArray.getJSONObject(i);
|
|
|
- }
|
|
|
- System.out.println("head========" + jsonObjectHead.getString("resultcode"));
|
|
|
- System.out.println("body========" + jsonArray);
|
|
|
- } else {
|
|
|
- System.out.println("resultcode========" + jsonObjectHead.getString("resultcode"));
|
|
|
- System.out.println("resultmsg========" + jsonObjectHead.getString("resultmsg"));
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|