|
|
@ -327,7 +327,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//首付款比例
|
|
|
|
String downPayRatio = ""; |
|
|
|
BigDecimal downPayRatio1 = downPayAmount.divide(loanTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP); |
|
|
|
downPayRatio = downPayRatio1.toString() + "%"; |
|
|
|
downPayRatio = downPayRatio1.toString() /*+ "%"*/; |
|
|
|
//产品贷款金额 = 融资项目总额-首付金额
|
|
|
|
loanAmount = loanTotal.subtract(downPayAmount); |
|
|
|
loanSolutions.setDownPayAmount(downPayAmount); |
|
|
@ -351,7 +351,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//贷款保证金比例
|
|
|
|
String bondRatio = ""; |
|
|
|
BigDecimal bondRatio1 = bondAmount.divide(loanAmount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP); |
|
|
|
bondRatio = bondRatio1.toString() + "%"; |
|
|
|
bondRatio = bondRatio1.toString() /*+ "%"*/; |
|
|
|
loanSolutions.setBondAmount(bondAmount); |
|
|
|
loanSolutions.setBondRatio(bondRatio); |
|
|
|
} else { |
|
|
@ -457,7 +457,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//实际首付比例
|
|
|
|
String downPayAmountsRatio = ""; |
|
|
|
BigDecimal downPayAmountsRatio1 = loanDownPay.divide(loanTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP); |
|
|
|
downPayAmountsRatio = downPayAmountsRatio1.toString() + "%"; |
|
|
|
downPayAmountsRatio = downPayAmountsRatio1.toString() /*+ "%"*/; |
|
|
|
loanSolutionsOtherpolicy.setDownPayAmountsRatio(downPayAmountsRatio); |
|
|
|
|
|
|
|
|
|
|
@ -483,7 +483,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//实际首付比例
|
|
|
|
String downPayAmountsRatio = ""; |
|
|
|
BigDecimal downPayAmountsRatio1 = loanDownPay.divide(loanTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP); |
|
|
|
downPayAmountsRatio = downPayAmountsRatio1.toString() + "%"; |
|
|
|
downPayAmountsRatio = downPayAmountsRatio1.toString() /*+ "%"*/; |
|
|
|
loanSolutionsOtherpolicy.setDownPayAmountsRatio(downPayAmountsRatio); |
|
|
|
//期数 = 其它融期数拼接剩余期数(6/18)
|
|
|
|
int i = Integer.valueOf(loanPeriod) - ii; |
|
|
@ -766,6 +766,11 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} |
|
|
|
//保存金融方案
|
|
|
|
loanSolutions = new LoanSolutions(); |
|
|
|
loanSolutions.setSaleOrderState(1); |
|
|
|
if (StringUtils.isNotBlank(dto.getBusSid())) { |
|
|
|
loanSolutions.setSalesOrderSid(dto.getBusSid()); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, loanSolutions, "sid"); |
|
|
|
//根据产品政策查询是否是自营非担保
|
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(dto.getPolicySid()); |
|
|
|
if (loanFinPolicy != null) { |
|
|
@ -774,11 +779,6 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
loanSolutions.setType("自营非担保"); |
|
|
|
} |
|
|
|
} |
|
|
|
loanSolutions.setSaleOrderState(1); |
|
|
|
if (StringUtils.isNotBlank(dto.getBusSid())) { |
|
|
|
loanSolutions.setSalesOrderSid(dto.getBusSid()); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, loanSolutions, "sid"); |
|
|
|
//主车发票价
|
|
|
|
loanSolutions.setMainVehicleAmount(new BigDecimal(mainVehicleAmount)); |
|
|
|
//是否勾选融资票据
|
|
|
@ -1269,6 +1269,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
return rb.setMsg("请选择其他融"); |
|
|
|
} |
|
|
|
String otherPolicyYearRatio = query.getOtherPolicyYearRatio(); |
|
|
|
if(otherPolicyYearRatio.contains("%")){ |
|
|
|
otherPolicyYearRatio = otherPolicyYearRatio.replaceAll("%", ""); |
|
|
|
} |
|
|
|
String otherPolicyAmount = query.getOtherPolicyAmount(); |
|
|
|
if (StringUtils.isBlank(otherPolicyAmount)) { |
|
|
|
return rb.setMsg("其他融贷款金额不能为空"); |
|
|
@ -1280,7 +1283,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//总贷款金额的计算
|
|
|
|
loanAmountTotal = loanAmountTotal.add(new BigDecimal(otherPolicyAmount)); |
|
|
|
//根据年利率和期数、贷款金额计算月还
|
|
|
|
BigDecimal otherPolicyMonthlyRepay = calculatePMT(new BigDecimal(otherPolicyPeriod).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(otherPolicyPeriod).doubleValue(), new BigDecimal(otherPolicyAmount).doubleValue()); |
|
|
|
BigDecimal otherPolicyMonthlyRepay = calculatePMT(new BigDecimal(otherPolicyYearRatio).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(otherPolicyPeriod).doubleValue(), new BigDecimal(otherPolicyAmount).doubleValue()); |
|
|
|
//根据月还计算利息总额=月还金额 乘以 期数 减去 本金
|
|
|
|
BigDecimal otherPolicyInterest = otherPolicyMonthlyRepay.multiply(new BigDecimal(otherPolicyPeriod)).subtract(new BigDecimal(otherPolicyAmount)); |
|
|
|
//四舍五入取整数
|
|
|
@ -1685,10 +1688,10 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//贷款保证金比例
|
|
|
|
StringBuilder bondRatioValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getBondRatio())) { |
|
|
|
bondRatioValue = bondRatioValue.append("贷款保证金比例:").append(solutionssVo.getBondRatio()); |
|
|
|
bondRatioValue = bondRatioValue.append("贷款保证金比例(%):").append(solutionssVo.getBondRatio()); |
|
|
|
|
|
|
|
} else { |
|
|
|
bondRatioValue = bondRatioValue.append("贷款保证金比例:").append("-"); |
|
|
|
bondRatioValue = bondRatioValue.append("贷款保证金比例(%):").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(bondRatioValue.toString(), 1, 0, false)); |
|
|
|
//贷款保证金
|
|
|
@ -1719,10 +1722,10 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//年利率
|
|
|
|
StringBuilder policyYearRatioValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getPolicyYearRatio())) { |
|
|
|
policyYearRatioValue = policyYearRatioValue.append("年利率:").append(solutionssVo.getPolicyYearRatio()); |
|
|
|
policyYearRatioValue = policyYearRatioValue.append("年利率(%):").append(solutionssVo.getPolicyYearRatio()); |
|
|
|
|
|
|
|
} else { |
|
|
|
policyYearRatioValue = policyYearRatioValue.append("年利率:").append("-"); |
|
|
|
policyYearRatioValue = policyYearRatioValue.append("年利率(%):").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(policyYearRatioValue.toString(), 1, 0, false)); |
|
|
|
//利息总额
|
|
|
@ -1776,9 +1779,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
//年利率
|
|
|
|
StringBuilder otherPolicyYearRatioValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getOtherPolicyYearRatio())) { |
|
|
|
otherPolicyYearRatioValue = otherPolicyYearRatioValue.append("年利率:").append(solutionssVo.getOtherPolicyYearRatio()); |
|
|
|
otherPolicyYearRatioValue = otherPolicyYearRatioValue.append("年利率(%):").append(solutionssVo.getOtherPolicyYearRatio()); |
|
|
|
} else { |
|
|
|
otherPolicyYearRatioValue = otherPolicyYearRatioValue.append("年利率:").append("-"); |
|
|
|
otherPolicyYearRatioValue = otherPolicyYearRatioValue.append("年利率(%):").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(otherPolicyYearRatioValue.toString(), 1, 0, false)); |
|
|
|
//利息总额
|
|
|
@ -1811,9 +1814,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
list.add(getValueSpanSize(loanDownPayValue.toString(), 1, 0, false)); |
|
|
|
StringBuilder downPayAmountsRatioValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getDownPayAmountsRatio())) { |
|
|
|
downPayAmountsRatioValue = downPayAmountsRatioValue.append("实际首付比例:").append(solutionssVo.getDownPayAmountsRatio()); |
|
|
|
downPayAmountsRatioValue = downPayAmountsRatioValue.append("实际首付比例(%):").append(solutionssVo.getDownPayAmountsRatio()); |
|
|
|
} else { |
|
|
|
downPayAmountsRatioValue = downPayAmountsRatioValue.append("实际首付比例:").append("-"); |
|
|
|
downPayAmountsRatioValue = downPayAmountsRatioValue.append("实际首付比例(%):").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(downPayAmountsRatioValue.toString(), 1, 0, false)); |
|
|
|
//总贷款金额
|
|
|
|