Commit b0a2760f authored by BlackJokerCJ's avatar BlackJokerCJ

Merge remote-tracking branch 'origin/master'

parents 589ff11b 8b4d5033
...@@ -3,6 +3,7 @@ package com.jqtx.windows.component.impl; ...@@ -3,6 +3,7 @@ package com.jqtx.windows.component.impl;
import cn.hutool.extra.cglib.CglibUtil; import cn.hutool.extra.cglib.CglibUtil;
import com.jqtx.windows.component.RedeemComponent; import com.jqtx.windows.component.RedeemComponent;
import com.jqtx.windows.component.model.RedeemModel; import com.jqtx.windows.component.model.RedeemModel;
import com.jqtx.windows.repository.entity.WindowsBurden;
import com.jqtx.windows.repository.entity.WindowsRedeem; import com.jqtx.windows.repository.entity.WindowsRedeem;
import com.jqtx.windows.repository.mapper.WindowsRedeemMapper; import com.jqtx.windows.repository.mapper.WindowsRedeemMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,7 +19,7 @@ public class RedeemComponentImpl implements RedeemComponent { ...@@ -18,7 +19,7 @@ public class RedeemComponentImpl implements RedeemComponent {
@Override @Override
public void insert(List<RedeemModel> models) { public void insert(List<RedeemModel> models) {
models.stream().map(e -> windowsRedeemMapper.insert(CglibUtil.copy(e, WindowsRedeem.class))); models.forEach(e -> windowsRedeemMapper.insert(CglibUtil.copy(e, WindowsRedeem.class)));
} }
} }
...@@ -6,16 +6,20 @@ import cn.hutool.core.util.CharsetUtil; ...@@ -6,16 +6,20 @@ 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.snow.SnowSequenceHelper; import com.jqtx.windows.common.config.snow.SnowSequenceHelper;
import com.jqtx.windows.component.BackedDetailComponent;
import com.jqtx.windows.component.LoanComponent; import com.jqtx.windows.component.LoanComponent;
import com.jqtx.windows.component.LoanPlanComponent; import com.jqtx.windows.component.LoanPlanComponent;
import com.jqtx.windows.component.LoanRepayComponent;
import com.jqtx.windows.component.enums.LoanStatusEnum; import com.jqtx.windows.component.enums.LoanStatusEnum;
import com.jqtx.windows.component.impl.BackedBurdenComponentImpl; import com.jqtx.windows.component.impl.BackedBurdenComponentImpl;
import com.jqtx.windows.component.model.*; import com.jqtx.windows.component.model.*;
import com.jqtx.windows.infrastructure.feign.enums.DebtInfoStatusEnum; import com.jqtx.windows.infrastructure.feign.enums.DebtInfoStatusEnum;
import com.jqtx.windows.infrastructure.feign.enums.DebtPlanStatusEnum; import com.jqtx.windows.infrastructure.feign.enums.DebtPlanStatusEnum;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -42,21 +46,36 @@ public class BackedBurdenJob { ...@@ -42,21 +46,36 @@ public class BackedBurdenJob {
@Autowired @Autowired
private LoanComponent loanComponent; private LoanComponent loanComponent;
@Autowired
private LoanRepayComponent loanRepayComponent;
@Autowired
private BackedDetailComponent backedDetailComponent;
@XxlJob("backedBurdenJob") @XxlJob("backedBurdenJob")
public void run() { public void run() {
String param = XxlJobHelper.getJobParam();
Sftp sftp = new Sftp("115.238.89.106", 9901, "xiaohua_fr", "R7MADMx1lwMN5k4v", CharsetUtil.CHARSET_UTF_8); Sftp sftp = new Sftp("115.238.89.106", 9901, "xiaohua_fr", "R7MADMx1lwMN5k4v", CharsetUtil.CHARSET_UTF_8);
String date = DateUtil.format(new Date(), "yyyyMMdd"); String date = DateUtil.format(new Date(), "yyyyMMdd");
sftp.cd("/download/assurance/" + date); if (StringUtils.isNotEmpty(param)) {
sftp.get("assurance_" + date + ".txt", "/assurance_sftp.txt"); date = param;
ossUtils.ossUpload("ZN/assurance_/" + "assurance_" + date + ".txt", FileUtil.file("/assurance_sftp.txt")); }
FileUtil.del("/sftp.txt"); if (sftp.isDir("/download/assurance/" + date)) {
String stringObject = ossUtils.getStringObject("ZN/assurance_/" + "assurance_" + date + ".txt"); sftp.cd("/download/assurance/" + date);
log.info("date:{}", stringObject); sftp.get("assurance_" + date + ".txt", "/assurance_sftp.txt");
//存储并去平账 ossUtils.ossUpload("ZN/assurance_/" + "assurance_" + date + ".txt", FileUtil.file("/assurance_sftp.txt"));
List<BurdenModel> getlist = getlist(stringObject); FileUtil.del("/assurance_sftp.txt");
for (BurdenModel model : getlist) { String stringObject = ossUtils.getStringObject("ZN/assurance_/" + "assurance_" + date + ".txt");
backedBurdenComponent.insert(model); log.info("oss融担数据:{}", stringObject);
//存储并去平账
List<BurdenModel> getlist = getlist(stringObject);
for (BurdenModel model : getlist) {
backedBurdenComponent.insert(model);
backedBurden(model);
}
} else {
log.info("浙农融担文件不存在:{}", date);
} }
} }
...@@ -118,6 +137,8 @@ public class BackedBurdenJob { ...@@ -118,6 +137,8 @@ public class BackedBurdenJob {
//修改 windows_loan 还款状态 //修改 windows_loan 还款状态
LoanModel loanModel = loanComponent.getByLoanNo(model.getLoanNo()); LoanModel loanModel = loanComponent.getByLoanNo(model.getLoanNo());
upWindowsLoan(loanModel); upWindowsLoan(loanModel);
loanRepayComponent.insert(repayModel);
backedDetailComponent.insert(backedDetailModel);
} }
/** /**
......
...@@ -5,10 +5,14 @@ import cn.hutool.core.io.FileUtil; ...@@ -5,10 +5,14 @@ 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.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.RedeemModel; import com.jqtx.windows.component.model.RedeemModel;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -19,28 +23,41 @@ import java.util.List; ...@@ -19,28 +23,41 @@ import java.util.List;
@Component @Component
@Slf4j @Slf4j
public class RedeemJob { public class RedeemJob {
@Autowired @Autowired
private OssUtils ossUtils; private OssUtils ossUtils;
@Autowired
private LoanPlanComponent loanPlanComponent;
@Autowired @Autowired
private RedeemComponent redeemComponent; private RedeemComponent redeemComponent;
@XxlJob("redeemJob") @XxlJob("redeemJob")
public void run() { public void run() {
String param = XxlJobHelper.getJobParam();
Sftp sftp = new Sftp("115.238.89.106", 9901, "xiaohua_fr", "R7MADMx1lwMN5k4v", CharsetUtil.CHARSET_UTF_8); Sftp sftp = new Sftp("115.238.89.106", 9901, "xiaohua_fr", "R7MADMx1lwMN5k4v", CharsetUtil.CHARSET_UTF_8);
String date = DateUtil.format(new Date(), "yyyyMMdd"); String date = DateUtil.format(new Date(), "yyyyMMdd");
sftp.cd("/download/compensatory/" + date); if (StringUtils.isNotEmpty(param)) {
sftp.get("compensatory_" + date + ".txt", "/compensatory_sftp.txt"); date = param;
ossUtils.ossUpload("ZN/compensatory/" + "compensatory_" + date + ".txt", FileUtil.file("/compensatory_sftp.txt")); }
FileUtil.del("/sftp.txt"); if (sftp.isDir("/download/compensatory/" + date)) {
String stringObject = ossUtils.getStringObject("ZN/compensatory/" + "compensatory_" + date + ".txt"); sftp.cd("/download/compensatory/" + date);
log.info("date:{}", stringObject); sftp.get("compensatory_" + date + ".txt", "/compensatory_sftp.txt");
redeemComponent.insert(getlist(stringObject)); 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");
log.info("oss代偿数据:{}", stringObject);
redeemComponent.insert(getlist(stringObject));
} else {
log.info("浙农代偿文件不存在:{}", date);
}
} }
/** /**
* 封装model * 封装model
*
* @param jsonResult * @param jsonResult
* @return * @return
*/ */
...@@ -54,6 +71,7 @@ public class RedeemJob { ...@@ -54,6 +71,7 @@ public class RedeemJob {
String[] split1 = modelstr.split("\\|"); String[] split1 = modelstr.split("\\|");
RedeemModel model = new RedeemModel(); RedeemModel model = new RedeemModel();
model.setLoanNo(split1[0]); model.setLoanNo(split1[0]);
model.setPlanNo(getPlanNo(split1[0], split1[2]));
model.setRedeemType(split1[1]); model.setRedeemType(split1[1]);
model.setPlanIndex(split1[2]); model.setPlanIndex(split1[2]);
model.setRaiseTime(split1[3]); model.setRaiseTime(split1[3]);
...@@ -68,4 +86,16 @@ public class RedeemJob { ...@@ -68,4 +86,16 @@ public class RedeemJob {
return list; return list;
} }
/**
* 获取planNo
*
* @param loanNo
* @param planIndex
* @return
*/
private String getPlanNo(String loanNo, String planIndex) {
LoanPlanModel planModel = loanPlanComponent.getPlanNoByLoan(loanNo, planIndex);
return planModel.getPlanNo();
}
} }
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