|
|
@ -82,9 +82,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (loanSolutionsDetail != null) { |
|
|
|
BeanUtil.copyProperties(loanSolutionsDetail, solutionsDetailsVo); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(loanSolutions.getPolicySid())){ |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getPolicySid())) { |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(loanSolutions.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
if (loanFinPolicy != null) { |
|
|
|
solutionsDetailsVo.setBondTypeKey(loanFinPolicy.getBondTypeKey()); |
|
|
|
} |
|
|
|
} |
|
|
@ -1038,9 +1038,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
return rb; |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(loanSolutions, solutionsDetailsVo); |
|
|
|
if(StringUtils.isNotBlank(loanSolutions.getPolicySid())){ |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getPolicySid())) { |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(loanSolutions.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
if (loanFinPolicy != null) { |
|
|
|
solutionsDetailsVo.setBondTypeKey(loanFinPolicy.getBondTypeKey()); |
|
|
|
} |
|
|
|
} |
|
|
@ -1228,10 +1228,10 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
boolean isOrder = false; |
|
|
|
BigDecimal orderPrice = BigDecimal.ZERO; |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.seletByBusSids(busSid); |
|
|
|
if(busSalesOrder != null){ |
|
|
|
if (busSalesOrder != null) { |
|
|
|
isOrder = true; |
|
|
|
BusSalesOrderPrice busSalesOrderPrice = baseMapper.selectByPriceSid(busSid); |
|
|
|
if(busSalesOrderPrice == null){ |
|
|
|
if (busSalesOrderPrice == null) { |
|
|
|
return rb.setMsg("请先录入价格信息"); |
|
|
|
} |
|
|
|
orderPrice = busSalesOrderPrice.getSingleFinalPrice(); |
|
|
@ -1295,9 +1295,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} |
|
|
|
} |
|
|
|
offsetAccessoriesBig = offsetAccessoriesBig.subtract(orderPrice); |
|
|
|
if(isOrder){ |
|
|
|
if (isOrder) { |
|
|
|
//判断成交价与主车发票价和配件之和
|
|
|
|
if(AmountAll.compareTo(orderPrice)<0){ |
|
|
|
if (AmountAll.compareTo(orderPrice) < 0) { |
|
|
|
return rb.setMsg("主车发票价与配件之和不能小于订单成交价"); |
|
|
|
} |
|
|
|
} |
|
|
@ -1362,9 +1362,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
actualDiscount = actualDiscount.add(loanInterest); |
|
|
|
//根据旧利息总额和厂家贴息计算新利息总额
|
|
|
|
BigDecimal loanInterestNew = loanInterest.subtract(new BigDecimal(factoryDiscount)); |
|
|
|
if(loanInterestNew.compareTo(BigDecimal.ZERO)<0){ |
|
|
|
if (loanInterestNew.compareTo(BigDecimal.ZERO) < 0) { |
|
|
|
actualDiscount = actualDiscount.subtract(BigDecimal.ZERO); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
actualDiscount = actualDiscount.subtract(loanInterestNew); |
|
|
|
} |
|
|
|
//再根据厂家贴息、旧月还计算新月还金额 = 旧月还金额 减去 厂家贴息 除以 期数
|
|
|
@ -1457,9 +1457,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
otherActualDiscount = otherActualDiscount.add(otherPolicyInterest); |
|
|
|
//根据旧利息总额和厂家贴息计算新利息总额
|
|
|
|
BigDecimal otherPolicyInterestNew = otherPolicyInterest.subtract(new BigDecimal(otherDiscount)); |
|
|
|
if(otherPolicyInterestNew.compareTo(BigDecimal.ZERO)<0){ |
|
|
|
if (otherPolicyInterestNew.compareTo(BigDecimal.ZERO) < 0) { |
|
|
|
otherActualDiscount = otherActualDiscount.subtract(BigDecimal.ZERO); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
otherActualDiscount = otherActualDiscount.subtract(otherPolicyInterestNew); |
|
|
|
} |
|
|
|
//再根据厂家贴息、旧月还计算新月还金额 = 旧月还金额 减去 厂家贴息 除以 期数
|
|
|
@ -1513,9 +1513,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} else { |
|
|
|
otherPolicyPeriod = "0"; |
|
|
|
} |
|
|
|
if(offsetAccessoriesBig.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
if (offsetAccessoriesBig.compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
calculateVo.setOffsetAccessories(offsetAccessoriesBig.toString()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
offsetAccessoriesBig = BigDecimal.ZERO; |
|
|
|
calculateVo.setOffsetAccessories(offsetAccessoriesBig.toString()); |
|
|
|
} |
|
|
@ -1796,9 +1796,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
BeanUtil.copyProperties(loanSolutionsDetail, solutionssVo); |
|
|
|
} |
|
|
|
isTrue = true; |
|
|
|
if(StringUtils.isNotBlank(loanSolutions.getPolicySid())){ |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getPolicySid())) { |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(loanSolutions.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
if (loanFinPolicy != null) { |
|
|
|
solutionssVo.setBondTypeKey(loanFinPolicy.getBondTypeKey()); |
|
|
|
} |
|
|
|
} |
|
|
@ -2056,8 +2056,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
StringBuilder factoryDiscountValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getFactoryDiscount())) { |
|
|
|
factoryDiscountValue = factoryDiscountValue.append("厂家贴息:").append(solutionssVo.getFactoryDiscount()); |
|
|
|
if(StringUtils.isNotBlank(solutionssVo.getActualDiscount())){ |
|
|
|
if(new BigDecimal(solutionssVo.getActualDiscount()).compareTo(BigDecimal.ZERO) != 0){ |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getActualDiscount())) { |
|
|
|
if (new BigDecimal(solutionssVo.getActualDiscount()).compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
factoryDiscountValue = factoryDiscountValue.append("(实贴").append(solutionssVo.getActualDiscount()).append(")"); |
|
|
|
} |
|
|
|
} |
|
|
@ -2160,8 +2160,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
StringBuilder otherDiscountValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getOtherDiscount())) { |
|
|
|
otherDiscountValue = otherDiscountValue.append("其它融贴息:").append(solutionssVo.getOtherDiscount()); |
|
|
|
if(StringUtils.isNotBlank(solutionssVo.getOtherActualDiscount())){ |
|
|
|
if(new BigDecimal(solutionssVo.getOtherActualDiscount()).compareTo(BigDecimal.ZERO) != 0){ |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getOtherActualDiscount())) { |
|
|
|
if (new BigDecimal(solutionssVo.getOtherActualDiscount()).compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
otherDiscountValue = otherDiscountValue.append("(实贴").append(solutionssVo.getOtherActualDiscount()).append(")"); |
|
|
|
} |
|
|
|
} |
|
|
@ -2342,7 +2342,6 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} else { |
|
|
|
proxyPremiumValue = proxyPremiumValue.append("代收首年保险费:").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(proxyPremiumValue.toString(), 1, 0, false)); |
|
|
|
//代收购置税
|
|
|
|
StringBuilder proxyPurchasetaxValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getProxyPurchasetax())) { |
|
|
@ -2350,7 +2349,12 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} else { |
|
|
|
proxyPurchasetaxValue = proxyPurchasetaxValue.append("代收购置税:").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(proxyPurchasetaxValue.toString(), 1, 0, false)); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getProxyTotal())) { |
|
|
|
if (new BigDecimal(solutionssVo.getProxyTotal()).compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
list.add(getValueSpanSize(proxyPremiumValue.toString(), 1, 0, false)); |
|
|
|
list.add(getValueSpanSize(proxyPurchasetaxValue.toString(), 1, 0, false)); |
|
|
|
} |
|
|
|
} |
|
|
|
//应收合计
|
|
|
|
StringBuilder receivableTotalValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getReceivableTotal())) { |
|
|
@ -2375,7 +2379,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} else { |
|
|
|
offsetPremiumValue = offsetPremiumValue.append("抵顶首年保险费:").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(offsetPremiumValue.toString(), 1, 0, false)); |
|
|
|
|
|
|
|
//抵顶购置税
|
|
|
|
StringBuilder offsetPurchasetaxValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getOffsetPurchasetax())) { |
|
|
@ -2383,12 +2387,18 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} else { |
|
|
|
offsetPurchasetaxValue = offsetPurchasetaxValue.append("抵顶购置税:").append("-"); |
|
|
|
} |
|
|
|
list.add(getValueSpanSize(offsetPurchasetaxValue.toString(), 1, 0, false)); |
|
|
|
|
|
|
|
//配件抵顶
|
|
|
|
StringBuilder offsetAccessoriesValue = new StringBuilder(); |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getOffsetAccessories())) { |
|
|
|
if(new BigDecimal(solutionssVo.getOffsetAccessories()).compareTo(BigDecimal.ZERO)>0){ |
|
|
|
offsetAccessoriesValue = offsetAccessoriesValue.append("配件抵顶:").append(solutionssVo.getOffsetAccessories()); |
|
|
|
offsetAccessoriesValue = offsetAccessoriesValue.append("配件抵顶:").append(solutionssVo.getOffsetAccessories()); |
|
|
|
}else{ |
|
|
|
offsetAccessoriesValue = offsetAccessoriesValue.append("配件抵顶:").append("-"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getOffsetTotal())) { |
|
|
|
if (new BigDecimal(solutionssVo.getOffsetTotal()).compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
list.add(getValueSpanSize(offsetPremiumValue.toString(), 1, 0, false)); |
|
|
|
list.add(getValueSpanSize(offsetPurchasetaxValue.toString(), 1, 0, false)); |
|
|
|
list.add(getValueSpanSize(offsetAccessoriesValue.toString(), 1, 0, false)); |
|
|
|
} |
|
|
|
} |
|
|
@ -2640,9 +2650,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (loanSolutions != null) { |
|
|
|
solutionssVo = new SolutionssVo(); |
|
|
|
BeanUtil.copyProperties(loanSolutions, solutionssVo); |
|
|
|
if(StringUtils.isNotBlank(loanSolutions.getPolicySid())){ |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getPolicySid())) { |
|
|
|
LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(loanSolutions.getPolicySid()); |
|
|
|
if(loanFinPolicy != null){ |
|
|
|
if (loanFinPolicy != null) { |
|
|
|
solutionssVo.setBondTypeKey(loanFinPolicy.getBondTypeKey()); |
|
|
|
} |
|
|
|
} |
|
|
@ -2747,9 +2757,12 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
public ResultBean<PushVo> selectMoney(String saleOrderSid) { |
|
|
|
ResultBean<PushVo> rb = ResultBean.fireFail(); |
|
|
|
PushVo pushVo = new PushVo(); |
|
|
|
//融资放款=融资项目总额-融资首付-[贷款保证金]-[厂家贴息]
|
|
|
|
//根据选择的产品政策来判断,若贷款保证金为固定的,需要减去,若为敞口的,不需要减;
|
|
|
|
// 差额放款需要减厂家贴息,全额放款不需要。差额放款的厂家贴息金额存入“其他应收”字段中,
|
|
|
|
//生成业务系统融资放款
|
|
|
|
//应收由原来的融资项目总额-融资首付-[固定贷款保证金]-[厂家贴
|
|
|
|
//息]-[其他融厂家贴息]调整为融资项目总额-融资首付。
|
|
|
|
//差额放款的
|
|
|
|
//主产品实际贴息金额+其他融实际贴息金额+固定类型贷款保证金+意
|
|
|
|
//外险之和存入业务系统融资放款的其他应收字段中。
|
|
|
|
BigDecimal bg = BigDecimal.ZERO; |
|
|
|
BigDecimal zer = BigDecimal.ZERO; |
|
|
|
LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(saleOrderSid); |
|
|
@ -2777,14 +2790,14 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
// bg = bg.subtract(loanSolutions.getFactoryDiscount());
|
|
|
|
zer = zer.add(loanSolutions.getFactoryDiscount()); |
|
|
|
} |
|
|
|
if(loanSolutionsOtherpolicy.getOtherDiscount() != null){ |
|
|
|
if (loanSolutionsOtherpolicy.getOtherDiscount() != null) { |
|
|
|
// bg = bg.subtract(loanSolutionsOtherpolicy.getOtherDiscount());
|
|
|
|
zer = zer.add(loanSolutionsOtherpolicy.getOtherDiscount()); |
|
|
|
} |
|
|
|
} |
|
|
|
LoanSolutionsDetail loanSolutionsDetail = loanSolutionsDetailService.selectLoanSid(loanSolutions.getSid()); |
|
|
|
if(loanSolutionsDetail != null){ |
|
|
|
if(loanSolutionsDetail.getProxyAccidentPremium() != null){ |
|
|
|
if (loanSolutionsDetail != null) { |
|
|
|
if (loanSolutionsDetail.getProxyAccidentPremium() != null) { |
|
|
|
zer = zer.add(loanSolutionsDetail.getProxyAccidentPremium()); |
|
|
|
} |
|
|
|
} |
|
|
|