Commit 0a903dfd authored by LSL's avatar LSL

浙农定时时间问题

parent a5c7c0db
...@@ -5,7 +5,6 @@ import cn.hutool.core.io.FileUtil; ...@@ -5,7 +5,6 @@ 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.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;
...@@ -64,10 +63,11 @@ public class BackedBurdenJob { ...@@ -64,10 +63,11 @@ 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);
try {
String date = ""; String date = "";
if (StringUtils.isNotEmpty(param)) { if (StringUtils.isNotEmpty(param)) {
date = param; date = param;
}else { } else {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号 //获取前面的时间用-负号
cal.setTime(new Date()); cal.setTime(new Date());
...@@ -84,7 +84,7 @@ public class BackedBurdenJob { ...@@ -84,7 +84,7 @@ public class BackedBurdenJob {
//存储并去平账 //存储并去平账
List<BurdenModel> getlist = getlist(stringObject); List<BurdenModel> getlist = getlist(stringObject);
for (BurdenModel model : getlist) { for (BurdenModel model : getlist) {
if (new BigDecimal(model.getPepayBurden()).compareTo(BigDecimal.ZERO) > 0 ) { if (new BigDecimal(model.getPepayBurden()).compareTo(BigDecimal.ZERO) > 0) {
backedBurdenComponent.insert(model); backedBurdenComponent.insert(model);
backedBurden(model); backedBurden(model);
} }
...@@ -93,7 +93,12 @@ public class BackedBurdenJob { ...@@ -93,7 +93,12 @@ public class BackedBurdenJob {
} else { } else {
log.info("浙农融担文件不存在:{}", date); log.info("浙农融担文件不存在:{}", date);
} }
} catch (Exception e) {
log.info("浙农代偿错误:{}", e.getMessage());
} finally {
//关闭sftp连接
sftp.close();
}
} }
public String getStringObject(String uri) { public String getStringObject(String uri) {
......
...@@ -43,10 +43,11 @@ public class RedeemJob { ...@@ -43,10 +43,11 @@ 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);
try {
String date = ""; String date = "";
if (StringUtils.isNotEmpty(param)) { if (StringUtils.isNotEmpty(param)) {
date = param; date = param;
}else { } else {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号 //获取前面的时间用-负号
cal.setTime(new Date()); cal.setTime(new Date());
...@@ -65,6 +66,12 @@ public class RedeemJob { ...@@ -65,6 +66,12 @@ public class RedeemJob {
} else { } else {
log.info("浙农代偿文件不存在:{}", date); log.info("浙农代偿文件不存在:{}", date);
} }
} catch (Exception e) {
log.info("浙农代偿错误:{}", e.getMessage());
} finally {
//关闭sftp连接
sftp.close();
}
} }
......
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