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
690960df
Commit
690960df
authored
Nov 04, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
交行jar引入及开发demo-fxj
parent
d11d7495
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
519 additions
and
2 deletions
+519
-2
pom.xml
yifu-ekp/yifu-ekp-api/pom.xml
+2
-2
EkpIpctController.java
.../yifu/cloud/plus/v1/ekp/controller/EkpIpctController.java
+120
-0
IpctUtil.java
...c/main/java/com/yifu/cloud/plus/v1/ekp/util/IpctUtil.java
+397
-0
No files found.
yifu-ekp/yifu-ekp-api/pom.xml
View file @
690960df
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
<version>
1.2.0
</version>
<version>
1.2.0
</version>
</dependency>
</dependency>
<!-- 交行jar引入 -->
<!-- 交行jar引入 -->
<
!--<
dependency>
<dependency>
<groupId>
com.ipct.safety
</groupId>
<groupId>
com.ipct.safety
</groupId>
<artifactId>
ipct_safety
</artifactId>
<artifactId>
ipct_safety
</artifactId>
<version>
2.1.1
</version>
<version>
2.1.1
</version>
...
@@ -110,6 +110,6 @@
...
@@ -110,6 +110,6 @@
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<artifactId>
hutool-all
</artifactId>
<version>
5.5.8
</version>
<version>
5.5.8
</version>
</dependency>
-->
</dependency>
</dependencies>
</dependencies>
</project>
</project>
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/controller/EkpIpctController.java
0 → 100644
View file @
690960df
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
ekp
.
controller
;
import
com.yifu.cloud.plus.v1.ekp.util.IpctUtil
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/ekpIpct"
)
@Tag
(
name
=
"预警配置表管理"
)
public
class
EkpIpctController
{
@Autowired
private
IpctUtil
ipctUtil
;
/**
* @Author fxj
* @Description 企业微信智能表格API调用调试入口
* @Date 15:56 2025/9/26
* @Param
* @return
**/
@PostMapping
(
"/tesxIpctApi"
)
public
void
tesxIpctApi
()
{
try
{
/**
* 第一步,调用ipct_safety包中的SM2类中的SM2Generate方法,将方法返回的公私钥对保存
* custId为云跨行客户号,由交行提供
*
*
* 私钥:MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgT9IzBq591GocYT7bxZPSW5S4xDLmeLG8zklsciINlT2gCgYIKoEcz1UBgi2hRANCAASaA0BYV6o6yMPKNl8DL0n4s9yV0e3Yzbh5D4ChG8ejGSDSPXmvUXJ6xgK61LH1N+Ns7dcPUtMvfWjIxxbIppaT
* 公钥:MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEmgNAWFeqOsjDyjZfAy9J+LPcldHt2M24eQ+AoRvHoxkg0j15r1FyesYCutSx9TfjbO3XD1LTL31oyMcWyKaWkw==
*/
//已获取公钥私钥这里直接注释
//ipctUtil.SM2Generate(ipctUtil.getCustId());
/**
* 第二步,请求交换密钥申请接口获取授权码。该操作仅系统第一次对接时需要进行,发送请求后需联系客户的云跨行管理员
* 在外部系统登记-授权码管理菜单中进行授权
* 参数系统名称sysNme与系统id sysId为客户云跨行管理员在外部系统登记-外部系统管理菜单中创建
*/
//ipctUtil.insertAuthCode(ipctUtil.getSysName(), ipctUtil.getSysId());
/**
* 第三步,交换非对称密钥对公钥,企业端上送第一步生成的公钥,银行端返回银行的公钥与对称密钥
* 调用ipct_safety包中的SM4类中的encryptErpSm4方法,对上送的公钥进行加密
* 再调用ipct_safety包中的SecretUtils类中的encrytErpSM4对报文体进行加密
*/
String
publicKey
=
"MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEmgNAWFeqOsjDyjZfAy9J+LPcldHt2M24eQ+AoRvHoxkg0j15r1FyesYCutSx9TfjbO3XD1LTL31oyMcWyKaWkw=="
;
String
authCode
=
"SW94B7ZP492J"
;
//ipctUtil.erpPubKeyChange(ipctUtil.getCustId(), publicKey, authCode);
//云跨行公钥及新对称密钥
String
sm2PublicKey
=
"MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEqqyqhXLF/DEw6GhVc6MhGnrwBFwVL0n7ck3eh2hGqzBt1qMJ8X0Yfk+WRg+1ttebTkEshrGC5VIxF0HBdOQ54A=="
;
//云跨行公钥
String
erpNewSymmetryKey
=
"OTNCVDNQWVo2VjA5"
;
//新对称密钥
//云跨行公钥:MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEqqyqhXLF/DEw6GhVc6MhGnrwBFwVL0n7ck3eh2hGqzBt1qMJ8X0Yfk+WRg+1ttebTkEshrGC5VIxF0HBdOQ54A==
//新对称密钥:OTNCVDNQWVo2VjA5
/**
* 第四步,调用系统登录接口进行登录,该操作每个自然日均需要进行,若不登录则无法进行业务交易
*/
//ipctUtil.erpLogin();
/**
* 第五步,调用业务接口
* 组装报文体后,需将报文体调用ipct_safety包中的SecretUtils类中的erpEncryptAndSign方法对报文体进行加密
* 收到返回报文后,需将响应体调用ipct_safety包中的SecretUtils类中的erpDecryptAndVerify方法对报文体进行解密
* @throws Exception
*/
Map
stdReqBody
=
new
HashMap
();
stdReqBody
.
put
(
"busNum"
,
"12340"
);
stdReqBody
.
put
(
"bsnId"
,
"1"
);
stdReqBody
.
put
(
"startDate"
,
"2042-11-16"
);
stdReqBody
.
put
(
"endDate"
,
"2042-11-16"
);
stdReqBody
.
put
(
"bankCd"
,
""
);
stdReqBody
.
put
(
"acctNo"
,
""
);
stdReqBody
.
put
(
"acctNoNme"
,
""
);
stdReqBody
.
put
(
"debitCdtFlg"
,
""
);
stdReqBody
.
put
(
"summary"
,
""
);
stdReqBody
.
put
(
"amtSort"
,
""
);
stdReqBody
.
put
(
"pageSize"
,
10
);
stdReqBody
.
put
(
"currentPage"
,
1
);
//客户私钥:
//当日明细查询 erpNewSymmetryKey:新对称密钥, sm2PrivateKey:客户方的私钥, publicKey:云跨行公钥 trCode:业务接口编号 参考交行文档
String
sm2PrivateKey
=
"MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgT9IzBq591GocYT7bxZPSW5S4xDLmeLG8zklsciINlT2gCgYIKoEcz1UBgi2hRANCAASaA0BYV6o6yMPKNl8DL0n4s9yV0e3Yzbh5D4ChG8ejGSDSPXmvUXJ6xgK61LH1N+Ns7dcPUtMvfWjIxxbIppaT"
;
ipctUtil
.
erpRequest
(
"C010100001"
,
erpNewSymmetryKey
,
sm2PrivateKey
,
publicKey
,
stdReqBody
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/util/IpctUtil.java
0 → 100644
View file @
690960df
This diff is collapsed.
Click to expand it.
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