|
|
@ -1052,12 +1052,31 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
solutionsDetailsVo.setShowMore(false); |
|
|
|
} else { |
|
|
|
solutionsDetailsVo.setShowMore(true); |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(solutionsDetailsVo.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionsDetailsVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionsDetailsVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
solutionsDetailsVo.setShowMore(false); |
|
|
|
} |
|
|
|
} else if ("2".equals(busSalesOrder.getPayTypeKey())) {//贷款
|
|
|
|
solutionsDetailsVo.setShowMore(true); |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(solutionsDetailsVo.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionsDetailsVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionsDetailsVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1153,6 +1172,15 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (loanSolutionsDetail != null) { |
|
|
|
BeanUtil.copyProperties(loanSolutionsDetail, solutionsDetailsVo); |
|
|
|
} |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(loanSolutions.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionsDetailsVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionsDetailsVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(solutionsDetailsVo); |
|
|
|
} |
|
|
|
|
|
|
@ -1578,6 +1606,33 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
solutionssVo.setShowMore(false); |
|
|
|
} else { |
|
|
|
solutionssVo.setShowMore(true); |
|
|
|
solutionssVo.setFactoryDiscountUse("抵利息"); |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(solutionssVo.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionssVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionssVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (isTrue) { |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getPolicySid()) && loanSolutions.getOtherPolicyState() == 0) { |
|
|
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.selectByMainSid(loanSolutions.getPolicySid()); |
|
|
|
if (loanFinOtherPolicy != null) { |
|
|
|
solutionssVo.setOtherPolicyName(loanFinOtherPolicy.getOtherPolicyName()); |
|
|
|
solutionssVo.setOtherPolicySid(loanFinOtherPolicy.getSid()); |
|
|
|
solutionssVo.setOtherPolicyPeriod(String.valueOf(loanFinOtherPolicy.getPeriod())); |
|
|
|
solutionssVo.setOtherPolicyYearRatio(loanFinOtherPolicy.getYearRatio().toString()); |
|
|
|
solutionssVo.setOtherPolicyIsMain(true); |
|
|
|
} |
|
|
|
} else { |
|
|
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.selectByMainSid(loanSolutions.getPolicySid()); |
|
|
|
if (loanFinOtherPolicy != null) { |
|
|
|
solutionssVo.setOtherPolicyIsMain(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
solutionssVo.setShowMore(false); |
|
|
@ -1585,6 +1640,15 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} else if ("2".equals(busSalesOrder.getPayTypeKey())) {//贷款
|
|
|
|
solutionssVo.setShowMore(true); |
|
|
|
solutionssVo.setFactoryDiscountUse("抵利息"); |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(solutionssVo.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionssVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionssVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (isTrue) { |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getPolicySid()) && loanSolutions.getOtherPolicyState() == 0) { |
|
|
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.selectByMainSid(loanSolutions.getPolicySid()); |
|
|
@ -2155,6 +2219,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
SolutionssVo solutionssVo = new SolutionssVo(); |
|
|
|
BeanUtil.copyProperties(query, solutionssVo); |
|
|
|
if (query.isShowMore()) { |
|
|
|
|
|
|
|
|
|
|
|
if (query.isPremiumCb()) { |
|
|
|
//保险
|
|
|
|
String premium = query.getPremium(); |
|
|
@ -2203,6 +2269,54 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} |
|
|
|
CalculateVo calculateVo = resultBean.getData(); |
|
|
|
BeanUtil.copyProperties(calculateVo, solutionssVo); |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(query.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionssVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionssVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(query.isOtherPolicyState()){ |
|
|
|
//验证贷款金额是否不大于最高贷款金额
|
|
|
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.fetchBySid(query.getOtherPolicySid()); |
|
|
|
if (loanFinOtherPolicy != null) { |
|
|
|
if (loanFinOtherPolicy.getMaxLoanAmount() != null && loanFinOtherPolicy.getMaxLoanRatio() != null) { |
|
|
|
//根据最高融资比例计算最高融资额
|
|
|
|
BigDecimal maxLoanAmountRat = new BigDecimal(query.getLoanTotal()).multiply(loanFinOtherPolicy.getMaxLoanRatio()).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP); |
|
|
|
BigDecimal maxLoanAmount = loanFinOtherPolicy.getMaxLoanAmount(); |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) == 0) {//任一项与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (maxLoanAmount.compareTo(maxLoanAmountRat) < 0) {//maxLoanAmount与贷款金额作对比
|
|
|
|
if (maxLoanAmount.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
} |
|
|
|
} else {//maxLoanAmountRat与贷款金额作对比
|
|
|
|
if (maxLoanAmountRat.compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
return rb.setMsg("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (loanFinOtherPolicy.getMaxLoanAmount() != null) { |
|
|
|
if (loanFinOtherPolicy.getMaxLoanAmount().compareTo(new BigDecimal(query.getOtherPolicyAmount())) < 0) { |
|
|
|
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("其他融贷款金额不能高于选择的其他融的最高贷款金额"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
List<SolutionListVo> formList = getFormList(solutionssVo); |
|
|
|
solutionssVo.setFinanceForms(formList); |
|
|
@ -2241,7 +2355,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} |
|
|
|
isTrue = true; |
|
|
|
//全款且为三方金融
|
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) { |
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) {//贷款且为担保贷款
|
|
|
|
solutionssVo.setShowMore(true); |
|
|
|
solutionssVo.setFactoryDiscountUse("抵利息"); |
|
|
|
if (isTrue) { |
|
|
@ -2260,6 +2374,15 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
solutionssVo.setOtherPolicyIsMain(true); |
|
|
|
} |
|
|
|
} |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(solutionssVo.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionssVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionssVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if ("02".equals(loanSolutions.getTypeKey())) { |
|
|
@ -2288,6 +2411,15 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
solutionssVo.setOtherPolicyIsMain(true); |
|
|
|
} |
|
|
|
} |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(solutionssVo.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
String serviceChargeTypeKey = loanFinPolicy.getServiceAmountTypeKey(); |
|
|
|
BigDecimal serviceChargeTypeValue = loanFinPolicy.getServiceAmount(); |
|
|
|
solutionssVo.setServiceChargeTypeKey(serviceChargeTypeKey); |
|
|
|
if(serviceChargeTypeValue != null){ |
|
|
|
solutionssVo.setServiceChargeTypeValue(serviceChargeTypeValue.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|