Browse Source

Merge remote-tracking branch 'origin/master'

master
yunuo970428 2 years ago
parent
commit
159779afc7
  1. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsotherpolicy/LoanSolutionsOtherpolicy.java
  2. 16
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsotherpolicy/LoanSolutionsOtherpolicy.java

@ -83,7 +83,7 @@ public class LoanSolutionsOtherpolicy extends BaseEntity {
@ApiModelProperty("实际首付比例")
private String downPayAmountsRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
private BigDecimal otherDiscount;

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

@ -1320,12 +1320,13 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
policyYearRatioNew = policyYearRatioNew.setScale(2, BigDecimal.ROUND_HALF_UP);
if(policyYearRatioNew.compareTo(BigDecimal.ZERO)<0){
//根据年利率和期数、贷款金额计算月还
loanPayMoneyNew = calculatePMT(BigDecimal.ZERO.divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(loanPeriod).doubleValue(), loanAmount.doubleValue());
// loanPayMoneyNew = calculatePMT(BigDecimal.ZERO.divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(loanPeriod).doubleValue(), loanAmount.doubleValue());
loanPayMoneyNew = loanAmount.divide(new BigDecimal(loanPeriod),4,BigDecimal.ROUND_CEILING);
//根据月还计算利息总额=月还金额 乘以 期数 减去 本金
loanInterestNew = loanPayMoney.multiply(new BigDecimal(loanPeriod)).subtract(loanAmount);
loanInterestNew = loanPayMoneyNew.multiply(new BigDecimal(loanPeriod)).subtract(loanAmount);
//四舍五入取整数
loanPayMoneyNew = loanPayMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
loanInterestNew = loanInterest.setScale(0, BigDecimal.ROUND_HALF_UP);
loanPayMoneyNew = loanPayMoneyNew.setScale(0, BigDecimal.ROUND_HALF_UP);
loanInterestNew = loanInterestNew.setScale(0, BigDecimal.ROUND_HALF_UP);
loanPayMoneyAll = loanPayMoneyAll.add(loanPayMoneyNew);
policyYearRatioNew = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
}else{
@ -1379,7 +1380,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
String otherDiscount = query.getOtherDiscount();
if (StringUtils.isNotBlank(otherDiscount) && !"0".equals(otherDiscount)) {
//根据年利率和期数、贷款金额计算旧月还
BigDecimal otherPolicyMonthlyRepay = calculatePMT(new BigDecimal(otherPolicyYearRatio).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(loanPeriod).doubleValue(), loanAmount.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));
//根据旧利息总额和厂家贴息计算新利息总额
@ -1392,9 +1393,10 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
otherPolicyYearRatioNew = otherPolicyYearRatioNew.setScale(2, BigDecimal.ROUND_HALF_UP);
if(otherPolicyYearRatioNew.compareTo(BigDecimal.ZERO)<0){
//根据年利率和期数、贷款金额计算月还
otherPolicyMonthlyRepayNew = calculatePMT(BigDecimal.ZERO.divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(otherPolicyPeriod).doubleValue(), new BigDecimal(otherPolicyAmount).doubleValue());
// otherPolicyMonthlyRepayNew = calculatePMT(BigDecimal.ZERO.divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(otherPolicyPeriod).doubleValue(), new BigDecimal(otherPolicyAmount).doubleValue());
otherPolicyMonthlyRepayNew = new BigDecimal(otherPolicyAmount).divide(new BigDecimal(otherPolicyPeriod),4,BigDecimal.ROUND_CEILING);
//根据月还计算利息总额=月还金额 乘以 期数 减去 本金
otherPolicyInterestNew = otherPolicyMonthlyRepay.multiply(new BigDecimal(otherPolicyPeriod)).subtract(new BigDecimal(otherPolicyAmount));
otherPolicyInterestNew = otherPolicyMonthlyRepayNew.multiply(new BigDecimal(otherPolicyPeriod)).subtract(new BigDecimal(otherPolicyAmount));
//四舍五入取整数
otherPolicyMonthlyRepayNew = otherPolicyMonthlyRepayNew.setScale(0, BigDecimal.ROUND_HALF_UP);
otherPolicyInterestNew = otherPolicyInterestNew.setScale(0, BigDecimal.ROUND_HALF_UP);

Loading…
Cancel
Save