Commit 0158f1c5 authored by huyuchen's avatar huyuchen

huych-工行回单下载

parent 9689bbdb
......@@ -141,13 +141,13 @@ public class IcbcTransactionFlowIssueController {
@Operation(summary = "定时任务获取回单文件", description = "定时任务获取回单文件")
@Inner
@PostMapping("/inner/getPdfFile")
public R getPdfFile() throws IOException, URISyntaxException {
public R getPdfFile(){
return icbcTransactionFlowIssueService.getPdfFile();
}
@Operation(summary = "定时任务获取回单文件", description = "定时任务获取回单文件")
@PostMapping("/getTestPdfFile")
public R getPdfFileTest() throws IOException, URISyntaxException {
public R getPdfFileTest() {
return icbcTransactionFlowIssueService.getPdfFile();
}
}
......@@ -8,8 +8,6 @@ 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;
import java.net.URISyntaxException;
/**
* 聚富通代发工资相关
......@@ -77,6 +75,6 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
**/
R<String> doGetEkpBankStatus();
R getPdfFile() throws IOException, URISyntaxException;
R getPdfFile();
}
......@@ -33,7 +33,6 @@ import lombok.extern.log4j.Log4j2;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -43,7 +42,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
......@@ -1051,7 +1049,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @Date: 2025/5/19 17:36
**/
@Override
public R getPdfFile() throws IOException, URISyntaxException {
public R getPdfFile(){
// 工商银行SFTP服务器地址
String host = "gw.open.icbc.com.cn";
// 工商银行SFTP服务器端口
......@@ -1059,22 +1057,17 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
// 登录用户名
String username = "wxrl";
// 私钥路径(用于身份验证)
//String privateKeyPath = "D:/icbcFile/icbc"; // 替换为你的私钥路径
//usr/lib/java/yifu-ekp-biz/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/icbc
//E:\IdeaProjects\yifu_mvp\yifu-ekp\yifu-ekp-biz\src\main\resources\icbc\icbc
String privateKeyPath = "";
String privateKeyPath1 = "";
ClassPathResource resource = new ClassPathResource("icbc/icbc");
URL url = resource.getURL();
// 如果是在IDE或文件系统中运行,转换为文件路径
if (url.getProtocol().equals("file")) {
privateKeyPath = new File(url.toURI()).getAbsolutePath();
}
//System.getProperty("icbc.config.path", "/data/yifu/crm/code/yifu_mvp/yifu/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/icbc");
privateKeyPath1 = System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/icbc";
String privateKeyPath2 = "";
privateKeyPath = System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/icbc";
privateKeyPath1 = this.getClass().getResource("/icbc/icbc").getPath();
privateKeyPath2 = System.getProperty("icbc.dir");
// 远程目录路径
log.info("秘钥文件目录: " + privateKeyPath);
log.info("秘钥文件目录1: " + privateKeyPath1);
log.info("秘钥文件目录1: " + privateKeyPath2);
// 远程目录路径
String remoteDir = "/JFTStatementDownload/download";
Session session = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment