Commit 3d57f045 authored by LSL's avatar LSL

结清默认结清账单

parent 15e02931
......@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
......@@ -65,8 +66,7 @@ public class BackedBurdenJob {
sftp.cd("/download/assurance/" + date);
sftp.get("assurance_" + date + ".txt", "/assurance_sftp.txt");
ossUtils.ossUpload("ZN/assurance/" + "assurance_" + date + ".txt", FileUtil.file("/assurance_sftp.txt"));
FileUtil.del("/assurance_sftp.txt");
String stringObject = ossUtils.getStringObject("ZN/assurance/" + "assurance_" + date + ".txt");
String stringObject = getStringObject("ZN/assurance/" + "assurance_" + date + ".txt");
log.info("oss融担数据:{}", stringObject);
//存储并去平账
List<BurdenModel> getlist = getlist(stringObject);
......@@ -74,12 +74,23 @@ public class BackedBurdenJob {
backedBurdenComponent.insert(model);
backedBurden(model);
}
FileUtil.del("/assurance_sftp.txt");
} else {
log.info("浙农融担文件不存在:{}", date);
}
}
public String getStringObject(String uri) {
byte[] bytes = new byte[0];
try {
bytes = ossUtils.ossDownLoad(uri);
} catch (IOException e) {
e.printStackTrace();
}
return new String(bytes);
}
/**
* 组装还融担的全部model
......@@ -221,4 +232,8 @@ public class BackedBurdenJob {
loanComponent.updateByLoanNo(loanModel);
}
public static void main(String[] args) {
}
}
......@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -45,16 +46,27 @@ public class RedeemJob {
sftp.cd("/download/compensatory/" + date);
sftp.get("compensatory_" + date + ".txt", "/compensatory_sftp.txt");
ossUtils.ossUpload("ZN/compensatory/" + "compensatory_" + date + ".txt", FileUtil.file("/compensatory_sftp.txt"));
FileUtil.del("/compensatory_sftp.txt");
String stringObject = ossUtils.getStringObject("ZN/compensatory/" + "compensatory_" + date + ".txt");
String stringObject = getStringObject("ZN/compensatory/" + "compensatory_" + date + ".txt");
log.info("oss代偿数据:{}", stringObject);
redeemComponent.insert(getlist(stringObject));
FileUtil.del("/compensatory_sftp.txt");
} else {
log.info("浙农代偿文件不存在:{}", date);
}
}
public String getStringObject(String uri) {
byte[] bytes = new byte[0];
try {
bytes = ossUtils.ossDownLoad(uri);
} catch (IOException e) {
e.printStackTrace();
}
return new String(bytes);
}
/**
* 封装model
*
......
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