Commit 0c178c61 authored by LSL's avatar LSL

浙农中际融担协议

parent 248e162f
......@@ -72,7 +72,7 @@ public class ContractJob {
if (sftp.isDir(dir)) {
List<String> list = sftp.lsDirs(dir);
for (String loanNo : list) {
uploadProtocolPdf(loanNo, sftp, dir);
uploadProtocolPdf(loanNo, sftp, dir, date);
}
}
} catch (Exception e) {
......@@ -84,22 +84,22 @@ public class ContractJob {
}
public void uploadProtocolPdf(String loanNo, Sftp sftp, String dir) {
public void uploadProtocolPdf(String loanNo, Sftp sftp, String dir, String date) {
List<String> list = sftp.lsFiles(dir + "/" + loanNo);
for (String fileName : list) {
//只拿以 jkfwxy.pdf 结尾的文件
if (fileName.indexOf(suffix) != -1) {
String url = getUrl(dir + "/" + loanNo + "/" + fileName, sftp, fileName);
String url = getUrl(dir + "/" + loanNo + "/" + fileName, sftp, fileName, date);
getUploadPdfRequest(url, loanNo);
}
}
}
public String getUrl(String dir, Sftp sftp, String fileName) {
public String getUrl(String dir, Sftp sftp, String fileName, String date) {
sftp.get(dir, "/" + fileName);
ossUtils.ossUpload(ossPath + fileName, FileUtil.file("/" + fileName));
ossUtils.ossUpload(ossPath + date + fileName, FileUtil.file("/" + fileName));
FileUtil.del("/" + fileName);
return privateDomain + ossPath + fileName;
return privateDomain + ossPath + date + fileName;
}
public UploadPdfRequest getUploadPdfRequest(String url, String loanNo) {
......
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