Browse Source

金融方案实际首付比例计算修改

master
dimengzhe 1 year ago
parent
commit
5263bcc4b5
  1. 19
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java

19
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java

@ -1213,6 +1213,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
* 产品贷款金额 = 融资项目总额-首付金额
* 贷款保证金 = 贷款金额 x 贷款保证金比例
*
* 2024-04-16修改实际首付比例=融资首付-(主车开票价+配件-合同价)/(合同价+挂车+购置税+保险)
*
*/
//是否打包:1是,0否
String isPack = query.getIsPack();
@ -1238,6 +1240,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
}
//(合同价+挂车+购置税+保险)
BigDecimal bilAll = BigDecimal.ZERO;
BigDecimal zhuAll = BigDecimal.ZERO;
bilAll = bilAll.add(orderPrice);
CalculateVo calculateVo = new CalculateVo();
//计算的初始化
@ -1286,12 +1289,14 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
loanTotal = loanTotal.add(new BigDecimal(mainVehicleAmount));
AmountAll = AmountAll.add(new BigDecimal(mainVehicleAmount));
offsetAccessoriesBig = offsetAccessoriesBig.add(new BigDecimal(mainVehicleAmount));
zhuAll = zhuAll.add(new BigDecimal(mainVehicleAmount));
}
if (accessoriesAmountCb) {//包含配件
if (StringUtils.isNotBlank(accessoriesAmount)) {
loanTotal = loanTotal.add(new BigDecimal(accessoriesAmount));
AmountAll = AmountAll.add(new BigDecimal(accessoriesAmount));
offsetAccessoriesBig = offsetAccessoriesBig.add(new BigDecimal(accessoriesAmount));
zhuAll = zhuAll.add(new BigDecimal(accessoriesAmount));
}
}
offsetAccessoriesBig = offsetAccessoriesBig.subtract(orderPrice);
@ -1300,6 +1305,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
if (AmountAll.compareTo(orderPrice) < 0) {
return rb.setMsg("主车发票价与配件之和不能小于订单成交价");
}
zhuAll = zhuAll.subtract(orderPrice);
}
if (trailerAmountCb) {//包含挂车
if (StringUtils.isNotBlank(trailerAmount)) {
@ -1523,8 +1529,11 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
/************************计算融资首付********************************/
calculateVo.setLoanDownPay(loanDownPay.setScale(0, BigDecimal.ROUND_HALF_UP).toString());
//实际首付比例 = (融资首付/融资项目总额)x100
//2024-04-16修改实际首付比例=(融资首付-(主车开票价+配件-合同价))/(合同价+挂车+购置税+保险)
// downPayAmountsRatio = loanDownPay.divide(loanTotal, 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal("100"));
downPayAmountsRatio = loanDownPay.divide(bilAll, 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal("100"));
zhuAll = loanDownPay.subtract(zhuAll);
// downPayAmountsRatio = loanDownPay.divide(bilAll, 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal("100"));
downPayAmountsRatio = zhuAll.divide(bilAll, 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal("100"));
downPayAmountsRatio = downPayAmountsRatio.setScale(2, BigDecimal.ROUND_HALF_UP);
calculateVo.setDownPayAmountsRatio(downPayAmountsRatio.toString());
if (otherPolicyState) {//包含
@ -2375,17 +2384,17 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
//抵顶首年保险费
StringBuilder offsetPremiumValue = new StringBuilder();
if (StringUtils.isNotBlank(solutionssVo.getOffsetPremium())) {
offsetPremiumValue = offsetPremiumValue.append("抵顶首年保险费:").append(solutionssVo.getOffsetPremium());
offsetPremiumValue = offsetPremiumValue.append("首年保险费抵顶:").append(solutionssVo.getOffsetPremium());
} else {
offsetPremiumValue = offsetPremiumValue.append("抵顶首年保险费:").append("-");
offsetPremiumValue = offsetPremiumValue.append("首年保险费抵顶:").append("-");
}
//抵顶购置税
StringBuilder offsetPurchasetaxValue = new StringBuilder();
if (StringUtils.isNotBlank(solutionssVo.getOffsetPurchasetax())) {
offsetPurchasetaxValue = offsetPurchasetaxValue.append("抵顶购置税:").append(solutionssVo.getOffsetPurchasetax());
offsetPurchasetaxValue = offsetPurchasetaxValue.append("购置税抵顶:").append(solutionssVo.getOffsetPurchasetax());
} else {
offsetPurchasetaxValue = offsetPurchasetaxValue.append("抵顶购置税:").append("-");
offsetPurchasetaxValue = offsetPurchasetaxValue.append("购置税抵顶:").append("-");
}
//配件抵顶

Loading…
Cancel
Save