Browse Source

Merge remote-tracking branch 'origin/master'

master
God 7 months ago
parent
commit
510bf74404
  1. 62
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java
  2. 22
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansettleapply/LoanSettleApplyService.java

62
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java

@ -626,6 +626,8 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
ResultBean rb = ResultBean.fireFail();
//保存还款记录
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Set<String> setMsg = new HashSet<>();
StringBuffer sb = new StringBuffer();
if (!dto.isEmpty()) {
for (RepaymentExcelInfo repaymentExcelInfo : dto) {
List<LoanRepaymentPlanDetails> planDetails = loanRepaymentPlanDetailsService.selPlanByNoAndPeriod(repaymentExcelInfo.getBankContractNo(), repaymentExcelInfo.getPeriod());
@ -639,25 +641,44 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
check = loanRepaymentPlanDetailsService.InsertForCheckPaymentAndBankOther(planDetail.getSid());
}
if (StringUtils.isNotBlank(check)) {
if (!check.equals("0")) {
LoanRepaymentHistory repaymentHistory = new LoanRepaymentHistory();
repaymentHistory.setBuckle("未申请");
repaymentHistory.setBuckleKey("001");
repaymentHistory.setScheduleSid(planDetail.getScheduleSid());
repaymentHistory.setPlanDetailSid(planDetail.getSid());
repaymentHistory.setReturnWay("直还");
repaymentHistory.setReturnWayKey("01");
try {
repaymentHistory.setActualDate(sdf.parse(repaymentExcelInfo.getRealReturnTime()));
} catch (ParseException e) {
e.printStackTrace();
}
BigDecimal realMoney = new BigDecimal(repaymentExcelInfo.getRealMoney());
BigDecimal divide = realMoney.divide(new BigDecimal(planDetails.size()), 2, BigDecimal.ROUND_HALF_UP);
repaymentHistory.setActualMoney(divide);
repaymentHistory.setDataTime(new DateTime());
baseMapper.insert(repaymentHistory);
if (check.equals("0")) {
setMsg.add("资方合同号" + planDetail.getBankContractNo() + "第" + planDetail.getPeriod() + "期");
}
}
}
}
}
if (setMsg.size() > 0) {
for (String s : setMsg) {
sb.append(s).append("、");
}
if (sb.length() > 0) {
sb.delete(sb.length() - 1, sb.length());
}
sb.append("为非退还垫款导入直还数据,导入失败!");
return rb.setMsg(sb.toString());
} else {
for (RepaymentExcelInfo repaymentExcelInfo : dto) {
List<LoanRepaymentPlanDetails> planDetails = loanRepaymentPlanDetailsService.selPlanByNoAndPeriod(repaymentExcelInfo.getBankContractNo(), repaymentExcelInfo.getPeriod());
if (!planDetails.isEmpty()) {
for (LoanRepaymentPlanDetails planDetail : planDetails) {
LoanRepaymentHistory repaymentHistory = new LoanRepaymentHistory();
repaymentHistory.setBuckle("未申请");
repaymentHistory.setBuckleKey("001");
repaymentHistory.setScheduleSid(planDetail.getScheduleSid());
repaymentHistory.setPlanDetailSid(planDetail.getSid());
repaymentHistory.setReturnWay("直还");
repaymentHistory.setReturnWayKey("01");
try {
repaymentHistory.setActualDate(sdf.parse(repaymentExcelInfo.getRealReturnTime()));
} catch (ParseException e) {
e.printStackTrace();
}
BigDecimal realMoney = new BigDecimal(repaymentExcelInfo.getRealMoney());
BigDecimal divide = realMoney.divide(new BigDecimal(planDetails.size()), 2, BigDecimal.ROUND_HALF_UP);
repaymentHistory.setActualMoney(divide);
repaymentHistory.setDataTime(new DateTime());
baseMapper.insert(repaymentHistory);
}
}
}
@ -806,7 +827,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
String isOther = loanRepaymentScheduleService.returnBankOrOtherBankByPlanSid(pSid).getData();
String reAdvances = "";
if (isOther.equals("0")) {
reAdvances = loanRepaymentPlanDetailsService.reAdvancesOrPaymentMoney(pSid);
reAdvances = loanRepaymentPlanDetailsService.reAdvancesOrPaymentMoney(pSid);
} else if (isOther.equals("1")) {
reAdvances = loanRepaymentPlanDetailsService.reAdvancesOrPaymentMoneyOther(pSid);
}
@ -1817,7 +1838,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
}
public List<RecordCountVo> exportStatisticsExcel(RepaymentStatisticsQuery pagerQuery) {
QueryWrapper<LoanRepaymentHistory> qw = new QueryWrapper<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@ -2304,6 +2324,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
}
public List<AppRepaymentHistoryRecord> selSchSidAndVinNo(String scheduleSid, String vinNo) {
return baseMapper.selSchSidAndVinNo(scheduleSid,vinNo);
return baseMapper.selSchSidAndVinNo(scheduleSid, vinNo);
}
}

22
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansettleapply/LoanSettleApplyService.java

@ -974,7 +974,7 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
//设置认款月还为已转付
updatePaymentStateByBusVinSid(loanSettleApply.getBusVinSid());
//推送财务凭证
pushSettleVoucher(loanSettleApply,check,actualDeposit);
pushSettleVoucher(loanSettleApply, check, actualDeposit);
}
baseMapper.updateById(loanSettleApply);
} else {
@ -1638,7 +1638,7 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
}
//--------推送财务结清凭证------------------
private void pushSettleVoucher(LoanSettleApply loanSettleApply,int check,BigDecimal actualDeposit) {
private void pushSettleVoucher(LoanSettleApply loanSettleApply, int check, BigDecimal actualDeposit) {
String sid = loanSettleApply.getSid();
LoanSettleCompanyCost companyCost = loanSettleCompanyCostService.selectByMainSid(sid);
LoanSettleCompanyReduction reduction = loanSettleCompanyReductionService.selectByMainSid(sid);
@ -2896,7 +2896,7 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
//设置认款月还为已转付
updatePaymentStateByBusVinSid(loanSettleApply.getBusVinSid());
//推送财务凭证
pushSettleVoucher(loanSettleApply,1,actualDeposit);
pushSettleVoucher(loanSettleApply, 1, actualDeposit);
return rb.success();
}
@ -3313,6 +3313,7 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
ResultBean rb = ResultBean.fireFail();
LoanSettleApply apply = fetchBySid(sid);
LoanSettleBankCost bankCost = loanSettleBankCostService.selectByMainSid(sid);
// LoanSettleCompanyCost companyCost = loanSettleCompanyCostService.selectByMainSid(sid);
LoanSettleCompanyReduction reduction = loanSettleCompanyReductionService.selectByMainSid(sid);
if (null != apply) {
BigDecimal amountAll = BigDecimal.ZERO;//推送资方结清款总数
@ -3324,6 +3325,10 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
BigDecimal bbjDDMoney = BigDecimal.ZERO; //资方保证金抵顶
BigDecimal sub = BigDecimal.ZERO; //资方保证金差额
BigDecimal shouxufeiCW = new BigDecimal(shouxufei);
// // 资方未到期金额
// BigDecimal zfwdq = BigDecimal.ZERO;
// // 公司未到期金额
// BigDecimal gswdq = BigDecimal.ZERO;
if (null != reduction) {
if (null != reduction.getNotDuePriceRelief()) {
companyRelief = reduction.getNotDuePriceRelief();
@ -3341,7 +3346,18 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
if (null != bankCost.getLoanDeposit()) {
bbjDDMoney = bankCost.getLoanDeposit();
}
// if (null != bankCost.getNotDuePrice()) {
// zfwdq = bankCost.getNotDuePrice();
// }
}
// if (null != companyCost) {
// if (null != companyCost.getBankNotPrice()) {
// gswdq = companyCost.getBankNotPrice();
// }
// }
// if (companyRelief.compareTo(BigDecimal.ZERO) == 0 && bankRelief.compareTo(BigDecimal.ZERO) == 0) {
// noRelief = gswdq.subtract(zfwdq);
// }
sub = zfJQK.subtract(bbjDDMoney);
amountAll = noRelief.add(companyRelief).add(bbjDDMoney).add(sub);
if (zfJQK.compareTo(BigDecimal.ZERO) > 0) {

Loading…
Cancel
Save