Browse Source

金融方案添加其他融贴息

master
dimengzhe 2 years ago
parent
commit
6c6a3c962f
  1. 10
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java

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

@ -1327,7 +1327,6 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
//四舍五入取整数
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{
//四舍五入取整数
@ -1380,7 +1379,12 @@ 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(otherPolicyPeriod).doubleValue(), new BigDecimal(otherPolicyAmount).doubleValue());
BigDecimal otherPolicyMonthlyRepay = BigDecimal.ZERO;
if(new BigDecimal(otherPolicyYearRatio).compareTo(BigDecimal.ZERO) == 0){
otherPolicyMonthlyRepay = new BigDecimal(otherPolicyAmount).divide(new BigDecimal(otherPolicyPeriod),4,BigDecimal.ROUND_CEILING);
}else{
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));
//根据旧利息总额和厂家贴息计算新利息总额
@ -1774,7 +1778,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
}
}
if (isTrue) {
if (StringUtils.isNotBlank(loanSolutions.getPolicySid()) && loanSolutions.getOtherPolicyState() == 0) {
if (StringUtils.isNotBlank(loanSolutions.getPolicySid()) && loanSolutions.getOtherPolicyState() == 1) {
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.selectByMainSid(loanSolutions.getPolicySid());
if (loanFinOtherPolicy != null) {
solutionssVo.setOtherPolicyName(loanFinOtherPolicy.getOtherPolicyName());

Loading…
Cancel
Save