Commit 23f1c6cf authored by LSL's avatar LSL

浙农sftp配置

parent 73e78749
package com.jqtx.windows.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "sftpconfig")
public class SftpConfig {
private String sshHost;
private int sshPort;
private String sshUser;
private String sshPass;
}
...@@ -5,6 +5,8 @@ import cn.hutool.core.io.FileUtil; ...@@ -5,6 +5,8 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.CharsetUtil;
import cn.hutool.extra.ssh.Sftp; import cn.hutool.extra.ssh.Sftp;
import com.jqtx.infrastructure.oss.starter.config.OssUtils; import com.jqtx.infrastructure.oss.starter.config.OssUtils;
import com.jqtx.windows.common.config.BaseConfig;
import com.jqtx.windows.common.config.SftpConfig;
import com.jqtx.windows.common.config.snow.SnowSequenceHelper; import com.jqtx.windows.common.config.snow.SnowSequenceHelper;
import com.jqtx.windows.component.BackedDetailComponent; import com.jqtx.windows.component.BackedDetailComponent;
import com.jqtx.windows.component.LoanComponent; import com.jqtx.windows.component.LoanComponent;
...@@ -53,11 +55,14 @@ public class BackedBurdenJob { ...@@ -53,11 +55,14 @@ public class BackedBurdenJob {
@Autowired @Autowired
private BackedDetailComponent backedDetailComponent; private BackedDetailComponent backedDetailComponent;
@Autowired
private SftpConfig sftpConfig;
@XxlJob("backedBurdenJob") @XxlJob("backedBurdenJob")
public void run() { public void run() {
String param = XxlJobHelper.getJobParam(); String param = XxlJobHelper.getJobParam();
Sftp sftp = new Sftp("115.238.89.106", 9901, "xiaohua_fr", "R7MADMx1lwMN5k4v", CharsetUtil.CHARSET_UTF_8); Sftp sftp = new Sftp(sftpConfig.getSshHost(), sftpConfig.getSshPort(), sftpConfig.getSshUser(), sftpConfig.getSshPass(), CharsetUtil.CHARSET_UTF_8);
String date = DateUtil.format(new Date(), "yyyyMMdd"); String date = DateUtil.format(new Date(), "yyyyMMdd");
if (StringUtils.isNotEmpty(param)) { if (StringUtils.isNotEmpty(param)) {
date = param; date = param;
......
...@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.CharsetUtil;
import cn.hutool.extra.ssh.Sftp; import cn.hutool.extra.ssh.Sftp;
import com.jqtx.infrastructure.oss.starter.config.OssUtils; import com.jqtx.infrastructure.oss.starter.config.OssUtils;
import com.jqtx.windows.common.config.SftpConfig;
import com.jqtx.windows.component.LoanPlanComponent; import com.jqtx.windows.component.LoanPlanComponent;
import com.jqtx.windows.component.RedeemComponent; import com.jqtx.windows.component.RedeemComponent;
import com.jqtx.windows.component.model.LoanPlanModel; import com.jqtx.windows.component.model.LoanPlanModel;
...@@ -34,10 +35,13 @@ public class RedeemJob { ...@@ -34,10 +35,13 @@ public class RedeemJob {
@Autowired @Autowired
private RedeemComponent redeemComponent; private RedeemComponent redeemComponent;
@Autowired
private SftpConfig sftpConfig;
@XxlJob("redeemJob") @XxlJob("redeemJob")
public void run() { public void run() {
String param = XxlJobHelper.getJobParam(); String param = XxlJobHelper.getJobParam();
Sftp sftp = new Sftp("115.238.89.106", 9901, "xiaohua_fr", "R7MADMx1lwMN5k4v", CharsetUtil.CHARSET_UTF_8); Sftp sftp = new Sftp(sftpConfig.getSshHost(), sftpConfig.getSshPort(), sftpConfig.getSshUser(), sftpConfig.getSshPass(), CharsetUtil.CHARSET_UTF_8);
String date = DateUtil.format(new Date(), "yyyyMMdd"); String date = DateUtil.format(new Date(), "yyyyMMdd");
if (StringUtils.isNotEmpty(param)) { if (StringUtils.isNotEmpty(param)) {
date = param; date = param;
......
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