Commit a5c7c0db authored by LSL's avatar LSL

浙农定时时间问题

parent 7c693b3b
...@@ -30,6 +30,7 @@ import java.math.BigDecimal; ...@@ -30,6 +30,7 @@ import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -63,9 +64,16 @@ public class BackedBurdenJob { ...@@ -63,9 +64,16 @@ public class BackedBurdenJob {
public void run() { public void run() {
String param = XxlJobHelper.getJobParam(); String param = XxlJobHelper.getJobParam();
Sftp sftp = new Sftp(sftpConfig.getSshHost(), sftpConfig.getSshPort(), sftpConfig.getSshUser(), sftpConfig.getSshPass(), 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 = "";
if (StringUtils.isNotEmpty(param)) { if (StringUtils.isNotEmpty(param)) {
date = param; date = param;
}else {
Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号
cal.setTime(new Date());
cal.add(Calendar.DAY_OF_MONTH, -1);
Date time = cal.getTime();
date = DateUtil.format(time, "yyyyMMdd");
} }
if (sftp.isDir("/download/assurance/" + date)) { if (sftp.isDir("/download/assurance/" + date)) {
sftp.cd("/download/assurance/" + date); sftp.cd("/download/assurance/" + date);
...@@ -234,8 +242,4 @@ public class BackedBurdenJob { ...@@ -234,8 +242,4 @@ public class BackedBurdenJob {
loanComponent.updateByLoanNo(loanModel); loanComponent.updateByLoanNo(loanModel);
} }
public static void main(String[] args) {
}
} }
...@@ -19,6 +19,7 @@ import org.springframework.stereotype.Component; ...@@ -19,6 +19,7 @@ import org.springframework.stereotype.Component;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -42,9 +43,16 @@ public class RedeemJob { ...@@ -42,9 +43,16 @@ public class RedeemJob {
public void run() { public void run() {
String param = XxlJobHelper.getJobParam(); String param = XxlJobHelper.getJobParam();
Sftp sftp = new Sftp(sftpConfig.getSshHost(), sftpConfig.getSshPort(), sftpConfig.getSshUser(), sftpConfig.getSshPass(), 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 = "";
if (StringUtils.isNotEmpty(param)) { if (StringUtils.isNotEmpty(param)) {
date = param; date = param;
}else {
Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号
cal.setTime(new Date());
cal.add(Calendar.DAY_OF_MONTH, -1);
Date time = cal.getTime();
date = DateUtil.format(time, "yyyyMMdd");
} }
if (sftp.isDir("/download/compensatory/" + date)) { if (sftp.isDir("/download/compensatory/" + date)) {
sftp.cd("/download/compensatory/" + date); sftp.cd("/download/compensatory/" + date);
......
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