收款记录保存

2024年7月26日 15:19:46
This commit is contained in:
xiang2lin 2024-07-26 15:19:51 +08:00
parent 4f798570f0
commit 3a768e1dcc
3 changed files with 118 additions and 10 deletions

View File

@ -461,4 +461,12 @@ public class AccTransactionRes {
public void setRecTime(String recTime) {
this.recTime = recTime;
}
public String getOppAccName() {
return oppAccName;
}
public void setOppAccName(String oppAccName) {
this.oppAccName = oppAccName;
}
}

View File

@ -2,21 +2,17 @@ package com.hzya.frame.ningboBankTreasury.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.bip.v3.v2207.dps.service.impl.PayMentServiceImpl;
import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse;
import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService;
import com.hzya.frame.ningboBankTreasury.util.BingboBankUtil;
import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
import com.hzya.frame.util.bipV3.SHA256Util;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.nbcb.sdk.OpenSDK;
import com.nbcb.sdk.aes.exception.SDKException;
import com.nbcb.sdk.aes.param.ConfigParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@ -111,11 +107,11 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
OpenSDK.dynamicInit(configParam,true);
data.put("Data",JSONObject.toJSONString(accTransactionReq));
logger.info("查询交易明细请求参数:{}",data.toString());
String returnData = OpenSDK.send(BingboBankUtil.TMSREPORT,BingboBankUtil.QUERYACCDETAIL,data.toString());
String returnData = OpenSDK.send(NingboBankUtil.TMSREPORT, NingboBankUtil.QUERYACCDETAIL,data.toString());
System.out.println(returnData);
logger.info("查询交易明细返回数据:{}",returnData);
AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnData);
if (null != accTrxResponse && BingboBankUtil.isSuccess(accTrxResponse.getRetCode())){
if (null != accTrxResponse && NingboBankUtil.isSuccess(accTrxResponse.getRetCode())){
totalPage = Integer.valueOf(accTrxResponse.getTotalPage());
resList.addAll(accTrxResponse.getList());
}
@ -153,10 +149,11 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
entity.put("Data",data);
JSONObject param = new JSONObject();
param.put("jsonStr",entity);
logger.info("查询交易明细请求参数:{}",JSONObject.toJSONString(param));
JSONObject returnObj = (JSONObject) sendNbBank(param);
logger.info("查询交易明细返回数据:{}",returnObj.toString());
AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnObj.toString());
if (null != accTrxResponse && BingboBankUtil.isSuccess(accTrxResponse.getRetCode())){
if (null != accTrxResponse && NingboBankUtil.isSuccess(accTrxResponse.getRetCode())){
totalPage = Integer.valueOf(accTrxResponse.getTotalPage());
resList.addAll(accTrxResponse.getList());
}
@ -182,7 +179,7 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
accTransactionReq.setQueryType("0");
}
if (StrUtil.isEmpty(accTransactionReq.getCdSign())){
accTransactionReq.setCdSign("0");
accTransactionReq.setCdSign(NingboBankUtil.SHOURU);
}
return accTransactionReq;
}

View File

@ -1,10 +1,15 @@
package com.hzya.frame;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Test;
import javax.annotation.Resource;
import java.util.List;
/**
@ -16,4 +21,102 @@ import javax.annotation.Resource;
public class Tetst01 {
//产品号
private static String productID = "tmsReport";
//服务号
private static String serviceID = "queryAccDetail";
@Test
public void trxParseTest(){
String str = "{\n" +
" \"Data\": {\n" +
" \"retCode\": \"0000\",\n" +
" \"retMsg\": \"查询成功\",\n" +
" \"pageSize\": \"50\",\n" +
" \"currentPage\": \"1\",\n" +
" \"totalPage\": \"1\",\n" +
" \"totalSize\": \"4\",\n" +
" \"list\": [{\n" +
" \"bankAcc\": \"53170122000051772\",\n" +
" \"bankSubAcc\": \"\",\n" +
" \"accName\": \"宁波富市智梵织焦投资有限公司\",\n" +
" \"bankName\": \"宁波银行股份有限公司江北支行\",\n" +
" \"oppAccNo\": \"\",\n" +
" \"oppAccBank\": \"\",\n" +
" \"cdSign\": \"0\",\n" +
" \"cdSignName\": \"\",\n" +
" \"amt\": \"999999.00\",\n" +
" \"bal\": \"51643875.40\",\n" +
" \"transTime\": \"2024-05-04 09:13:18\",\n" +
" \"subSerialNo\": \"3200000021\",\n" +
" \"serialNo\": \"\",\n" +
" \"curCode\": \"01\",\n" +
" \"uses\": \"\",\n" +
" \"abs\": \"现金存入\",\n" +
" \"voucherNo\": \"12405044020000446120240504\",\n" +
" \"bifCode\": \"9038\",\n" +
" \"bankType\": \"宁波银行\",\n" +
" \"oppBankType\": \"\",\n" +
" \"isForIndividual\": \"0\",\n" +
" \"serialId\": \"445439D1462C3600F9235B9C2BEF48E6\",\n" +
" \"bankSerialId\": \"124050440200004461\",\n" +
" \"groupTrans\": \"\",\n" +
" \"capitalTrans\": \"\",\n" +
" \"postScript\": \"\",\n" +
" \"accType\": \"\",\n" +
" \"accTypeName\": \"\",\n" +
" \"cashTfrFlg\": \"现金\",\n" +
" \"chinaDevelopBankNo\": \"\",\n" +
" \"chinaDevelopAccType\": \"\",\n" +
" \"payBillCode\": \"\",\n" +
" \"alipayBaseOrderNumber\": \"\",\n" +
" \"alipayBusinessDescription\": \"\",\n" +
" \"labelValue1\": \"\",\n" +
" \"labelValue2\": \"\",\n" +
" \"labelValue3\": \"\",\n" +
" \"labelValue4\": \"\",\n" +
" \"downloadNo\": \"\",\n" +
" \"sortRule\": \"202405043200000021202405040000647193\",\n" +
" \"orderNo\": \"202405040000647193\",\n" +
" \"alipayTradeName\": \"\",\n" +
" \"matchCode\": \"5317012200005177220240504999999.0012405044020000446120240504\",\n" +
" \"receiptInfo\": \"\",\n" +
" \"billNum\": \"\",\n" +
" \"recTime\": \"2024-05-04 09:48:47\"\n" +
" }]\n" +
" }\n" +
"}";
AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(str);
System.out.println("1111");
}
/**
* 宁波银行交易明细
*/
@Test
public void queryAccDetail(){
JSONObject jsonObject = new JSONObject();
JSONObject data = new JSONObject();
data.put("custId", "0000070401");//客户号
List<String> strs = (List<String>) Convert.toList("123456");
JSONArray jsonArray = new JSONArray();
for(String str :strs){
str = StringUtils.deleteWhitespace(str);
jsonArray.add(str);
}
data.put("bankAccList", jsonArray);
data.put("beginDate", DateUtil.today());//开始日期
data.put("endDate", DateUtil.today());//结束日期
data.put("pageSize", "1000");//每页条数
data.put("currentPage", 1);//当前页数
data.put("queryType", "0");//查询方式0-分页查询
data.put("cdSign","0");//收支方向0收入1支出
jsonObject.put("Data", data);
String param = jsonObject.toString();
System.out.println(param);
try {
//String res = OpenSDK.send(productID, serviceID, jsonObject.toJSONString());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}