Browse Source

移动端金融方案

master
dimengzhe 2 years ago
parent
commit
9018cbe3ae
  1. 3
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java
  2. 2
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java
  3. 10
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  4. 17
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutions.java
  5. 4
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutionsFeign.java
  6. 5
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutionsFeignFallback.java
  7. 12
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDetailsVo.java
  8. 38
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDto.java
  9. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsdetail/LoanSolutionsDetail.java
  10. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsotherpolicy/LoanSolutionsOtherpolicy.java
  11. 5
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsRest.java
  12. 341
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java
  13. 13
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionsDetailsVo.java
  14. 12
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionsDto.java
  15. 13
      doc/databases/risk_center.sql

3
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java

@ -2227,13 +2227,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp
} }
} }
baseMapper.updateById(commonContract);
} }
if("2".equals(appOrderDetailsVo.getPayTypeKey())){ if("2".equals(appOrderDetailsVo.getPayTypeKey())){
return rb.setMsg("贷款合同附件请线下处理").setCode("1000001"); return rb.setMsg("贷款合同附件请线下处理").setCode("1000001");
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("生成文件失败:=========================="+e.getMessage());
return rb.setMsg("生成文件失败"); return rb.setMsg("生成文件失败");
} }
return rb.success().setData(list); return rb.success().setData(list);

2
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java

@ -3708,7 +3708,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
//为三方金融和担保贷款 //为三方金融和担保贷款
if ("2".equals(busSalesOrder.getFinancePlan()) || "2".equals(busSalesOrder.getPayTypeKey())) { if ("2".equals(busSalesOrder.getFinancePlan()) || "2".equals(busSalesOrder.getPayTypeKey())) {
//根据销售订单sid查询金融方案 //根据销售订单sid查询金融方案
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetails(bv.getBusinessSid()); ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(bv.getBusinessSid());
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData(); SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData();
if (solutionsDetailsVo != null) { if (solutionsDetailsVo != null) {
if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) { if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) {

10
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java

@ -754,19 +754,19 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
finCollectionConfirmation.setStaffDeptSid(createDeptSid); finCollectionConfirmation.setStaffDeptSid(createDeptSid);
finCollectionConfirmation.setStaffDeptName(deptName); finCollectionConfirmation.setStaffDeptName(deptName);
if ("03".equals(dto.getCollectionTypeKey()) || "05".equals(dto.getCollectionTypeKey())) { if ("03".equals(dto.getCollectionTypeKey()) || "05".equals(dto.getCollectionTypeKey())) {
if (StringUtils.isNotBlank(dto.getCollectionBankNum())) { if (StringUtils.isBlank(dto.getCollectionBankNum())) {
return rb.setMsg("收款银行账号不能为空"); return rb.setMsg("收款银行账号不能为空");
} }
if (StringUtils.isNotBlank(dto.getReceivingName())) { if (StringUtils.isBlank(dto.getReceivingName())) {
return rb.setMsg("收款银行名称不能为空"); return rb.setMsg("收款银行名称不能为空");
} }
if (StringUtils.isNotBlank(dto.getCollectionBank())) { if (StringUtils.isBlank(dto.getCollectionBank())) {
return rb.setMsg("收款银行不能为空"); return rb.setMsg("收款银行不能为空");
} }
if (StringUtils.isNotBlank(dto.getPayAccount())) { if (StringUtils.isBlank(dto.getPayAccount())) {
return rb.setMsg("付款账号后4位不能为空"); return rb.setMsg("付款账号后4位不能为空");
} }
if (StringUtils.isNotBlank(dto.getPayBank())) { if (StringUtils.isBlank(dto.getPayBank())) {
return rb.setMsg("付款银行不能为空"); return rb.setMsg("付款银行不能为空");
} }
} }

17
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutions.java

@ -34,7 +34,7 @@ public class LoanSolutions extends BaseEntity {
@ApiModelProperty("类型key") @ApiModelProperty("类型key")
private String typeKey; private String typeKey;
@ApiModelProperty("是否打包") @ApiModelProperty("是否打包")
private Integer isPack; private String isPack;
@ApiModelProperty("产品政策") @ApiModelProperty("产品政策")
private String policyName; private String policyName;
@ApiModelProperty("产品政策sid") @ApiModelProperty("产品政策sid")
@ -60,7 +60,7 @@ public class LoanSolutions extends BaseEntity {
@ApiModelProperty("贷款金额") @ApiModelProperty("贷款金额")
private BigDecimal loanAmount; private BigDecimal loanAmount;
@ApiModelProperty("贷款期数") @ApiModelProperty("贷款期数")
private Integer loanPeriod; private String loanPeriod;
@ApiModelProperty("保证金比例") @ApiModelProperty("保证金比例")
private String bondRatio; private String bondRatio;
@ApiModelProperty("保证金金额") @ApiModelProperty("保证金金额")
@ -73,6 +73,19 @@ public class LoanSolutions extends BaseEntity {
private BigDecimal loanPayMoney; private BigDecimal loanPayMoney;
@ApiModelProperty("贷款利息") @ApiModelProperty("贷款利息")
private BigDecimal loanInterest; private BigDecimal loanInterest;
@ApiModelProperty("是否有融资票据")
private int accessoriesAmountCb;
@ApiModelProperty("是否有挂车")
private int trailerAmountCb;
@ApiModelProperty("是否有购置税")
private int purchaseTaxCb;
@ApiModelProperty("是否有保险")
private int premiumCb;
@ApiModelProperty("是否有车损上浮")
private int vehDamageFloatCb;
@ApiModelProperty("是否勾选其它融")
private int otherPolicyState;

4
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutionsFeign.java

@ -40,6 +40,10 @@ public interface LoanSolutionsFeign {
@PostMapping("/save") @PostMapping("/save")
ResultBean save(@RequestBody SolutionsDto dto); ResultBean save(@RequestBody SolutionsDto dto);
@ApiOperation("根据销售订单sid查询金融方案")
@GetMapping("/selectDetailss")
ResultBean<SolutionsDetailsVo> selectDetailss(String businessSid);
/* @ApiOperation("根据条件分页查询数据的列表") /* @ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage") @PostMapping("/listPage")
public ResultBean<PagerVo<LoanSolutionsVo>> listPage(@RequestBody PagerQuery<LoanSolutionsQuery> pq); public ResultBean<PagerVo<LoanSolutionsVo>> listPage(@RequestBody PagerQuery<LoanSolutionsQuery> pq);

5
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutionsFeignFallback.java

@ -30,6 +30,11 @@ public class LoanSolutionsFeignFallback implements LoanSolutionsFeign {
return null; return null;
} }
@Override
public ResultBean<SolutionsDetailsVo> selectDetailss(String businessSid) {
return null;
}
/* @Override /* @Override
public ResultBean<PagerVo<LoanSolutionsVo>> listPage(PagerQuery<LoanSolutionsQuery> pq) { public ResultBean<PagerVo<LoanSolutionsVo>> listPage(PagerQuery<LoanSolutionsQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();

12
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDetailsVo.java

@ -63,6 +63,18 @@ public class SolutionsDetailsVo implements Vo {
private String loanPayMoney; private String loanPayMoney;
@ApiModelProperty("贷款利息") @ApiModelProperty("贷款利息")
private String loanInterest; private String loanInterest;
@ApiModelProperty("是否有融资票据")
private boolean accessoriesAmountCb;
@ApiModelProperty("是否有挂车")
private boolean trailerAmountCb;
@ApiModelProperty("是否有购置税")
private boolean purchaseTaxCb;
@ApiModelProperty("是否有保险")
private boolean premiumCb;
@ApiModelProperty("是否有车损上浮")
private boolean vehDamageFloatCb;
@ApiModelProperty("是否勾选其它融")
private boolean otherPolicyState;
//其他融 //其他融

38
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDto.java

@ -15,10 +15,14 @@ public class SolutionsDto implements Dto {
//金融方案主表 //金融方案主表
@ApiModelProperty("销售订单sid")
private String saleOrderSid; private String saleOrderSid;
@ApiModelProperty("类型:01自营非担保,02外部金融")
private String type; private String type;
@ApiModelProperty("类型:01自营非担保,02外部金融")
private String typeKey; private String typeKey;
private Integer isPack; @ApiModelProperty("是否打包:1是0否")
private String isPack;
@ApiModelProperty("产品政策名称") @ApiModelProperty("产品政策名称")
private String policyName; private String policyName;
@ApiModelProperty("主车发票价") @ApiModelProperty("主车发票价")
@ -36,6 +40,17 @@ public class SolutionsDto implements Dto {
@ApiModelProperty("融资项目总额") @ApiModelProperty("融资项目总额")
private String loanTotal; private String loanTotal;
@ApiModelProperty("是否有融资票据")
private boolean accessoriesAmountCb;
@ApiModelProperty("是否有挂车")
private boolean trailerAmountCb;
@ApiModelProperty("是否有购置税")
private boolean purchaseTaxCb;
@ApiModelProperty("是否有保险")
private boolean premiumCb;
@ApiModelProperty("是否有车损上浮")
private boolean vehDamageFloatCb;
@ApiModelProperty("首付款比例") @ApiModelProperty("首付款比例")
private String downPayRatio; private String downPayRatio;
@ApiModelProperty("首付金额") @ApiModelProperty("首付金额")
@ -43,7 +58,7 @@ public class SolutionsDto implements Dto {
@ApiModelProperty("贷款金额") @ApiModelProperty("贷款金额")
private String loanAmount; private String loanAmount;
@ApiModelProperty("贷款期数") @ApiModelProperty("贷款期数")
private int loanPeriod; private String loanPeriod;
@ApiModelProperty("贷款保证金比例") @ApiModelProperty("贷款保证金比例")
private String bondRatio; private String bondRatio;
@ApiModelProperty("贷款保证金金额") @ApiModelProperty("贷款保证金金额")
@ -56,37 +71,38 @@ public class SolutionsDto implements Dto {
private String loanPayMoney; private String loanPayMoney;
@ApiModelProperty("利息总额") @ApiModelProperty("利息总额")
private String loanInterest; private String loanInterest;
@ApiModelProperty("是否勾选其它融")
private boolean otherPolicyState;
//其他融 //其他融
@ApiModelProperty("其它融名称") @ApiModelProperty("其它融名称")
private String otherPolicyName; private String otherPolicyName;
@ApiModelProperty("其它融贷款金额") @ApiModelProperty("其它融贷款金额")
private String otherPolicyAmount; private String otherPolicyAmount;
@ApiModelProperty("其它融期数") @ApiModelProperty("其它融期数")
private Integer otherPolicyPeriod; private String otherPolicyPeriod;
@ApiModelProperty("其它融月还") @ApiModelProperty("其它融月还")
private String otherPolicyMonthlyRepay; private String otherPolicyMonthlyRepay;
@ApiModelProperty("其它融利息总额") @ApiModelProperty("其它融利息总额")
private String otherPolicyInterest; private String otherPolicyInterest;
/* @ApiModelProperty("'融资首付") @ApiModelProperty("'融资首付")
private String loanDownPay; private String loanDownPay;
@ApiModelProperty("总贷款金额") @ApiModelProperty("总贷款金额")
private String loanAmountTotal; private String loanAmountTotal;
@ApiModelProperty("期数") @ApiModelProperty("期数")
private Integer period; private String period;
@ApiModelProperty("月还金额") @ApiModelProperty("月还金额")
private String monthlyRepay; private String monthlyRepay;
@ApiModelProperty("利息总额") @ApiModelProperty("利息总额")
private String interest;*/ private String interest;
@ApiModelProperty("预计首期还款日") @ApiModelProperty("预计首期还款日")
private String returnTime; private String returnTime;
//金融方案费用明细 //金融方案费用明细
/* @ApiModelProperty("融资首付") @ApiModelProperty("融资首付")
private String downPayAmounts;*/ private String downPayAmounts;
@ApiModelProperty("贷款保证金") @ApiModelProperty("贷款保证金")
private String bondAmounts; private String bondAmounts;
@ApiModelProperty("保险保证金") @ApiModelProperty("保险保证金")
@ -117,8 +133,8 @@ public class SolutionsDto implements Dto {
private String offsetPremium; private String offsetPremium;
@ApiModelProperty("抵顶购置税") @ApiModelProperty("抵顶购置税")
private String offsetPurchasetax; private String offsetPurchasetax;
/* @ApiModelProperty("抵顶费用合计") @ApiModelProperty("抵顶费用合计")
private String offsetTotal;*/ private String offsetTotal;
@ApiModelProperty("应收合计") @ApiModelProperty("应收合计")
private String receivableTotal; private String receivableTotal;
@ApiModelProperty("实收合计") @ApiModelProperty("实收合计")

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsdetail/LoanSolutionsDetail.java

@ -32,7 +32,7 @@ public class LoanSolutionsDetail extends BaseEntity {
@ApiModelProperty("融资首付") @ApiModelProperty("融资首付")
private BigDecimal downPayAmount; private BigDecimal downPayAmount;
@ApiModelProperty("贷款保证金") @ApiModelProperty("贷款保证金")
private BigDecimal bondAmount; private BigDecimal bondAmounts;
@ApiModelProperty("保险保证金") @ApiModelProperty("保险保证金")
private BigDecimal depositPremium; private BigDecimal depositPremium;
@ApiModelProperty("落户保证金") @ApiModelProperty("落户保证金")

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

@ -59,7 +59,7 @@ public class LoanSolutionsOtherpolicy extends BaseEntity {
@ApiModelProperty("其它融金额") @ApiModelProperty("其它融金额")
private BigDecimal otherPolicyAmount; private BigDecimal otherPolicyAmount;
@ApiModelProperty("其它融期数") @ApiModelProperty("其它融期数")
private Integer otherPolicyPeriod; private String otherPolicyPeriod;
@ApiModelProperty("其它融月还") @ApiModelProperty("其它融月还")
private BigDecimal otherPolicyMonthlyRepay; private BigDecimal otherPolicyMonthlyRepay;
@ApiModelProperty("其它融利息总额") @ApiModelProperty("其它融利息总额")

5
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsRest.java

@ -40,6 +40,11 @@ public class LoanSolutionsRest implements LoanSolutionsFeign {
return loanSolutionsService.saveDto(dto); return loanSolutionsService.saveDto(dto);
} }
@Override
public ResultBean<SolutionsDetailsVo> selectDetailss(String businessSid) {
return loanSolutionsService.selectDetailss(businessSid);
}
/* @Override /* @Override
public ResultBean<PagerVo<LoanSolutionsVo>> listPage(@RequestBody PagerQuery<LoanSolutionsQuery> pq) { public ResultBean<PagerVo<LoanSolutionsVo>> listPage(@RequestBody PagerQuery<LoanSolutionsQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();

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

@ -46,16 +46,16 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
ResultBean<SolutionsDetailsVo> rb = ResultBean.fireFail(); ResultBean<SolutionsDetailsVo> rb = ResultBean.fireFail();
SolutionsDetailsVo solutionsDetailsVo = new SolutionsDetailsVo(); SolutionsDetailsVo solutionsDetailsVo = new SolutionsDetailsVo();
LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(saleOrderSid); LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(saleOrderSid);
if(loanSolutions != null){ if (loanSolutions != null) {
BeanUtil.copyProperties(loanSolutions, solutionsDetailsVo); BeanUtil.copyProperties(loanSolutions, solutionsDetailsVo);
//查询其它融以及金融费用明细是否存在 //查询其它融以及金融费用明细是否存在
LoanSolutionsOtherpolicy loanSolutionsOtherpolicy = loanSolutionsOtherpolicyService.selectByLoanSid(loanSolutions.getSid()); LoanSolutionsOtherpolicy loanSolutionsOtherpolicy = loanSolutionsOtherpolicyService.selectByLoanSid(loanSolutions.getSid());
if(loanSolutionsOtherpolicy != null){ if (loanSolutionsOtherpolicy != null) {
BeanUtil.copyProperties(loanSolutionsOtherpolicy,solutionsDetailsVo); BeanUtil.copyProperties(loanSolutionsOtherpolicy, solutionsDetailsVo);
} }
LoanSolutionsDetail loanSolutionsDetail = loanSolutionsDetailService.selectLoanSid(loanSolutions.getSid()); LoanSolutionsDetail loanSolutionsDetail = loanSolutionsDetailService.selectLoanSid(loanSolutions.getSid());
if(loanSolutionsDetail != null){ if (loanSolutionsDetail != null) {
BeanUtil.copyProperties(loanSolutionsDetail,solutionsDetailsVo); BeanUtil.copyProperties(loanSolutionsDetail, solutionsDetailsVo);
} }
} }
//根据销售订单sid查询销售订单的信息 //根据销售订单sid查询销售订单的信息
@ -65,10 +65,10 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
if ("1".equals(appOrderDetailsVo.getPayTypeKey())) { if ("1".equals(appOrderDetailsVo.getPayTypeKey())) {
if ("2".equals(appOrderDetailsVo.getFinancePlan())) { if ("2".equals(appOrderDetailsVo.getFinancePlan())) {
solutionsDetailsVo.setFinPlanState(true); solutionsDetailsVo.setFinPlanState(true);
}else{ } else {
solutionsDetailsVo.setFinPlanState(false); solutionsDetailsVo.setFinPlanState(false);
} }
}else{ } else {
solutionsDetailsVo.setFinPlanState(false); solutionsDetailsVo.setFinPlanState(false);
} }
} }
@ -80,182 +80,326 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
public ResultBean saveDto(SolutionsDto dto) { public ResultBean saveDto(SolutionsDto dto) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
//查询金融方案
LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(dto.getSaleOrderSid());
if (loanSolutions != null) {
//删除该销售订单的
baseMapper.deleteByOrderSid(dto.getSaleOrderSid());
loanSolutionsOtherpolicyService.deleteByLoanSid(loanSolutions.getSid());
loanSolutionsDetailService.deleteByLoanSid(loanSolutions.getSid());
}
//保存金融方案
loanSolutions = new LoanSolutions();
//自营非担保和贷款的需要填写金融方案 //自营非担保和贷款的需要填写金融方案
if ("01".equals(dto.getTypeKey()) || StringUtils.isBlank(dto.getTypeKey())) { if ("01".equals(dto.getTypeKey()) || StringUtils.isBlank(dto.getTypeKey())) {
//是否打包
String isPack = dto.getIsPack();
//产品政策名称
String policyName = dto.getPolicyName();
//融资项目总额 = 主车发票价+融资票据+挂车+保险+购置税+车损上浮 //融资项目总额 = 主车发票价+融资票据+挂车+保险+购置税+车损上浮
BigDecimal loanTotal = new BigDecimal(BigInteger.ZERO); BigDecimal loanTotal = new BigDecimal(BigInteger.ZERO);
//主车发票价 //主车发票价
String mainVehicleAmount = dto.getMainVehicleAmount(); String mainVehicleAmount = dto.getMainVehicleAmount();
if (StringUtils.isNotBlank(mainVehicleAmount)) { if (StringUtils.isNotBlank(mainVehicleAmount)) {
loanTotal = loanTotal.add(new BigDecimal(mainVehicleAmount)); loanTotal = loanTotal.add(new BigDecimal(mainVehicleAmount));
loanSolutions.setMainVehicleAmount(new BigDecimal(mainVehicleAmount));
} else {
return rb.setMsg("主车发票价不能为空");
} }
//是否勾选融资票据
if (dto.isAccessoriesAmountCb()) {
//融资票据 //融资票据
String accessoriesAmount = dto.getAccessoriesAmount(); String accessoriesAmount = dto.getAccessoriesAmount();
if (StringUtils.isNotBlank(accessoriesAmount)) { if (StringUtils.isNotBlank(accessoriesAmount)) {
loanTotal = loanTotal.add(new BigDecimal(accessoriesAmount)); loanTotal = loanTotal.add(new BigDecimal(accessoriesAmount));
loanSolutions.setAccessoriesAmount(new BigDecimal(accessoriesAmount));
} else {
return rb.setMsg("请输入融资票据");
}
loanSolutions.setAccessoriesAmountCb(1);
} else {
loanTotal = loanTotal.add(new BigDecimal(BigInteger.ZERO));
loanSolutions.setAccessoriesAmountCb(0);
} }
//是否勾选挂车
if (dto.isTrailerAmountCb()) {
//挂车 //挂车
String trailerAmount = dto.getTrailerAmount(); String trailerAmount = dto.getTrailerAmount();
if (StringUtils.isNotBlank(trailerAmount)) { if (StringUtils.isNotBlank(trailerAmount)) {
loanTotal = loanTotal.add(new BigDecimal(trailerAmount)); loanTotal = loanTotal.add(new BigDecimal(trailerAmount));
loanSolutions.setTrailerAmount(new BigDecimal(trailerAmount));
} else {
return rb.setMsg("请输入挂车金额");
}
loanSolutions.setTrailerAmountCb(1);
} else {
loanTotal = loanTotal.add(new BigDecimal(BigInteger.ZERO));
loanSolutions.setTrailerAmountCb(0);
} }
//是否勾选保险
if (dto.isPremiumCb()) {
//保险
String premium = dto.getPremium();
if (StringUtils.isNotBlank(premium)) {
loanTotal = loanTotal.add(new BigDecimal(premium));
loanSolutions.setPremium(new BigDecimal(premium));
} else {
return rb.setMsg("请输入保险金额");
}
loanSolutions.setPremiumCb(1);
} else {
loanTotal = loanTotal.add(new BigDecimal(BigInteger.ZERO));
loanSolutions.setPremiumCb(0);
}
//是否勾选购置税
if (dto.isPurchaseTaxCb()) {
//购置税 //购置税
String purchaseTax = dto.getPurchaseTax(); String purchaseTax = dto.getPurchaseTax();
if (StringUtils.isNotBlank(purchaseTax)) { if (StringUtils.isNotBlank(purchaseTax)) {
loanTotal = loanTotal.add(new BigDecimal(purchaseTax)); loanTotal = loanTotal.add(new BigDecimal(purchaseTax));
loanSolutions.setPurchaseTax(new BigDecimal(purchaseTax));
} else {
return rb.setMsg("请输入购置税");
} }
//保险金额 loanSolutions.setPurchaseTaxCb(1);
String premium = dto.getPremium(); } else {
if (StringUtils.isNotBlank(premium)) { loanTotal = loanTotal.add(new BigDecimal(BigInteger.ZERO));
loanTotal = loanTotal.add(new BigDecimal(premium)); loanSolutions.setPurchaseTaxCb(0);
} }
//是否勾选车损上浮
if (dto.isVehDamageFloatCb()) {
//车损上浮 //车损上浮
String vehDamageFloat = dto.getVehDamageFloat(); String vehDamageFloat = dto.getVehDamageFloat();
if (StringUtils.isNotBlank(vehDamageFloat)) { if (StringUtils.isNotBlank(vehDamageFloat)) {
loanTotal = loanTotal.add(new BigDecimal(vehDamageFloat)); loanTotal = loanTotal.add(new BigDecimal(vehDamageFloat));
} loanSolutions.setVehDamageFloat(new BigDecimal(vehDamageFloat));
//首付款比例
String downPayRatio = dto.getDownPayRatio();
//首付金额
BigDecimal downPayAmount = new BigDecimal(BigInteger.ZERO);
//首付金额 = 融资项目总*首付比例(可调整)
if (StringUtils.isBlank(downPayRatio)) {
return rb.setMsg("首付款比例不能为空");
} else {
if (StringUtils.isBlank(dto.getDownPayAmount())) {
downPayAmount = loanTotal.multiply(new BigDecimal(downPayRatio)).divide(new BigDecimal("100"));
} else { } else {
downPayAmount = new BigDecimal(dto.getDownPayAmount()); return rb.setMsg("请输入车损上浮金额");
} }
loanSolutions.setVehDamageFloatCb(1);
} else {
loanTotal = loanTotal.add(new BigDecimal(BigInteger.ZERO));
loanSolutions.setVehDamageFloatCb(0);
} }
int loanPeriod = dto.getLoanPeriod(); loanSolutions.setLoanTotal(loanTotal);
//产品贷款金额
BigDecimal loanAmount = new BigDecimal(BigInteger.ZERO);
BigDecimal downPayAmount = new BigDecimal(BigInteger.ZERO);
//首付金额填写、首付款比例计算。首付款比例 = 首付金额/融资总额*100
if (StringUtils.isNotBlank(dto.getDownPayAmount())) {
//首付金额
downPayAmount = downPayAmount.add(new BigDecimal(dto.getDownPayAmount()));
//首付款比例
String downPayRatio = "";
BigDecimal downPayRatio1 = downPayAmount.divide(loanTotal).multiply(new BigDecimal("100"));
downPayRatio = downPayRatio1.toString() + "%";
//产品贷款金额 = 融资项目总额-首付金额 //产品贷款金额 = 融资项目总额-首付金额
BigDecimal loanAmount = loanTotal.subtract(downPayAmount); loanAmount = loanTotal.subtract(downPayAmount);
//贷款保证金比例 loanSolutions.setDownPayAmount(downPayAmount);
String bondRatio = dto.getBondRatio(); loanSolutions.setDownPayRatio(downPayRatio);
//贷款保证金 = 贷款金额*贷款保证金比例(可调整)
BigDecimal bondAmount = new BigDecimal(BigInteger.ZERO);
if (StringUtils.isBlank(bondRatio)) {
return rb.setMsg("贷款保证金比例不能为空");
} else {
if (StringUtils.isBlank(dto.getBondAmount())) {
bondAmount = loanAmount.multiply(new BigDecimal(bondRatio)).divide(new BigDecimal("100"));
} else { } else {
bondAmount = new BigDecimal(dto.getBondAmount()); loanAmount = loanTotal;
} }
loanSolutions.setLoanAmount(loanAmount);
//产品期数
String loanPeriod = dto.getLoanPeriod();
if (StringUtils.isBlank(loanPeriod)) {
return rb.setMsg("主方案期数不能为空");
}
loanSolutions.setLoanPeriod(loanPeriod);
//贷款保证金填写、贷款保证金比例计算。贷款保证金比例 = 贷款保证金/贷款金额*100
if (StringUtils.isNotBlank(dto.getBondAmount())) {
//贷款保证金
BigDecimal bondAmount = new BigDecimal(dto.getBondAmount());
//贷款保证金比例
String bondRatio = "";
BigDecimal bondRatio1 = bondAmount.divide(loanAmount).multiply(new BigDecimal("100"));
bondRatio = bondRatio1.toString() + "%";
loanSolutions.setBondAmount(bondAmount);
loanSolutions.setBondRatio(bondRatio);
} }
//厂家贴息 //厂家贴息
String factoryDiscount = dto.getFactoryDiscount(); String factoryDiscount = dto.getFactoryDiscount();
//年利率 = if (StringUtils.isNotBlank(factoryDiscount)) {
loanSolutions.setFactoryDiscount(new BigDecimal(factoryDiscount));
}
//年利率
String policyYearRatio = dto.getPolicyYearRatio(); String policyYearRatio = dto.getPolicyYearRatio();
loanSolutions.setPolicyYearRatio(policyYearRatio);
//月还金额 //月还金额
String loanPayMoney = dto.getLoanPayMoney(); String loanPayMoney = dto.getLoanPayMoney();
//利息总额 = 贷款利息总额+利息总额 if (StringUtils.isNotBlank(loanPayMoney)) {
BigDecimal interest = new BigDecimal(BigInteger.ZERO); loanSolutions.setLoanPayMoney(new BigDecimal(loanPayMoney));
}
//利息总额
//利息总额 //利息总额
BigDecimal interest = new BigDecimal(BigInteger.ZERO);
String loanInterest = dto.getLoanInterest(); String loanInterest = dto.getLoanInterest();
if (StringUtils.isNotBlank(loanInterest)) { if (StringUtils.isNotBlank(loanInterest)) {
interest = interest.add(new BigDecimal(loanInterest)); loanSolutions.setLoanInterest(new BigDecimal(loanInterest));
interest.add(new BigDecimal(loanInterest));
} }
//==================================其它融 BigDecimal otherPolicyAmount1 = new BigDecimal(BigInteger.ZERO);
int ii = 0;
//=================================其它融
//勾选其它融
LoanSolutionsOtherpolicy loanSolutionsOtherpolicy = new LoanSolutionsOtherpolicy();
if (dto.isOtherPolicyState()) {
//其它融名称 //其它融名称
String otherPolicyName = dto.getOtherPolicyName(); if (StringUtils.isNotBlank(dto.getOtherPolicyName())) {
//其它融贷款金额 loanSolutionsOtherpolicy.setOtherPolicyName(dto.getOtherPolicyName());
BigDecimal otherPolicyAmount = new BigDecimal(BigInteger.ZERO); }
if (StringUtils.isNotBlank(dto.getOtherPolicyAmount())) { //贷款金额
otherPolicyAmount = new BigDecimal(dto.getOtherPolicyAmount()); String otherPolicyAmount = dto.getOtherPolicyAmount();
} if (StringUtils.isNotBlank(otherPolicyAmount)) {
//其它融期数 otherPolicyAmount1 = otherPolicyAmount1.add(new BigDecimal(otherPolicyAmount));
int otherPolicyPeriod = dto.getOtherPolicyPeriod(); }
loanSolutionsOtherpolicy.setOtherPolicyAmount(otherPolicyAmount1);
String otherPolicyPeriod = dto.getOtherPolicyPeriod();
if (StringUtils.isNotBlank(otherPolicyPeriod)) {
loanSolutionsOtherpolicy.setOtherPolicyPeriod(otherPolicyPeriod);
ii = ii + Integer.valueOf(otherPolicyPeriod);
}
//其它融月还 //其它融月还
String otherPolicyMonthlyRepay = dto.getOtherPolicyMonthlyRepay(); String otherPolicyMonthlyRepay = dto.getOtherPolicyMonthlyRepay();
if (StringUtils.isNotBlank(otherPolicyMonthlyRepay)) {
loanSolutionsOtherpolicy.setOtherPolicyMonthlyRepay(new BigDecimal(otherPolicyMonthlyRepay));
}
//其它融利息总额 //其它融利息总额
String otherPolicyInterest = dto.getOtherPolicyInterest(); String otherPolicyInterest = dto.getOtherPolicyInterest();
if (StringUtils.isNotBlank(otherPolicyInterest)) { if (StringUtils.isNotBlank(otherPolicyInterest)) {
loanSolutionsOtherpolicy.setOtherPolicyInterest(new BigDecimal(otherPolicyInterest));
interest = interest.add(new BigDecimal(otherPolicyInterest)); interest = interest.add(new BigDecimal(otherPolicyInterest));
} }
//方案汇总==========================================
//==================================方案汇总
//融资首付 = 首付金额-其它融贷款金额 //融资首付 = 首付金额-其它融贷款金额
BigDecimal loanDownPay = downPayAmount.subtract(otherPolicyAmount); BigDecimal loanDownPay = new BigDecimal(BigInteger.ZERO);
//期数 = 其它融期数/剩余期数 loanDownPay = loanDownPay.add(downPayAmount).subtract(otherPolicyAmount1);
int periods = loanPeriod - otherPolicyPeriod; loanSolutionsOtherpolicy.setLoanDownPay(loanDownPay);
String period = otherPolicyInterest + "/" + periods; //总贷款金额 = 主方案贷款金额+其它融贷款金额
//总贷款金额 = 产品贷款金额+其它融贷款金额 BigDecimal loanAmountTotal = new BigDecimal(BigInteger.ZERO);
BigDecimal loanAmountTotal = loanAmount.add(otherPolicyAmount); loanAmountTotal = loanAmountTotal.add(loanAmount).add(otherPolicyAmount1);
loanSolutionsOtherpolicy.setLoanAmountTotal(loanAmountTotal);
//期数 = 其它融期数拼接剩余期数(6/18)
int i = Integer.valueOf(loanPeriod) - Integer.valueOf(otherPolicyPeriod);
String period = otherPolicyPeriod + "/" + i;
loanSolutionsOtherpolicy.setPeriod(period);
//月还金额 = 总月还/贷款月还 //月还金额 = 总月还/贷款月还
String monthlyRepay = dto.getLoanPayMoney() + "/" + dto.getOtherPolicyMonthlyRepay(); String monthlyRepay = dto.getLoanPayMoney() + "/" + dto.getOtherPolicyMonthlyRepay();
//预计首期还款日 //预计首期还款日
String returnTime = dto.getReturnTime(); String returnTime = dto.getReturnTime();
loanSolutionsOtherpolicy.setMonthlyRepay(monthlyRepay);
//====================================应收明细 loanSolutionsOtherpolicy.setReturnTime(returnTime);
//利息总额
loanSolutionsOtherpolicy.setInterest(interest);
loanSolutions.setOtherPolicyState(1);
} else {
//方案汇总
//融资首付 = 首付金额-其它融贷款金额
BigDecimal loanDownPay = new BigDecimal(BigInteger.ZERO);
loanDownPay = loanDownPay.add(downPayAmount).subtract(otherPolicyAmount1);
loanSolutionsOtherpolicy.setLoanDownPay(loanDownPay);
//总贷款金额 = 主方案贷款金额+其它融贷款金额
BigDecimal loanAmountTotal = new BigDecimal(BigInteger.ZERO);
loanAmountTotal = loanAmountTotal.add(loanAmount).add(otherPolicyAmount1);
loanSolutionsOtherpolicy.setLoanAmountTotal(loanAmountTotal);
//期数 = 其它融期数拼接剩余期数(6/18)
int i = Integer.valueOf(loanPeriod) - ii;
String period = ii + "/" + i;
loanSolutionsOtherpolicy.setPeriod(period);
//月还金额 = 总月还/贷款月还
String monthlyRepay = dto.getLoanPayMoney() + "/" + dto.getOtherPolicyMonthlyRepay();
//预计首期还款日
String returnTime = dto.getReturnTime();
loanSolutionsOtherpolicy.setMonthlyRepay(monthlyRepay);
loanSolutionsOtherpolicy.setReturnTime(returnTime);
//利息总额
loanSolutionsOtherpolicy.setInterest(interest);
loanSolutions.setOtherPolicyState(0);
}
baseMapper.insert(loanSolutions);
loanSolutionsOtherpolicyService.insert(loanSolutionsOtherpolicy);
//=========================应收明细
LoanSolutionsDetail loanSolutionsDetail = new LoanSolutionsDetail();
//应收合计 = 融资首付+贷款保证金+保险保证金+落户保证金+服务费+代收意外险+补车价+上牌费+运管费+其它费用 //应收合计 = 融资首付+贷款保证金+保险保证金+落户保证金+服务费+代收意外险+补车价+上牌费+运管费+其它费用
BigDecimal receivableTotal = new BigDecimal(BigInteger.ZERO); BigDecimal receivableTotal = new BigDecimal(BigInteger.ZERO);
//融资首付 = 首付金额-其它融贷款金额 //融资首付 = 首付金额-其它融贷款金额
BigDecimal downPayAmounts = new BigDecimal(BigInteger.ZERO); BigDecimal downPayAmounts = new BigDecimal(BigInteger.ZERO);
downPayAmounts = loanDownPay; downPayAmounts = downPayAmounts.add(downPayAmount).subtract(otherPolicyAmount1);
loanSolutionsDetail.setDownPayAmount(downPayAmounts);
//贷款保证金 //贷款保证金
String bondAmounts = dto.getBondAmounts(); String bondAmounts = dto.getBondAmounts();
if (StringUtils.isNotBlank(bondAmounts)) { if (StringUtils.isNotBlank(bondAmounts)) {
receivableTotal = receivableTotal.add(new BigDecimal(bondAmounts)); receivableTotal = receivableTotal.add(new BigDecimal(bondAmounts));
loanSolutionsDetail.setBondAmounts(new BigDecimal(bondAmounts));
} }
//保险保证金 //保险保证金
String depositPremium = dto.getDepositPremium(); String depositPremium = dto.getDepositPremium();
if (StringUtils.isNotBlank(depositPremium)) { if (StringUtils.isNotBlank(depositPremium)) {
receivableTotal = receivableTotal.add(new BigDecimal(depositPremium)); receivableTotal = receivableTotal.add(new BigDecimal(depositPremium));
loanSolutionsDetail.setDepositPremium(new BigDecimal(depositPremium));
} }
//落户保证金 //落户保证金
String depositSettle = dto.getDepositSettle(); String depositSettle = dto.getDepositSettle();
if (StringUtils.isNotBlank(depositSettle)) { if (StringUtils.isNotBlank(depositSettle)) {
receivableTotal = receivableTotal.add(new BigDecimal(depositPremium)); receivableTotal = receivableTotal.add(new BigDecimal(depositPremium));
loanSolutionsDetail.setDepositSettle(new BigDecimal(depositSettle));
} }
//服务费 //服务费
String serviceAmount = dto.getServiceAmount(); String serviceAmount = dto.getServiceAmount();
if (StringUtils.isNotBlank(serviceAmount)) { if (StringUtils.isNotBlank(serviceAmount)) {
receivableTotal = receivableTotal.add(new BigDecimal(serviceAmount)); receivableTotal = receivableTotal.add(new BigDecimal(serviceAmount));
loanSolutionsDetail.setServiceAmount(new BigDecimal(serviceAmount));
} }
//代收意外险 //代收意外险
String proxyAccidentPremium = dto.getProxyAccidentPremium(); String proxyAccidentPremium = dto.getProxyAccidentPremium();
if (StringUtils.isNotBlank(proxyAccidentPremium)) { if (StringUtils.isNotBlank(proxyAccidentPremium)) {
receivableTotal = receivableTotal.add(new BigDecimal(proxyAccidentPremium)); receivableTotal = receivableTotal.add(new BigDecimal(proxyAccidentPremium));
loanSolutionsDetail.setProxyAccidentPremium(new BigDecimal(proxyAccidentPremium));
} }
//上牌费 //上牌费
String registerAmount = dto.getRegisterAmount(); String registerAmount = dto.getRegisterAmount();
if (StringUtils.isNotBlank(registerAmount)) { if (StringUtils.isNotBlank(registerAmount)) {
receivableTotal = receivableTotal.add(new BigDecimal(registerAmount)); receivableTotal = receivableTotal.add(new BigDecimal(registerAmount));
loanSolutionsDetail.setRegisterAmount(new BigDecimal(registerAmount));
} }
//运管费 //运管费
String operationAmount = dto.getOperationAmount(); String operationAmount = dto.getOperationAmount();
if (StringUtils.isNotBlank(operationAmount)) { if (StringUtils.isNotBlank(operationAmount)) {
receivableTotal = receivableTotal.add(new BigDecimal(operationAmount)); receivableTotal = receivableTotal.add(new BigDecimal(operationAmount));
loanSolutionsDetail.setOperationAmount(new BigDecimal(operationAmount));
} }
//补车价 //补车价
String vehOtherPrice = dto.getVehOtherPrice(); String vehOtherPrice = dto.getVehOtherPrice();
if (StringUtils.isNotBlank(vehOtherPrice)) { if (StringUtils.isNotBlank(vehOtherPrice)) {
receivableTotal = receivableTotal.add(new BigDecimal(vehOtherPrice)); receivableTotal = receivableTotal.add(new BigDecimal(vehOtherPrice));
loanSolutionsDetail.setVehOtherPrice(new BigDecimal(vehOtherPrice));
} }
//其它费用 //其它费用
String otherAmount = dto.getOtherAmount(); String otherAmount = dto.getOtherAmount();
if (StringUtils.isNotBlank(otherAmount)) { if (StringUtils.isNotBlank(otherAmount)) {
receivableTotal = receivableTotal.add(new BigDecimal(otherAmount)); receivableTotal = receivableTotal.add(new BigDecimal(otherAmount));
loanSolutionsDetail.setOtherAmount(new BigDecimal(otherAmount));
} }
//其它费用说明 //其它费用说明
String otherAmountRemark = dto.getOtherAmountRemark(); String otherAmountRemark = dto.getOtherAmountRemark();
loanSolutionsDetail.setOtherAmountRemark(otherAmountRemark);
//办理方式选择 //办理方式选择
String dealWay = dto.getDealWay(); String dealWay = dto.getDealWay();
loanSolutionsDetail.setDealWay(dealWay);
//代收首年保险费 //代收首年保险费
String proxyPremium = dto.getProxyPremium(); String proxyPremium = dto.getProxyPremium();
if (StringUtils.isNotBlank(proxyPremium)) { if (StringUtils.isNotBlank(proxyPremium)) {
receivableTotal = receivableTotal.add(new BigDecimal(proxyPremium)); receivableTotal = receivableTotal.add(new BigDecimal(proxyPremium));
loanSolutionsDetail.setProxyPremium(new BigDecimal(proxyPremium));
} }
//代收购置费 //代收购置费
String proxyPurchasetax = dto.getProxyPurchasetax(); String proxyPurchasetax = dto.getProxyPurchasetax();
if (StringUtils.isNotBlank(proxyPurchasetax)) { if (StringUtils.isNotBlank(proxyPurchasetax)) {
receivableTotal = receivableTotal.add(new BigDecimal(proxyPurchasetax)); receivableTotal = receivableTotal.add(new BigDecimal(proxyPurchasetax));
loanSolutionsDetail.setProxyPurchasetax(new BigDecimal(proxyPurchasetax));
} }
//抵顶费用合计 = 抵顶首年保险费+抵顶购置税 //抵顶费用合计 = 抵顶首年保险费+抵顶购置税
BigDecimal offsetTotal = new BigDecimal(BigInteger.ZERO); BigDecimal offsetTotal = new BigDecimal(BigInteger.ZERO);
@ -263,11 +407,13 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
String offsetPremium = dto.getOffsetPremium(); String offsetPremium = dto.getOffsetPremium();
if (StringUtils.isNotBlank(offsetPremium)) { if (StringUtils.isNotBlank(offsetPremium)) {
offsetTotal = offsetTotal.add(new BigDecimal(offsetPremium)); offsetTotal = offsetTotal.add(new BigDecimal(offsetPremium));
loanSolutionsDetail.setOffsetPremium(new BigDecimal(offsetPremium));
} }
//抵顶购置税 //抵顶购置税
String offsetPurchasetax = dto.getOffsetPurchasetax(); String offsetPurchasetax = dto.getOffsetPurchasetax();
if (StringUtils.isNotBlank(offsetPurchasetax)) { if (StringUtils.isNotBlank(offsetPurchasetax)) {
offsetTotal = offsetTotal.add(new BigDecimal(offsetPurchasetax)); offsetTotal = offsetTotal.add(new BigDecimal(offsetPurchasetax));
loanSolutionsDetail.setOffsetPurchasetax(new BigDecimal(offsetPurchasetax));
} }
//实收合计 = 应收合计-抵顶合计 //实收合计 = 应收合计-抵顶合计
BigDecimal realTotal = receivableTotal.subtract(offsetTotal); BigDecimal realTotal = receivableTotal.subtract(offsetTotal);
@ -275,64 +421,18 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
String vehTotalPrice = dto.getVehTotalPrice(); String vehTotalPrice = dto.getVehTotalPrice();
//名义留购价 //名义留购价
String nominalPrice = dto.getNominalPrice(); String nominalPrice = dto.getNominalPrice();
//查询金融方案
LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(dto.getSaleOrderSid());
if (loanSolutions != null) {
//删除该销售订单的
baseMapper.deleteByOrderSid(dto.getSaleOrderSid());
loanSolutionsOtherpolicyService.deleteByLoanSid(loanSolutions.getSid());
loanSolutionsDetailService.deleteByLoanSid(loanSolutions.getSid());
}
BeanUtil.copyProperties(dto, loanSolutions);
//融资项目总额
loanSolutions.setLoanTotal(loanTotal);
//首付金额
loanSolutions.setDownPayAmount(downPayAmount);
//产品贷款金额
loanSolutions.setLoanAmount(loanAmount);
//贷款保证金
loanSolutions.setBondAmount(bondAmount);
baseMapper.insert(loanSolutions);
//其他融
LoanSolutionsOtherpolicy loanSolutionsOtherpolicy = new LoanSolutionsOtherpolicy();
loanSolutionsOtherpolicy.setSolutionsSid(loanSolutions.getSid());
BeanUtil.copyProperties(dto, loanSolutionsOtherpolicy);
//其它融贷款金额
loanSolutionsOtherpolicy.setOtherPolicyAmount(otherPolicyAmount);
//方案汇总:融资首付
loanSolutionsOtherpolicy.setLoanDownPay(loanDownPay);
//总贷款金额
loanSolutionsOtherpolicy.setLoanAmountTotal(loanAmountTotal);
//期数
loanSolutionsOtherpolicy.setPeriod(period);
//月还金额
loanSolutionsOtherpolicy.setMonthlyRepay(monthlyRepay);
//利息总额
loanSolutionsOtherpolicy.setInterest(interest);
loanSolutionsOtherpolicyService.insert(loanSolutionsOtherpolicy);
//费用明细
LoanSolutionsDetail loanSolutionsDetail = new LoanSolutionsDetail();
loanSolutionsDetail.setSolutionsSid(loanSolutions.getSid());
BeanUtil.copyProperties(dto, loanSolutionsDetail);
loanSolutionsDetail.setDownPayAmount(downPayAmounts);
//抵顶费用合计
loanSolutionsDetail.setOffsetTotal(offsetTotal);
//应收合计
loanSolutionsDetail.setReceivableTotal(receivableTotal);
//实收合计
loanSolutionsDetail.setRealTotal(realTotal); loanSolutionsDetail.setRealTotal(realTotal);
loanSolutionsDetail.setReceivableTotal(receivableTotal);
loanSolutionsDetail.setOffsetTotal(offsetTotal);
if (StringUtils.isNotBlank(vehTotalPrice)) {
loanSolutionsDetail.setVehTotalPrice(new BigDecimal(vehTotalPrice));
}
if (StringUtils.isNotBlank(nominalPrice)) {
loanSolutionsDetail.setNominalPrice(new BigDecimal(nominalPrice));
}
loanSolutionsDetailService.insert(loanSolutionsDetail); loanSolutionsDetailService.insert(loanSolutionsDetail);
} else {//外部金融的只需要录入厂家贴息 } else {//外部金融的只需要录入厂家贴息
//查询金融方案
LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(dto.getSaleOrderSid());
if (loanSolutions != null) {
//删除该销售订单的
baseMapper.deleteByOrderSid(dto.getSaleOrderSid());
loanSolutionsOtherpolicyService.deleteByLoanSid(loanSolutions.getSid());
loanSolutionsDetailService.deleteByLoanSid(loanSolutions.getSid());
}
//查询金融方案 //查询金融方案
loanSolutions = new LoanSolutions(); loanSolutions = new LoanSolutions();
BeanUtil.copyProperties(dto, loanSolutions); BeanUtil.copyProperties(dto, loanSolutions);
@ -340,6 +440,17 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
} }
return rb.success(); return rb.success();
} }
public ResultBean<SolutionsDetailsVo> selectDetailss(String businessSid) {
ResultBean<SolutionsDetailsVo> rb = ResultBean.fireFail();
SolutionsDetailsVo solutionsDetailsVo = new SolutionsDetailsVo();
LoanSolutions loanSolutions = baseMapper.selectBySaleOrderSid(businessSid);
if (loanSolutions == null) {
return rb;
}
BeanUtil.copyProperties(loanSolutions, solutionsDetailsVo);
return rb.success().setData(solutionsDetailsVo);
}
/* @Autowired /* @Autowired
private LoanSolutionsTopService loanSolutionsTopService; private LoanSolutionsTopService loanSolutionsTopService;
@Autowired @Autowired

13
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionsDetailsVo.java

@ -21,7 +21,7 @@ public class AppSolutionsDetailsVo implements Vo {
private String type; private String type;
private String typeKey; private String typeKey;
@ApiModelProperty("是否打包,0不打包,1打包") @ApiModelProperty("是否打包,0不打包,1打包")
private Integer isPack; private String isPack;
@ApiModelProperty("产品政策名称") @ApiModelProperty("产品政策名称")
private String policyName; private String policyName;
@ApiModelProperty("主车发票价") @ApiModelProperty("主车发票价")
@ -39,6 +39,17 @@ public class AppSolutionsDetailsVo implements Vo {
@ApiModelProperty("融资项目总额") @ApiModelProperty("融资项目总额")
private String loanTotal; private String loanTotal;
@ApiModelProperty("是否有融资票据")
private boolean accessoriesAmountCb;
@ApiModelProperty("是否有挂车")
private boolean trailerAmountCb;
@ApiModelProperty("是否有购置税")
private boolean purchaseTaxCb;
@ApiModelProperty("是否有保险")
private boolean premiumCb;
@ApiModelProperty("是否有车损上浮")
private boolean vehDamageFloatCb;
@ApiModelProperty("首付款比例") @ApiModelProperty("首付款比例")
private String downPayRatio; private String downPayRatio;
@ApiModelProperty("首付金额") @ApiModelProperty("首付金额")

12
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionsDto.java

@ -18,7 +18,7 @@ public class AppSolutionsDto implements Dto {
private String type; private String type;
private String typeKey; private String typeKey;
@ApiModelProperty("是否打包,0不打包,1打包") @ApiModelProperty("是否打包,0不打包,1打包")
private Integer isPack; private String isPack;
@ApiModelProperty("产品政策名称") @ApiModelProperty("产品政策名称")
private String policyName; private String policyName;
@ApiModelProperty("主车发票价") @ApiModelProperty("主车发票价")
@ -35,6 +35,16 @@ public class AppSolutionsDto implements Dto {
private String vehDamageFloat; private String vehDamageFloat;
@ApiModelProperty("融资项目总额") @ApiModelProperty("融资项目总额")
private String loanTotal; private String loanTotal;
@ApiModelProperty("是否有融资票据")
private boolean accessoriesAmountCb;
@ApiModelProperty("是否有挂车")
private boolean trailerAmountCb;
@ApiModelProperty("是否有购置税")
private boolean purchaseTaxCb;
@ApiModelProperty("是否有保险")
private boolean premiumCb;
@ApiModelProperty("是否有车损上浮")
private boolean vehDamageFloatCb;
@ApiModelProperty("首付款比例") @ApiModelProperty("首付款比例")
private String downPayRatio; private String downPayRatio;

13
doc/databases/risk_center.sql

@ -913,7 +913,7 @@ CREATE TABLE `loan_solutions`
`salesOrderSid` VARCHAR(64) DEFAULT NULL COMMENT '销售订单sid', `salesOrderSid` VARCHAR(64) DEFAULT NULL COMMENT '销售订单sid',
`type` VARCHAR(64) DEFAULT NULL COMMENT '类型', `type` VARCHAR(64) DEFAULT NULL COMMENT '类型',
`typeKey` VARCHAR(64) DEFAULT NULL COMMENT '类型key', `typeKey` VARCHAR(64) DEFAULT NULL COMMENT '类型key',
`isPack` int(32) DEFAULT NULL COMMENT '是否打包', `isPack` varchar(64) DEFAULT NULL COMMENT '是否打包',
`policyName` varchar(255) DEFAULT NULL COMMENT '产品政策', `policyName` varchar(255) DEFAULT NULL COMMENT '产品政策',
`policySid` varchar(64) DEFAULT NULL COMMENT '产品政策sid', `policySid` varchar(64) DEFAULT NULL COMMENT '产品政策sid',
`loanTotal` decimal(10, 2) DEFAULT NULL COMMENT '融资项目总额', `loanTotal` decimal(10, 2) DEFAULT NULL COMMENT '融资项目总额',
@ -923,16 +923,23 @@ CREATE TABLE `loan_solutions`
`purchaseTax` decimal(10, 2) DEFAULT NULL COMMENT '购置税', `purchaseTax` decimal(10, 2) DEFAULT NULL COMMENT '购置税',
`premium` decimal(10, 2) DEFAULT NULL COMMENT '保险金额', `premium` decimal(10, 2) DEFAULT NULL COMMENT '保险金额',
`vehDamageFloat` decimal(10, 2) DEFAULT NULL COMMENT '车损上浮', `vehDamageFloat` decimal(10, 2) DEFAULT NULL COMMENT '车损上浮',
`downPayRatio` varchar(100) DEFAULT NULL COMMENT '首付款比例', `downPayRatio` varchar(200) DEFAULT NULL COMMENT '首付款比例',
`downPayAmount` decimal(10, 2) DEFAULT NULL COMMENT '首付金额', `downPayAmount` decimal(10, 2) DEFAULT NULL COMMENT '首付金额',
`loanAmount` decimal(10, 2) DEFAULT NULL COMMENT '贷款金额', `loanAmount` decimal(10, 2) DEFAULT NULL COMMENT '贷款金额',
`loanPeriod` int(10) DEFAULT NULL COMMENT '贷款期数', `loanPeriod` varchar(32) DEFAULT NULL COMMENT '贷款期数',
`bondRatio` varchar(100) DEFAULT NULL COMMENT '保证金比例(%)', `bondRatio` varchar(100) DEFAULT NULL COMMENT '保证金比例(%)',
`bondAmount` decimal(10, 2) DEFAULT NULL COMMENT '保证金金额', `bondAmount` decimal(10, 2) DEFAULT NULL COMMENT '保证金金额',
`factoryDiscount` decimal(10, 2) DEFAULT NULL COMMENT '厂家贴息', `factoryDiscount` decimal(10, 2) DEFAULT NULL COMMENT '厂家贴息',
`policyYearRatio` decimal(10, 3) DEFAULT NULL COMMENT '政策年利率(%)', `policyYearRatio` decimal(10, 3) DEFAULT NULL COMMENT '政策年利率(%)',
`loanPayMoney` decimal(10, 2) DEFAULT NULL COMMENT '贷款月还', `loanPayMoney` decimal(10, 2) DEFAULT NULL COMMENT '贷款月还',
`loanInterest` decimal(10, 2) DEFAULT NULL COMMENT '贷款利息', `loanInterest` decimal(10, 2) DEFAULT NULL COMMENT '贷款利息',
`accessoriesAmountCb` int(10) DEFAULT NULL COMMENT '是否有融资票据:0否,1是',
`trailerAmountCb` int(10) DEFAULT NULL COMMENT '是否有挂车:0否,1是',
`purchaseTaxCb` int(10) DEFAULT NULL COMMENT '是否有购置税:0否,1是',
`premiumCb` int(10) DEFAULT NULL COMMENT '是否有保险:0否,1是',
`vehDamageFloatCb` int(10) DEFAULT NULL COMMENT '是否有车损上浮:0否,1是',
`otherPolicyState` int(10) DEFAULT NULL COMMENT '是否有其它融:0否,1是',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `id` (`id`) KEY `id` (`id`)
) ENGINE = INNODB ) ENGINE = INNODB

Loading…
Cancel
Save