Browse Source

Merge remote-tracking branch 'origin/master'

master
God 2 years ago
parent
commit
6c6d8d66b9
  1. 3
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java
  2. 8
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorderreturnvehapply/BusSalesOrderReturnVehApplyVo.java
  3. 4
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java
  4. 3
      anrui-buscenter/anrui-buscenter-ui/src/views/workflow/xiaoshouguanliFlow/xiaoshoudingdantuicheFlow/salesorderbycarDaiBanInfo.vue
  5. 2
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdantuiche/salesorderbycar.vue
  6. 1
      anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/AppCrmCustomerTempDto.java
  7. 3
      anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempDto.java
  8. 7
      anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java
  9. 10
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  10. 17
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutions.java
  11. 4
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutionsFeign.java
  12. 5
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/LoanSolutionsFeignFallback.java
  13. 12
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDetailsVo.java
  14. 38
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDto.java
  15. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsdetail/LoanSolutionsDetail.java
  16. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsotherpolicy/LoanSolutionsOtherpolicy.java
  17. 5
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsRest.java
  18. 329
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java
  19. 15
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionsDetailsVo.java
  20. 14
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionsDto.java
  21. 3
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/SolutionsFeign.java
  22. 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);

8
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorderreturnvehapply/BusSalesOrderReturnVehApplyVo.java

@ -26,14 +26,14 @@
package com.yxt.anrui.buscenter.api.bussalesorderreturnvehapply; package com.yxt.anrui.buscenter.api.bussalesorderreturnvehapply;
import com.yxt.common.core.vo.Vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date; import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* Project: anrui_buscenter(销售订单退车) <br/> * Project: anrui_buscenter(销售订单退车) <br/>
* File: BusSalesOrderReturnVehApplyVo.java <br/> * File: BusSalesOrderReturnVehApplyVo.java <br/>
@ -76,4 +76,6 @@ public class BusSalesOrderReturnVehApplyVo implements Vo {
private String procInsId; // 流程实例id private String procInsId; // 流程实例id
@ApiModelProperty("任务编号id") @ApiModelProperty("任务编号id")
private String deployId; // 任务编号id private String deployId; // 任务编号id
private String procDefId;
} }

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

@ -1572,7 +1572,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
} }
//查询该销售订单是否存在金融方案 //查询该销售订单是否存在金融方案
//ToDo: //ToDo:
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetails(saleOrderSid); ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(saleOrderSid);
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData(); SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData();
if (solutionsDetailsVo == null) { if (solutionsDetailsVo == null) {
vo.setFinanceInfoState(0); vo.setFinanceInfoState(0);
@ -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())) {

3
anrui-buscenter/anrui-buscenter-ui/src/views/workflow/xiaoshouguanliFlow/xiaoshoudingdantuicheFlow/salesorderbycarDaiBanInfo.vue

@ -373,5 +373,8 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.rowClass{
border-top: 1px solid #E0E3EB;
}
</style> </style>

2
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdantuiche/salesorderbycar.vue

@ -201,7 +201,7 @@ export default {
this.centerDialogVisible = true this.centerDialogVisible = true
var params = { var params = {
deployId: row.procDefId, deployId: row.procDefId,
procInsId: row.procInstId, procInsId: row.procInsId,
token: getStorage() token: getStorage()
} }
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params))) this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))

1
anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/AppCrmCustomerTempDto.java

@ -162,4 +162,5 @@ public class AppCrmCustomerTempDto implements Dto {
@ApiModelProperty("身份证正反面") @ApiModelProperty("身份证正反面")
private List<String> filePaths = Collections.emptyList(); private List<String> filePaths = Collections.emptyList();
} }

3
anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempDto.java

@ -138,4 +138,7 @@ public class CrmCustomerTempDto implements Dto {
private List<PcCrmVisitAppendixDto> crmVisitAppendixDtoList; private List<PcCrmVisitAppendixDto> crmVisitAppendixDtoList;
private String orgPath;
} }

7
anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java

@ -839,7 +839,12 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa
dto.fillEntity(crmCustomerTemp); dto.fillEntity(crmCustomerTemp);
crmCustomerTemp.setCreateBySid(dto.getUserSid()); crmCustomerTemp.setCreateBySid(dto.getUserSid());
crmCustomerTemp.setStaffSid(sysUserInfoVo.getStaffSid()); crmCustomerTemp.setStaffSid(sysUserInfoVo.getStaffSid());
String orgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData(); String orgSid = "";
if (StringUtils.isNotBlank(dto.getOrgPath())) {
orgSid = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()).getData();
} else {
orgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData();
}
crmCustomerTemp.setCreateOrgSid(orgSid); crmCustomerTemp.setCreateOrgSid(orgSid);
ResultBean resultBean = dictCommonFeign.getFirstDictKeyByType(DictCommonType.FOLLOW_STATE, "0"); ResultBean resultBean = dictCommonFeign.getFirstDictKeyByType(DictCommonType.FOLLOW_STATE, "0");
if (resultBean.getSuccess() && resultBean.getData() != null) { if (resultBean.getSuccess() && resultBean.getData() != null) {

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();

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

@ -80,182 +80,328 @@ 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));
}else{
loanSolutions.setFactoryDiscount(new BigDecimal(BigInteger.ZERO));
}
//年利率
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 +409,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 +423,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 +442,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

15
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,19 @@ 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("是否勾选其它融")
private boolean otherPolicyState;
@ApiModelProperty("首付款比例") @ApiModelProperty("首付款比例")
private String downPayRatio; private String downPayRatio;
@ApiModelProperty("首付金额") @ApiModelProperty("首付金额")

14
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,18 @@ 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("是否勾选其它融")
private boolean otherPolicyState;
@ApiModelProperty("首付款比例") @ApiModelProperty("首付款比例")
private String downPayRatio; private String downPayRatio;

3
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/SolutionsFeign.java

@ -4,6 +4,7 @@ import com.yxt.common.core.result.ResultBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -26,7 +27,7 @@ public interface SolutionsFeign {
ResultBean save(@RequestBody AppSolutionsDto dto); ResultBean save(@RequestBody AppSolutionsDto dto);
@ApiOperation("初始化金融方案") @ApiOperation("初始化金融方案")
@PostMapping("/selectDetailsVo") @GetMapping("/selectDetailsVo")
ResultBean<AppSolutionsDetailsVo> selectDetailsVo(@RequestParam("saleOrderSid") String saleOrderSid); ResultBean<AppSolutionsDetailsVo> selectDetailsVo(@RequestParam("saleOrderSid") String saleOrderSid);

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