提交 f6345bc8 authored 作者: huyufan's avatar huyufan

Merge remote-tracking branch 'origin/test' into test

//package com.clx.performance.controller.temp; package com.clx.performance.controller.temp;
//
//import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
//import com.clx.performance.service.TempService; import com.clx.performance.service.TempService;
//import com.clx.performance.utils.LocalDateTimeUtils; import com.clx.performance.utils.LocalDateTimeUtils;
//import com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO; import com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO;
//import com.msl.common.result.Result; import com.msl.common.result.Result;
//import com.nbopen.api.*; import com.nbopen.api.*;
//import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
//import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
//
//import java.io.IOException; import java.io.IOException;
//import java.io.InputStream; import java.io.InputStream;
//import java.time.LocalDateTime; import java.time.LocalDateTime;
//import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
//import java.util.HashMap; import java.util.HashMap;
//
//
///** /**
// * @Author: aiqingguo * @Author: aiqingguo
// * @Description: 临时接口 * @Description: 临时接口
// * @Date: 2023-8-21 12:10:16 * @Date: 2023-8-21 12:10:16
// * @Version: 1.0 * @Version: 1.0
// */ */
//@Slf4j @Slf4j
//@RestController @RestController
//@RequestMapping(value="/temp/yftbank") @RequestMapping(value="/temp/yftbank")
//public class TempYftBankController { public class TempYftBankController {
//
// @Autowired @Autowired
// private TempService tempService; private TempService tempService;
//
// @ApiOperation(value = "test", notes = "<br>By:艾庆国") @ApiOperation(value = "test", notes = "<br>By:艾庆国")
// @RequestMapping(value = "/test", method = RequestMethod.POST) @RequestMapping(value = "/test", method = RequestMethod.POST)
// public Result<OrderChildLineStatisticsVO> test() throws Exception { public Result<OrderChildLineStatisticsVO> test() throws Exception {
//
// bankTest(); bankTest();
// return Result.ok(); return Result.ok();
// } }
//
// @ApiOperation(value = "test1", notes = "<br>By:艾庆国") @ApiOperation(value = "test1", notes = "<br>By:艾庆国")
// @RequestMapping(value = "/test1", method = RequestMethod.POST) @RequestMapping(value = "/test1", method = RequestMethod.POST)
// public Result<OrderChildLineStatisticsVO> test1() throws Exception { public Result<OrderChildLineStatisticsVO> test1() throws Exception {
//
// testAPI1(); testAPI1();
// return Result.ok(); return Result.ok();
// } }
//
//
// public static void bankTest() throws Exception { public static void bankTest() throws Exception {
// ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json"); ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json");
// InputStream inputStream = null; InputStream inputStream = null;
// try { try {
// inputStream = classPathResource.getInputStream(); inputStream = classPathResource.getInputStream();
// boolean initResult = NBOpenSDK.init(inputStream); boolean initResult = NBOpenSDK.init(inputStream);
// log.info("NBSDK初始化状态:{}", initResult); log.info("NBSDK初始化状态:{}", initResult);
// log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo()); log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo());
// } catch (IOException e) { } catch (IOException e) {
// e.printStackTrace(); e.printStackTrace();
// } }
//
// testAPI(); unionPayDirectOrder();
// } }
//
// //API测试接口 //API测试接口
//
// /** /**
// * 商户号:EFT33021200556315 * 下单
// * 银行转账:86041110000075918(户名:客户客户) * 商户号:EFT33021200556315
// * 订单支付:结算账号(86041110000075926(户名:客户客户)) * 银行转账:86041110000075918(户名:客户客户)
// */ * 订单支付:结算账号(86041110000075926(户名:客户客户))
// private static void testAPI() { * 响应结果:
// try { * {
// JSONObject jsonObject = new JSONObject(); * "data": {
// jsonObject.put("transId", "IP01"); //交易识别码 必填 * "errorCode": "000000",
// jsonObject.put("merId", "EFT33021200556315"); //商户号 必填 * "errorMsg": "成功",
// * "frontUrl": "",
// jsonObject.put("merSeqNo", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); //商户流水 必填 * "merId": "EFT33021200556315",
// jsonObject.put("merDtTm", LocalDateTimeUtils.formatTime()); //商户时间 必填 * "merSeqNo": "20231129133913",
// * "signData": "",
// jsonObject.put("trxAmt", "1.23"); //订单金额 必填 * "transSeqNo": "2023112913391406547689VYvNioNz"
// jsonObject.put("orderDesc", "采购"); //订单详情 必填 * },
// jsonObject.put("productName", "小黄鱼"); //商品名称 必填 * "head": {
// jsonObject.put("productId", "001"); //商品编号 必填 * "rqsJrnlNo": "14414965925389704",
// jsonObject.put("productNum", "1"); //商品数量 必填 * "rspCode": "000000",
// * "rspDate": "2023-11-29",
// jsonObject.put("payAcctNo", "86041110000075926"); //付款账号 必填 * "rspMsg": "交易成功",
// jsonObject.put("payAcctNm", "客户客户"); //付款户名 必填 * "rspTime": "13:39:16:035"
// jsonObject.put("bankType", "00"); //账户类型 必填 * }
// jsonObject.put("payAcctOpenBankId", "313332082914"); //开户行号 必填 * }
//// jsonObject.put("mobilePhone", "13000000000"); //手机号 */
// private static void unionPayDirectOrder() {
// HashMap<String,String> httpHeader = new HashMap<>(); try {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("transId", "IP01"); //交易识别码 必填
// RequestApiData requestApiData = new RequestApiData(); jsonObject.put("merId", "EFT33021200556315"); //商户号 必填
// requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
// requestApiData.setData(jsonObject); jsonObject.put("merSeqNo", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); //商户流水 必填
// requestApiData.setProductId("YFT"); jsonObject.put("merDtTm", LocalDateTimeUtils.formatTime()); //商户时间 必填
// requestApiData.setServiceId("unionPayDirectOrder");
// requestApiData.setHttpHeader(httpHeader); jsonObject.put("trxAmt", "1.23"); //订单金额 必填
// jsonObject.put("orderDesc", "采购"); //订单详情 必填
// RequestHead requestHead = new RequestHead(); jsonObject.put("productName", "小黄鱼"); //商品名称 必填
// requestHead.setRqsJrnlNo(NBOpenSDK.getRandom()); jsonObject.put("productId", "001"); //商品编号 必填
// jsonObject.put("productNum", "1"); //商品数量 必填
jsonObject.put("payAcctNo", "86041110000075926"); //付款账号 必填
jsonObject.put("payAcctNm", "客户客户"); //付款户名 必填
jsonObject.put("bankType", "00"); //账户类型 必填
jsonObject.put("payAcctOpenBankId", "313332082914"); //开户行号 必填
// jsonObject.put("mobilePhone", "13000000000"); //手机号
HashMap<String,String> httpHeader = new HashMap<>();
RequestApiData requestApiData = new RequestApiData();
requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
requestApiData.setData(jsonObject);
requestApiData.setProductId("YFT");
requestApiData.setServiceId("unionPayDirectOrder");
requestApiData.setHttpHeader(httpHeader);
RequestHead requestHead = new RequestHead();
requestHead.setRqsJrnlNo(NBOpenSDK.getRandom());
SDKRequest request = new SDKRequest();
request.setData(requestApiData);
request.setHead(requestHead);
log.info("SDK请求内容: "+ JSON.toJSONString(request));
SDKResponse result = NBOpenSDK.send(request);
log.info("SDK响应结果: "+JSON.toJSONString(result));
queryOrder(JSON.parseObject(JSON.toJSONString(result)).getJSONObject("data").getString("merSeqNo"));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 结果查询
* 商户号:EFT33021200556315
* 银行转账:86041110000075918(户名:客户客户)
* 订单支付:结算账号(86041110000075926(户名:客户客户))
*/
private static void queryOrder(String merSeqNo) {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("transId", "IP01"); //交易识别码 必填
jsonObject.put("merId", "EFT33021200556315"); //商户号 必填
jsonObject.put("merSeqNo", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); //商户流水 必填
HashMap<String,String> httpHeader = new HashMap<>();
RequestApiData requestApiData = new RequestApiData();
requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
requestApiData.setData(jsonObject);
requestApiData.setProductId("YFT");
requestApiData.setServiceId("queryOrder");
requestApiData.setHttpHeader(httpHeader);
RequestHead requestHead = new RequestHead();
requestHead.setRqsJrnlNo(NBOpenSDK.getRandom());
SDKRequest request = new SDKRequest();
request.setData(requestApiData);
request.setHead(requestHead);
log.info("SDK请求内容: "+ JSON.toJSONString(request));
SDKResponse result = NBOpenSDK.send(request);
log.info("SDK响应结果: "+JSON.toJSONString(result));
} catch (Exception e) {
e.printStackTrace();
}
}
private static void testAPI1() {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("qryType","3");
jsonObject.put("idNo","330125197810053747");
jsonObject.put("idType","1");
RequestApiData requestApiData = new RequestApiData();
requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
requestApiData.setData(jsonObject);
requestApiData.setProductId("");
requestApiData.setServiceId("commontest");
HashMap<String,String> httpHeader = new HashMap<>();
requestApiData.setHttpHeader(httpHeader);
SDKRequest request = new SDKRequest();
RequestHead requestHead = new RequestHead();
requestHead.setRqsJrnlNo(NBOpenSDK.getRandom());
request.setHead(requestHead);
request.setData(requestApiData);
System.out.println("SDK请求内容: "+ JSON.toJSONString(request));
SDKResponse result = NBOpenSDK.send(request);
System.out.println("SDK响应结果: "+JSON.toJSONString(result));
} catch (Exception e) {
e.printStackTrace();
}
}
//
// //文件上传测试接口
// private static void testUploadFile(String localFileName,String remoteFileName,String tranCode) throws Exception {
// try{
// SDKRequest request = new SDKRequest(); // SDKRequest request = new SDKRequest();
// request.setData(requestApiData); // RequestHead head = new RequestHead();
// request.setHead(requestHead); // head.setRqsJrnlNo(NBOpenSDK.getRandom());
// // request.setHead(head);
// log.info("SDK请求内容: "+ JSON.toJSONString(request)); // RequestFileData fileData = new RequestFileData();
// SDKResponse result = NBOpenSDK.send(request); // fileData.setLocalFilePath("C:\\Users\\k6118\\Downloads\\11.json");
// log.info("SDK响应结果: "+JSON.toJSONString(result)); // fileData.setRemoteFileName("11.json");
// } catch (Exception e) { // fileData.setTranCode("merFileUploadApply");
// fileData.setUid("YITANG");
// request.setData(fileData);
// System.out.println("---SDK请求报文: "+ JSON.toJSONString(request, SerializerFeature.WriteMapNullValue));
// SDKResponse response = NBOpenSDK.putFile(request);
// System.out.println( "---SDK响应结果: "+ JSON.toJSONString(response,SerializerFeature.WriteMapNullValue));
// } catch (Exception e){
// e.printStackTrace(); // e.printStackTrace();
// } // }
// } // }
// //
// private static void testAPI1() { // //文件下载测试接口
// try { // private static void testDownloadFile(String localFileName,String remoteFileName,String tranCode) throws Exception {
// JSONObject jsonObject = new JSONObject(); // try{
// jsonObject.put("qryType","3");
// jsonObject.put("idNo","330125197810053747");
// jsonObject.put("idType","1");
// RequestApiData requestApiData = new RequestApiData();
// requestApiData.setAppkey("77667c76_3503_4c04_95f7_fc10938c7942");
// requestApiData.setData(jsonObject);
// requestApiData.setProductId("");
// requestApiData.setServiceId("commontest");
//
// HashMap<String,String> httpHeader = new HashMap<>();
// requestApiData.setHttpHeader(httpHeader);
//
// SDKRequest request = new SDKRequest(); // SDKRequest request = new SDKRequest();
// RequestHead requestHead = new RequestHead(); // RequestHead head = new RequestHead();
// requestHead.setRqsJrnlNo(NBOpenSDK.getRandom()); // head.setRqsJrnlNo(NBOpenSDK.getRandom());
// request.setHead(requestHead); // request.setHead(head);
// request.setData(requestApiData); // RequestFileData fileData = new RequestFileData();
// // fileData.setLocalFilePath("C:\\Users\\k6118\\Downloads\\12.json");
// System.out.println("SDK请求内容: "+ JSON.toJSONString(request)); // fileData.setRemoteFileName("8374eb1718cf4083a74430ebd9af058f/11.json");
// SDKResponse result = NBOpenSDK.send(request); // fileData.setTranCode("merFileDownloadApply");
// System.out.println("SDK响应结果: "+JSON.toJSONString(result)); // fileData.setUid("YITANG");
// } catch (Exception e) { // request.setData(fileData);
// System.out.println("---SDK请求报文: "+ JSON.toJSONString(request, SerializerFeature.WriteMapNullValue));
// SDKResponse response = NBOpenSDK.getFile(request);
// System.out.println( "---SDK响应结果: "+ JSON.toJSONString(response,SerializerFeature.WriteMapNullValue));
// } catch (Exception e){
// e.printStackTrace(); // e.printStackTrace();
// } // }
// } // }
// //
//// // /**
//// //文件上传测试接口 // * 易付通
//// private static void testUploadFile(String localFileName,String remoteFileName,String tranCode) throws Exception { // */
//// try{ // static String unionPayDirectOrder() throws Exception {
//// SDKRequest request = new SDKRequest(); //
//// RequestHead head = new RequestHead(); // HashMap<String, Object> map = new HashMap();
//// head.setRqsJrnlNo(NBOpenSDK.getRandom()); // HashMap<String, Object> data = new HashMap();
//// request.setHead(head); // map.put("Data", data);
//// RequestFileData fileData = new RequestFileData(); //
//// fileData.setLocalFilePath("C:\\Users\\k6118\\Downloads\\11.json"); // data.put("transId", "IP01"); //交易识别码 必填
//// fileData.setRemoteFileName("11.json"); // data.put("merId", "2023112300000002"); //商户号 必填
//// fileData.setTranCode("merFileUploadApply"); // data.put("merSeqNo", "2023112300000001"); //商户流水 必填
//// fileData.setUid("YITANG"); // data.put("merDtTm", "2023-11-24 11:00:00"); //商户时间 必填
//// request.setData(fileData); // data.put("trxAmt", "1.23"); //订单金额 必填
//// System.out.println("---SDK请求报文: "+ JSON.toJSONString(request, SerializerFeature.WriteMapNullValue)); // data.put("orderDesc", "采购"); //订单详情 必填
//// SDKResponse response = NBOpenSDK.putFile(request); // data.put("productNam", "小黄鱼"); //商品名称 必填
//// System.out.println( "---SDK响应结果: "+ JSON.toJSONString(response,SerializerFeature.WriteMapNullValue)); // data.put("productId", "001"); //商品编号 必填
//// } catch (Exception e){ // data.put("productNum", "1"); //商品数量 必填
//// e.printStackTrace(); //
//// } // data.put("payAcctNo", "6223161100110442"); //付款账号 必填
//// } // data.put("payAcctNm", "刘晓琴"); //付款户名 必填
//// // data.put("bankType", "00"); //账户类型 必填
//// //文件下载测试接口 // data.put("payAcctOpenBankId", "313332082914"); //开户行号 必填
//// private static void testDownloadFile(String localFileName,String remoteFileName,String tranCode) throws Exception { //// data.put("mobilePhone", "13000000000"); //手机号
//// try{ //
//// SDKRequest request = new SDKRequest(); // String res1 = NBOpenSDK.send("YFT", "unionPayDirectOrder", JSON.toJSONString(map));
//// RequestHead head = new RequestHead(); // log.info("银联订单支付收款模式接口:{}" , res1);
//// head.setRqsJrnlNo(NBOpenSDK.getRandom()); //
//// request.setHead(head); // return res1;
//// RequestFileData fileData = new RequestFileData();
//// fileData.setLocalFilePath("C:\\Users\\k6118\\Downloads\\12.json");
//// fileData.setRemoteFileName("8374eb1718cf4083a74430ebd9af058f/11.json");
//// fileData.setTranCode("merFileDownloadApply");
//// fileData.setUid("YITANG");
//// request.setData(fileData);
//// System.out.println("---SDK请求报文: "+ JSON.toJSONString(request, SerializerFeature.WriteMapNullValue));
//// SDKResponse response = NBOpenSDK.getFile(request);
//// System.out.println( "---SDK响应结果: "+ JSON.toJSONString(response,SerializerFeature.WriteMapNullValue));
//// } catch (Exception e){
//// e.printStackTrace();
//// }
//// }
////
//// /**
//// * 易付通
//// */
//// static String unionPayDirectOrder() throws Exception {
////
//// HashMap<String, Object> map = new HashMap();
//// HashMap<String, Object> data = new HashMap();
//// map.put("Data", data);
////
//// data.put("transId", "IP01"); //交易识别码 必填
//// data.put("merId", "2023112300000002"); //商户号 必填
//// data.put("merSeqNo", "2023112300000001"); //商户流水 必填
//// data.put("merDtTm", "2023-11-24 11:00:00"); //商户时间 必填
//// data.put("trxAmt", "1.23"); //订单金额 必填
//// data.put("orderDesc", "采购"); //订单详情 必填
//// data.put("productNam", "小黄鱼"); //商品名称 必填
//// data.put("productId", "001"); //商品编号 必填
//// data.put("productNum", "1"); //商品数量 必填
////
//// data.put("payAcctNo", "6223161100110442"); //付款账号 必填
//// data.put("payAcctNm", "刘晓琴"); //付款户名 必填
//// data.put("bankType", "00"); //账户类型 必填
//// data.put("payAcctOpenBankId", "313332082914"); //开户行号 必填
////// data.put("mobilePhone", "13000000000"); //手机号
////
//// String res1 = NBOpenSDK.send("YFT", "unionPayDirectOrder", JSON.toJSONString(map));
//// log.info("银联订单支付收款模式接口:{}" , res1);
////
//// return res1;
//// }
////
////
// public static void main(String[] args) throws Exception {
//
// bankTest();
//
// } // }
// //
// //
//} public static void main(String[] args) throws Exception {
bankTest();
}
}
package com.clx.performance.controller.thirdparty; package com.clx.performance.controller.thirdparty;
import com.msl.common.result.Result; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -16,9 +17,15 @@ public class NbBankController { ...@@ -16,9 +17,15 @@ public class NbBankController {
@ApiOperation(value = "notify", notes = "<br>By:艾庆国") @ApiOperation(value = "notify", notes = "<br>By:艾庆国")
@RequestMapping(value = "/notify", method = RequestMethod.POST) @RequestMapping(value = "/notify", method = RequestMethod.POST)
public Result bankNotify() { public void bankNotify(@RequestBody JSONObject param) {
log.info("宁波银行回调, data:{}", param.toJSONString());
// HashMap hashMap = new HashMap();
// hashMap.put("errorCode", "000000");
// hashMap.put("errorMsg", "000000");
return Result.ok();
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论