|
|
@ -691,7 +691,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (dto.isShowMore()) { |
|
|
|
String mainVehicleAmount = dto.getMainVehicleAmount(); |
|
|
|
if (StringUtils.isBlank(mainVehicleAmount)) { |
|
|
|
return rb.setMsg("主车发票价不能为空"); |
|
|
|
// return rb.setMsg("主车发票价不能为空");
|
|
|
|
return rb.setMsg("请检查金融方案计算是否已点击确定"); |
|
|
|
} |
|
|
|
//是否勾选融资票据
|
|
|
|
if (dto.isAccessoriesAmountCb()) { |
|
|
@ -834,7 +835,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
String loanInterest = dto.getLoanInterest(); |
|
|
|
loanSolutions.setLoanInterest(StringUtils.isNotBlank(loanInterest) ? new BigDecimal(loanInterest) : BigDecimal.ZERO); |
|
|
|
LoanSolutionsOtherpolicy loanSolutionsOtherpolicy = new LoanSolutionsOtherpolicy(); |
|
|
|
if (dto.isOtherPolicyState()) {//包含其他融
|
|
|
|
if (dto.isOtherPolicyState()) {//包含其它融
|
|
|
|
BeanUtil.copyProperties(dto, loanSolutionsOtherpolicy, "sid"); |
|
|
|
//贷款金额
|
|
|
|
String otherPolicyAmount = dto.getOtherPolicyAmount(); |
|
|
@ -857,29 +858,29 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
BigDecimal maxLoanAmount = loanFinOtherPolicy.getMaxLoanAmount(); |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) == 0) {//任一项与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(dto.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) < 0) {//maxLoanAmount与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(dto.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} else {//maxLoanAmountRat与贷款金额作对比
|
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(dto.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanAmount() != null) { |
|
|
|
if (loanFinOtherPolicy.getMaxLoanAmount().compareTo(new BigDecimal(dto.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanRatio() != null) { |
|
|
|
//根据最高融资比例计算最高融资额
|
|
|
|
BigDecimal maxLoanAmountRat = new BigDecimal(dto.getLoanTotal()).multiply(loanFinOtherPolicy.getMaxLoanRatio()).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING); |
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(dto.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -976,7 +977,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
loanSolutionsDetailService.insert(loanSolutionsDetail); |
|
|
|
} else { |
|
|
|
if (StringUtils.isBlank(dto.getFactoryDiscount())) { |
|
|
|
return rb.setMsg("厂家贴息不能为空"); |
|
|
|
return rb.setMsg("请检查金融方案计算是否已点击确定"); |
|
|
|
// return rb.setMsg("厂家贴息不能为空");
|
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getDiscountCar())) { |
|
|
|
return rb.setMsg("贴息抵车款不能为空"); |
|
|
@ -1211,7 +1213,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
BigDecimal loanDownPay = BigDecimal.ZERO;//方案汇总融资首付
|
|
|
|
BigDecimal downPayAmountsRatio = BigDecimal.ZERO;//实际首付比例
|
|
|
|
BigDecimal loanAmountTotal = BigDecimal.ZERO;//总贷款金额
|
|
|
|
//其他融期数
|
|
|
|
//其它融期数
|
|
|
|
String otherPolicyPeriod = query.getOtherPolicyPeriod(); |
|
|
|
BigDecimal loanPayMoneyAll = BigDecimal.ZERO; |
|
|
|
BigDecimal vehTotalPrice = BigDecimal.ZERO; |
|
|
@ -1291,7 +1293,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (StringUtils.isNotBlank(downPayAmount)) { |
|
|
|
//贷款金额 = 融资项目总额-首付金额。
|
|
|
|
loanAmount = loanTotal.subtract(new BigDecimal(downPayAmount)); |
|
|
|
//方案汇总融资首付 = 融资首付+首付金额-其他融贷款金额
|
|
|
|
//方案汇总融资首付 = 融资首付+首付金额-其它融贷款金额
|
|
|
|
loanDownPay = loanDownPay.add(new BigDecimal(downPayAmount)); |
|
|
|
loanAmountTotal = loanAmountTotal.add(loanAmount); |
|
|
|
} |
|
|
@ -1341,12 +1343,12 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
calculateVo.setPolicyYearRatio(policyYearRatio.toString()); |
|
|
|
calculateVo.setLoanPayMoney(loanPayMoney.toString()); |
|
|
|
} |
|
|
|
//是否包含其他融
|
|
|
|
//是否包含其它融
|
|
|
|
boolean otherPolicyState = query.isOtherPolicyState(); |
|
|
|
if (otherPolicyState) {//包含
|
|
|
|
otherPolicyPeriod = query.getOtherPolicyPeriod(); |
|
|
|
if (StringUtils.isBlank(otherPolicyPeriod)) { |
|
|
|
return rb.setMsg("请选择其他融"); |
|
|
|
return rb.setMsg("请选择其它融"); |
|
|
|
} |
|
|
|
String otherPolicyYearRatio = query.getOtherPolicyYearRatio(); |
|
|
|
if (otherPolicyYearRatio.contains("%")) { |
|
|
@ -1354,7 +1356,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} |
|
|
|
String otherPolicyAmount = query.getOtherPolicyAmount(); |
|
|
|
if (StringUtils.isBlank(otherPolicyAmount)) { |
|
|
|
return rb.setMsg("其他融贷款金额不能为空"); |
|
|
|
return rb.setMsg("其它融贷款金额不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(otherPolicyPeriod)) { |
|
|
@ -1394,29 +1396,29 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
BigDecimal maxLoanAmount = loanFinOtherPolicy.getMaxLoanAmount(); |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) == 0) {//任一项与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) < 0) {//maxLoanAmount与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} else {//maxLoanAmountRat与贷款金额作对比
|
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanAmount() != null) { |
|
|
|
if (loanFinOtherPolicy.getMaxLoanAmount().compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanRatio() != null) { |
|
|
|
//根据最高融资比例计算最高融资额
|
|
|
|
BigDecimal maxLoanAmountRat = new BigDecimal(query.getLoanTotal()).multiply(loanFinOtherPolicy.getMaxLoanRatio()).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING); |
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2355,29 +2357,29 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
BigDecimal maxLoanAmount = loanFinOtherPolicy.getMaxLoanAmount(); |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) == 0) {//任一项与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) < 0) {//maxLoanAmount与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} else {//maxLoanAmountRat与贷款金额作对比
|
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanAmount() != null) { |
|
|
|
if (loanFinOtherPolicy.getMaxLoanAmount().compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanRatio() != null) { |
|
|
|
//根据最高融资比例计算最高融资额
|
|
|
|
BigDecimal maxLoanAmountRat = new BigDecimal(query.getLoanTotal()).multiply(loanFinOtherPolicy.getMaxLoanRatio()).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING); |
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
return rb.setMsg("其它融贷款金额不能高于最高比例或最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|