Commit 12fd1ec9 authored by huyuchen's avatar huyuchen

huych-工行回单下载

parent 492b6c4f
...@@ -8,6 +8,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -8,6 +8,8 @@ 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;
/** /**
* 聚富通代发工资相关 * 聚富通代发工资相关
...@@ -75,6 +77,6 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo> ...@@ -75,6 +77,6 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
**/ **/
R<String> doGetEkpBankStatus(); R<String> doGetEkpBankStatus();
R getPdfFile(); R getPdfFile() throws IOException, URISyntaxException;
} }
...@@ -33,6 +33,7 @@ import lombok.extern.log4j.Log4j2; ...@@ -33,6 +33,7 @@ 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;
...@@ -42,6 +43,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -42,6 +43,7 @@ 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;
...@@ -1049,7 +1051,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -1049,7 +1051,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
* @Date: 2025/5/19 17:36 * @Date: 2025/5/19 17:36
**/ **/
@Override @Override
public R getPdfFile() { public R getPdfFile() throws IOException, URISyntaxException {
// 工商银行SFTP服务器地址 // 工商银行SFTP服务器地址
String host = "gw.open.icbc.com.cn"; String host = "gw.open.icbc.com.cn";
// 工商银行SFTP服务器端口 // 工商银行SFTP服务器端口
...@@ -1060,10 +1062,19 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -1060,10 +1062,19 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
//String privateKeyPath = "D:/icbcFile/icbc"; // 替换为你的私钥路径 //String privateKeyPath = "D:/icbcFile/icbc"; // 替换为你的私钥路径
//usr/lib/java/yifu-ekp-biz/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/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 = "/data/yifu/crm/code/yifu_mvp/yifu/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/icbc"; String privateKeyPath = "";
String privateKeyPath1 = "";
//System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/icbc/icbc"; // 远程目录路径 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";
// 远程目录路径
log.info("秘钥文件目录: " + privateKeyPath); log.info("秘钥文件目录: " + privateKeyPath);
log.info("秘钥文件目录1: " + privateKeyPath1);
// 远程目录路径 // 远程目录路径
String remoteDir = "/JFTStatementDownload/download"; String remoteDir = "/JFTStatementDownload/download";
Session session = null; Session session = null;
...@@ -1125,7 +1136,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -1125,7 +1136,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
} }
// 3. 创建临时目录 // 3. 创建临时目录
String tempDir = "/data/yifu/crm/code/yifu_mvp/yifu/yifu-ekp/yifu-ekp-biz/src/main/resources/tem/sftp_processing/" + System.currentTimeMillis() + "/"; String tempDir = "/resources/tem/sftp_processing/" + System.currentTimeMillis() + "/";
log.info("临时目录: " + privateKeyPath); log.info("临时目录: " + privateKeyPath);
//System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/tem/sftp_processing/" + System.currentTimeMillis() + "/"; //System.getProperty("user.dir") + "/yifu-ekp/yifu-ekp-biz/src/main/resources/tem/sftp_processing/" + System.currentTimeMillis() + "/";
new File(tempDir).mkdirs(); new File(tempDir).mkdirs();
......
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