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
3fb932ae
Commit
3fb932ae
authored
May 27, 2025
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huych-工行回单下载
parent
b1f989e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
IcbcTransactionFlowIssueController.java
...v1/ekp/controller/IcbcTransactionFlowIssueController.java
+2
-2
IcbcTransactionFlowIssueService.java
.../plus/v1/ekp/service/IcbcTransactionFlowIssueService.java
+2
-1
IcbcTransactionFlowIssueServiceImpl.java
...ekp/service/impl/IcbcTransactionFlowIssueServiceImpl.java
+23
-5
No files found.
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/controller/IcbcTransactionFlowIssueController.java
View file @
3fb932ae
...
...
@@ -141,13 +141,13 @@ public class IcbcTransactionFlowIssueController {
@Operation
(
summary
=
"定时任务获取回单文件"
,
description
=
"定时任务获取回单文件"
)
@Inner
@PostMapping
(
"/inner/getPdfFile"
)
public
R
getPdfFile
(){
public
R
getPdfFile
()
throws
IOException
{
return
icbcTransactionFlowIssueService
.
getPdfFile
();
}
@Operation
(
summary
=
"定时任务获取回单文件"
,
description
=
"定时任务获取回单文件"
)
@PostMapping
(
"/getTestPdfFile"
)
public
R
getPdfFileTest
()
{
public
R
getPdfFileTest
()
throws
IOException
{
return
icbcTransactionFlowIssueService
.
getPdfFile
();
}
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/IcbcTransactionFlowIssueService.java
View file @
3fb932ae
...
...
@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* 聚富通代发工资相关
...
...
@@ -75,6 +76,6 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
**/
R
<
String
>
doGetEkpBankStatus
();
R
getPdfFile
();
R
getPdfFile
()
throws
IOException
;
}
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/IcbcTransactionFlowIssueServiceImpl.java
View file @
3fb932ae
...
...
@@ -1049,7 +1049,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @Date: 2025/5/19 17:36
**/
@Override
public
R
getPdfFile
(){
public
R
getPdfFile
()
throws
IOException
{
// 工商银行SFTP服务器地址
String
host
=
"gw.open.icbc.com.cn"
;
// 工商银行SFTP服务器端口
...
...
@@ -1059,8 +1059,24 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 私钥路径(用于身份验证)
//E:\IdeaProjects\yifu_mvp\yifu-ekp\yifu-ekp-biz\src\main\resources\icbc\icbc
String
privateKeyPath
=
""
;
URL
url
=
getClass
().
getClassLoader
().
getResource
(
"icbc"
);
privateKeyPath
=
url
.
getPath
();
// URL url = getClass().getClassLoader().getResource("icbc");
InputStream
inputStream
=
getClass
().
getClassLoader
().
getResourceAsStream
(
"icbc"
);
if
(
inputStream
==
null
)
{
throw
new
FileNotFoundException
(
"资源未找到"
);
}
File
tempFile
=
File
.
createTempFile
(
"temp-"
,
".tmp"
);
tempFile
.
deleteOnExit
();
// JVM退出时删除临时文件
try
(
FileOutputStream
out
=
new
FileOutputStream
(
tempFile
))
{
byte
[]
buffer
=
new
byte
[
1024
];
int
bytesRead
;
while
((
bytesRead
=
inputStream
.
read
(
buffer
))
!=
-
1
)
{
out
.
write
(
buffer
,
0
,
bytesRead
);
}
}
privateKeyPath
=
tempFile
.
getAbsolutePath
();
// privateKeyPath = url.getPath();
// 远程目录路径
log
.
info
(
"秘钥文件目录: "
+
privateKeyPath
);
...
...
@@ -1125,8 +1141,10 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
// 3. 创建临时目录 System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/tem/sftp_processing/" + System.currentTimeMillis() + "/";
String
tempDir
=
privateKeyPath
.
replace
(
"/icbc"
,
""
)
+
"/temp/sftp_processing/"
+
System
.
currentTimeMillis
()
+
"/"
;
log
.
info
(
"临时目录: "
+
privateKeyPath
);
String
tempDir
=
privateKeyPath
+
"/tem/sftp_processing/"
+
System
.
currentTimeMillis
()
+
"/"
;
// String tempDir = System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/temp/sftp_processing/" + System.currentTimeMillis() + "/";
log
.
info
(
"临时目录: "
+
tempDir
);
new
File
(
tempDir
).
mkdirs
();
// 4. 下载并解压压缩包
...
...
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