Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
a5adbde5
Commit
a5adbde5
authored
Aug 14, 2024
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工行对接修改
parent
2446ea75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
2 deletions
+72
-2
IcbcTransactionFlowQueryController.java
...v1/ekp/controller/IcbcTransactionFlowQueryController.java
+13
-0
IcbcTransactionFlowQueryService.java
.../plus/v1/ekp/service/IcbcTransactionFlowQueryService.java
+3
-0
IcbcTransactionFlowQueryServiceImpl.java
...ekp/service/impl/IcbcTransactionFlowQueryServiceImpl.java
+56
-2
No files found.
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/controller/IcbcTransactionFlowQueryController.java
View file @
a5adbde5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
controller
;
import
com.icbc.api.IcbcApiException
;
import
com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
io.swagger.v3.oas.annotations.Operation
;
...
...
@@ -35,6 +36,18 @@ public class IcbcTransactionFlowQueryController {
return
icbcTransactionFlowQueryService
.
getIcbcTransactionFlow
();
}
/**
* 交易流水查询
*
* @param
* @return
*/
@Operation
(
summary
=
"交易流水查询"
,
description
=
"交易流水查询"
)
@PostMapping
(
"/newPage"
)
public
R
getIcbcTransactionFlowNew
()
throws
IcbcApiException
{
return
icbcTransactionFlowQueryService
.
getIcbcTransactionFlowNew
();
}
/**
* 预订单接口
*
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/IcbcTransactionFlowQueryService.java
View file @
a5adbde5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.icbc.api.IcbcApiException
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -14,6 +15,8 @@ public interface IcbcTransactionFlowQueryService extends IService<EkpSocialInfo>
R
getIcbcTransactionFlow
();
R
getIcbcTransactionFlowNew
()
throws
IcbcApiException
;
R
saveIcbcManagerCard
();
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/IcbcTransactionFlowQueryServiceImpl.java
View file @
a5adbde5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.icbc.api.DefaultIcbcClient
;
...
...
@@ -7,8 +8,11 @@ import com.icbc.api.IcbcApiException;
import
com.icbc.api.IcbcConstants
;
import
com.icbc.api.request.JftApiB2bpayTransqueryRequestV1
;
import
com.icbc.api.request.JftApiPayB2bpayGenpreorderRequestV1
;
import
com.icbc.api.request.MybankEnterpriseTradeQhisdRequestV1
;
import
com.icbc.api.response.JftApiB2bpayTransqueryResponseV1
;
import
com.icbc.api.response.JftApiPayB2bpayGenpreorderResponseV1
;
import
com.icbc.api.response.MybankEnterpriseTradeQhisdResponseV1
;
import
com.icbc.api.utils.IcbcSignature
;
import
com.yifu.cloud.plus.v1.ekp.config.IcbcConfigProperties
;
import
com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo
;
import
com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper
;
...
...
@@ -55,11 +59,11 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
//3、密钥对认证方式,公钥在API平台登记,此处为私钥
String
MY_PRIVATE_KEY
=
"MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC96zrfaBT4YOoLErhTaFnv0De1K3ZsZRQDGm3dIF8wHX/Rqg2sz5hfJexMwNgTepHdxrpveq8bog9jny8CtCT2etUD+NKT0gBYx4FzjCy1vtJzO1BqyzqzHA+GMsFQ/CYucRo25SJRv9szJD7d0SlnD0rnJWnbCuK+OgzM1ixCeUKsF/94Fgbo95UeW6EhH8H4VwNNrWRZei+eLfkIoHMSTB9D2g58i5S++/oieLg52MRd35x3pm60ipcGTgLpLi0xJGNB3dDDNA/UG3D7jbpLha3+eX1SaKU3jmTZYyLBFRe4fuY1LJq8gI03KGNHhPsbu1Gn8q9H7pcK3O1JAqStAgMBAAECggEAPiRuCxO/aNYtPppNfd0zMGjtEXa7NRSNy8YmFKi2/MNqQ2xlNRpoPRnni+W9zgHZILwZ3MhD68LHTk2T0EqpnYzrjnUoUf3w5xvAm9JN/toFenb6BTeiaWDRI5QP9TPMOn3/md63sBAa5U0C1QnPhk1WsPNpA6c4Mg5EifG6YbVDPUbC8tGLA+l9KCtpYxHc48rcYwe4/Pq5zA3dCx4vcXahdXJh6ZFOG2JkmwROJZGdXmEpAuHuBRLnTzvaJuNSyi5i/+tr7g8IW/27MoVAFtv30YOqYBufOBXXTcfm64UGUfo1anEsVPwXC9UvYS+l0f8f/kKIF8GZSWRa4n2KcQKBgQDowKxRcSOYttJ7l5isXGs3ErvFyIB+ST6cgFjgRMl2gJOybv591dqeaVu5SBp83hKgTg1iftufzvxMpwpd1PVKMqK5MGMTxTuWmxlEh6YKa4QKu1H2D/x0D2YbxhOh2PvdJy18F5T5EQ2Tow7/rU7xfyjaXC0AvEyra9gjX9QWEwKBgQDQ41OcJh+VDIKV/y+fKqpS9Y8DeoZ7VCPPAzDQ1p2bA/eEzVzKViR6mZ6IzIJRlrQB93wvIa5KD84563mWoAX2dYn1iX/x7oLg55Dd/iR+BTRqCZJBiziUb/bSRbLeIEGCfpfCyKhoPuc0H60k4BWT7itkj4Cm1Ht3pJYMQKiyPwKBgQCKUa5WO/lekQ9nGYFGtSmWMhDbCjuqURbfZLrslJRxUxnzCVk+KO/iAlTbOEldeY/yKlBz/1W/k/+GAiL7/knDTXI8wc+veR/fcc7DViXLvXdb9VRQ+dEam+gfi0gxf8S1+cljHJSQq5y450dLlI/8nogFtI+eB0k8+jsZUqK0dwKBgQCE6I+TZAJmUK5qCBNh38C9xjZ3zSbyI6ghGHOf/V4Meuqrmgs3RrYxN7tSaWVlylDAi5p9Vp3Ry9q4qaYUe78vgLwF+bXp1ot51H0tcn3/nQoriemAQLgAYnkWc3iKstVb1XZ0Xj4hDh0H4jvFobq5BCqh8li2Ta49gwBhzWZI+wKBgQCTHyWu3M6FtClYFHm2T3rOpTvjE/3xWZ3gMPsk8bMuyPZPEP83HJGVyBtwlbr05JMtZ1rEaPsVVQn0U1Qp0z+8tl4I9F+fJiUmu0/2/hS2iFsDKdZGJnfAM8APG6K7ID5Km8CnmnPX/ynBA1kpucIRUDnUwbGcfEbf2ufhPd10dg=="
;
String
AES_Key
=
"u1NKBJOMzvkHFvGiKbsq3g=="
;
DefaultIcbcClient
client
=
new
DefaultIcbcClient
(
APP_ID
,
IcbcConstants
.
SIGN_TYPE_
RSA2
,
DefaultIcbcClient
client
=
new
DefaultIcbcClient
(
APP_ID
,
IcbcConstants
.
SIGN_TYPE_
CA_SM_ICBC
,
MY_PRIVATE_KEY
,
IcbcConstants
.
CHARSET_UTF8
,
IcbcConstants
.
FORMAT_JSON
,
APIGW_PUBLIC_KEY
,
IcbcConstants
.
ENCRYPT_TYPE_AES
,
AES_Key
,
""
,
""
);
JftApiB2bpayTransqueryRequestV1
request
=
new
JftApiB2bpayTransqueryRequestV1
();
request
.
setServiceUrl
(
"https://
gw.open.icbc
.com.cn/api/jft/api/b2bpay/transquery/V1"
);
request
.
setServiceUrl
(
"https://
apipcs3.dccnet
.com.cn/api/jft/api/b2bpay/transquery/V1"
);
JftApiB2bpayTransqueryRequestV1
.
JftApiB2bpayTransqueryRequestV1Biz
bizContent
=
new
JftApiB2bpayTransqueryRequestV1
.
JftApiB2bpayTransqueryRequestV1Biz
();
...
...
@@ -95,6 +99,56 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
public
R
getIcbcTransactionFlowNew
()
throws
IcbcApiException
{
//1、网关公钥
// String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB";
// //2、appid
// String APP_ID = "10000000000000223600";
// //3、密钥对认证方式,公钥在API平台登记,此处为私钥
// String MY_PRIVATE_KEY = "73382de53fcbf8aa3b00d07f9808b18e89d1b6b33c9759829eee5cbf1947dbdb";
// DefaultIcbcClient client = new DefaultIcbcClient("10000000000000223600", IcbcConstants.SIGN_TYPE_CA_SM_ICBC, MY_PRIVATE_KEY,
// IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, null,
// null, null, "1.2.156.10197.1.301", null);
String
ca_sm_path
=
"D:/icbcFile/ahwx.y.1302.cer"
;
String
ca_sm_icbc_path
=
"D:/icbcFile/API_GATEWAY_ICBC_SM.cer"
;
String
ca_sm
=
IcbcSignature
.
getCAInfoStr
(
ca_sm_path
);
String
ca_sm_icbc
=
IcbcSignature
.
getCAInfoStr
(
ca_sm_icbc_path
);
String
privateKey
=
"4d931f6ad4331158fcc4dea23f0d71393328146e40b5f63f197b9f6ad3732f44"
;
// DefaultIcbcClient(appid, 签名类型, SM2企业私钥, 编码格式, 数据格式, null, null, null, SM2 cer公钥串, null)
DefaultIcbcClient
client
=
new
DefaultIcbcClient
(
"11000000000000019038"
,
IcbcConstants
.
SIGN_TYPE_CA_SM_ICBC
,
privateKey
,
IcbcConstants
.
CHARSET_UTF8
,
IcbcConstants
.
FORMAT_JSON
,
null
,
null
,
null
,
ca_sm
,
null
);
client
.
setIcbc_ca
(
ca_sm_icbc
);
MybankEnterpriseTradeQhisdRequestV1
.
MybankEnterpriseTradeQhisdRequestBizV1
bizContent
=
new
MybankEnterpriseTradeQhisdRequestV1
.
MybankEnterpriseTradeQhisdRequestBizV1
();
MybankEnterpriseTradeQhisdRequestV1
request
=
new
MybankEnterpriseTradeQhisdRequestV1
();
bizContent
.
setTranDate
(
"20240814"
);
bizContent
.
setTranTime
(
"105900000"
);
bizContent
.
setTransCode
(
"AHWX"
);
bizContent
.
setLanguage
(
"zh_CN"
);
String
fSeqNo
=
"AHWX"
+
System
.
currentTimeMillis
();
bizContent
.
setfSeqno
(
fSeqNo
);
bizContent
.
setAccountNo
(
"1302010109024596014"
);
bizContent
.
setBeginDate
(
"20240814"
);
request
.
setServiceUrl
(
"https://gw.open.icbc.com.cn/api/mybank/enterprise/trade/qhisd/V1"
);
request
.
setBizContent
(
bizContent
);
System
.
out
.
println
(
"request: "
+
JSON
.
toJSONString
(
request
));
MybankEnterpriseTradeQhisdResponseV1
response
=
client
.
execute
(
request
);
System
.
out
.
println
(
"response: "
+
JSON
.
toJSONString
(
response
));
if
(!
response
.
isSuccess
())
{
System
.
out
.
println
(
"Code: "
+
response
.
getReturnCode
()
+
" Msg: "
+
response
.
getReturnMsg
());
}
return
R
.
ok
();
}
public
R
saveIcbcManagerCard
()
{
//应用id 应用方私钥 网关公钥 应用方加密串
String
APP_ID
=
"11000000000000015602"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment