Commit 0158f1c5 authored by huyuchen's avatar huyuchen

huych-工行回单下载

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