Browse Source

金融方案添加其他融贴息

master
dimengzhe 2 years ago
parent
commit
feffbdf0be
  1. 2
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApply.java
  2. 10
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeign.java
  3. 10
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeignFallback.java
  4. 67
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/UnBusDeliveredApplyDto.java
  5. 2
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/SolutionsDetailsssVo.java
  6. 12
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyRest.java
  7. 84
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java
  8. 2
      anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmvehicledemand/AppCrmSolutions.java
  9. 1
      anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java
  10. 3
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/SolutionDetailsDto.java
  11. 4
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDetailsVo.java
  12. 1
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionsDto.java
  13. 3
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionssDto.java
  14. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionssQuery.java
  15. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionssVo.java
  16. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/calculate/CalculateQuery.java
  17. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/calculate/CalculateVo.java
  18. 3
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutionsotherpolicy/LoanSolutionsOtherpolicy.java
  19. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loantemplate/LoanTemplateSolutionsDto.java
  20. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loantemplate/LoanTemplateSolutionsVo.java
  21. 60
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansolutions/LoanSolutionsService.java
  22. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionQuery.java
  23. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionVo.java
  24. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionssDto.java

2
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApply.java

@ -125,4 +125,6 @@ public class BusDeliveredApply extends BaseEntity {
private String hasInvoiceKey;
@ApiModelProperty("是否开票(1开票,0不开票)")
private String hasInvoice;
@ApiModelProperty("类型:0正常出库,1欠款出库")
private int typeState;
}

10
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeign.java

@ -70,6 +70,7 @@ public interface BusDeliveredApplyFeign {
@ResponseBody
public ResultBean<PagerVo<BusDeliveredApplyVo>> listPage(@RequestBody PagerQuery<BusDeliveredApplyQuery> pq);
/**
* 出库申请新增或修改
*
@ -230,5 +231,14 @@ public interface BusDeliveredApplyFeign {
@ResponseBody
ResultBean<DeliveredFinVo> deliveredFinSelectByBusVinSid(@RequestParam("contractNo") String contractNo, @RequestParam("vinSid") String vinSid);
@ApiOperation("欠款出库申请分页列表")
@PostMapping("/unListPage")
@ResponseBody
public ResultBean<PagerVo<BusDeliveredApplyVo>> unListPage(@RequestBody PagerQuery<BusDeliveredApplyQuery> pq);
@ApiOperation("欠款出库保存")
@PostMapping("/unSave")
@ResponseBody
public ResultBean unSave(@RequestBody UnBusDeliveredApplyDto dto);
}

10
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeignFallback.java

@ -131,6 +131,16 @@ public class BusDeliveredApplyFeignFallback implements BusDeliveredApplyFeign {
return null;
}
@Override
public ResultBean<PagerVo<BusDeliveredApplyVo>> unListPage(PagerQuery<BusDeliveredApplyQuery> pq) {
return null;
}
@Override
public ResultBean unSave(UnBusDeliveredApplyDto dto) {
return null;
}
@Override
public ResultBean complete(BusDeliveredApplyCompleteDto query) {
return null;

67
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/UnBusDeliveredApplyDto.java

@ -0,0 +1,67 @@
package com.yxt.anrui.buscenter.api.busdeliveredapply;
import com.yxt.anrui.buscenter.api.busdeliveredapplydetails.BusDeliveredApplyDetailsDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @description:
* @author: dimengzhe
* @date: 2023/10/7
**/
@Data
public class UnBusDeliveredApplyDto {
@ApiModelProperty(value = "出库申请sid")
private String sid;
private String userSid;
@ApiModelProperty("发起部门sid")
private String applyDeptSid;
@ApiModelProperty("发起部门")
private String applyDept;
@ApiModelProperty("发起人sid")
private String applySid;
@ApiModelProperty("发起人")
private String applyName;
@ApiModelProperty("销售部门sid")
private String staffDeptSid;
@ApiModelProperty("销售部门")
private String staffDeptName;
@ApiModelProperty("销售专员用户sid")
private String staffUserSid;
@ApiModelProperty("销售专员")
private String staffName;
@ApiModelProperty("销售类型key")
private String paymentMethodKey;
@ApiModelProperty("销售类型")
private String paymentMethod;
@ApiModelProperty("合同编号")
private String contractNo;
@ApiModelProperty("客户名称")
private String name;
@ApiModelProperty("客户手机号")
private String mobile;
@ApiModelProperty("车型别名")
private String modelName;
@ApiModelProperty("贷款人")
private String loanName;
@ApiModelProperty("贷款人手机号")
private String loanMobile;
@ApiModelProperty("实际购车人类型:0订单客户,1贷款人,2其他人")
private String type;
@ApiModelProperty(value = "出库申请的车辆信息")
private List<BusDeliveredApplyDetailsDto> detailsList;
private String orgPath;
@ApiModelProperty("成交价")
private String price;
@ApiModelProperty("返利人sid")
private String distributorName;
@ApiModelProperty("返利金额1")
private String distributorPrice;
@ApiModelProperty("返利人2sid")
private String distributorNameTwo;
@ApiModelProperty("返利金额2")
private String distributorPriceTwo;
}

2
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/SolutionsDetailsssVo.java

@ -92,6 +92,8 @@ public class SolutionsDetailsssVo {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

12
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyRest.java

@ -195,6 +195,18 @@ public class BusDeliveredApplyRest implements BusDeliveredApplyFeign {
return busDeliveredApplyService.deliveredFinSelectByBusVinSid(contractNo,vinSid);
}
@Override
public ResultBean<PagerVo<BusDeliveredApplyVo>> unListPage(PagerQuery<BusDeliveredApplyQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<BusDeliveredApplyVo> pv = busDeliveredApplyService.unListPage(pq);
return rb.success().setData(pv);
}
@Override
public ResultBean unSave(UnBusDeliveredApplyDto dto) {
return busDeliveredApplyService.unSave(dto);
}
@Override
public ResultBean complete(BusDeliveredApplyCompleteDto query) {
BusinessVariables bv = new BusinessVariables();

84
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

@ -352,6 +352,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
} else {
qw.eq("bd.applySid", query.getApplySid());
}
qw.eq("bd.typeState",0);
}
IPage<BusDeliveredApply> page = PagerUtil.queryToPage(pq);
IPage<BusDeliveredApplyVo> pagging = baseMapper.selectPageVo(page, qw);
@ -2109,6 +2110,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
qw.eq("useOrgSid", orgSid);
qw.eq("applySid", pagerQuery.getParams().getUserSid());
}
qw.eq("bd.typeState",0);
IPage<AppDeliveredApplyPageQuery> page = PagerUtil.queryToPage(pagerQuery);
IPage<AppDeliveredApplyPageVo> iPage = baseMapper.getRetrievalApplyList(page, qw, pagerQuery.getParams().getName());
List<AppDeliveredApplyPageVo> records = iPage.getRecords();
@ -3010,4 +3012,86 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
}
return rb.success().setData(deliveredFinVo);
}
public PagerVo<BusDeliveredApplyVo> unListPage(PagerQuery<BusDeliveredApplyQuery> pq) {
BusDeliveredApplyQuery query = pq.getParams();
QueryWrapper<BusDeliveredApply> qw = new QueryWrapper<>();
if (query != null) {
//合同编号
if (StringUtils.isNotBlank(query.getContractNo())) {
qw.like("bd.contractNo", query.getContractNo());
}
//客户名称
if (StringUtils.isNotBlank(query.getName())) {
qw.like("bd.name", query.getName());
}
if (StringUtils.isNotBlank(query.getApplyDateStart()) && StringUtils.isNotBlank(query.getApplyDateEnd())) {
qw.between("bd.createTime", query.getApplyDateStart(), query.getApplyDateEnd());
}
if (StringUtils.isNotBlank(query.getApplyName())) {
qw.like("bd.applyName", query.getApplyName());
}
if (StringUtils.isNotBlank(query.getPaymentMethodKey())) {
qw.eq("bd.paymentMethodKey", query.getPaymentMethodKey());
}
//========================================数据授权开始
if (StringUtils.isNotBlank(query.getMenuUrl())) {
PrivilegeQuery privilegeQuery = new PrivilegeQuery();
privilegeQuery.setOrgPath(query.getOrgPath());
privilegeQuery.setMenuUrl(query.getMenuUrl());
privilegeQuery.setUserSid(query.getApplySid());
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery);
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) {
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
String orgSidPath = query.getOrgPath();
orgSidPath = orgSidPath + "/";
int i1 = orgSidPath.indexOf("/");
int i2 = orgSidPath.indexOf("/", i1 + 1);
int i3 = orgSidPath.indexOf("/", i2 + 1);
int i4 = orgSidPath.indexOf("/", i3 + 1);
String orgLevelKey = defaultIdReltBean.getData();
if ("1".equals(orgLevelKey)) {
orgSidPath = orgSidPath.substring(0, i1);
qw.like("bd.orgSidPath", orgSidPath);
} else if ("2".equals(orgLevelKey)) {
orgSidPath = orgSidPath.substring(0, i2);
qw.like("bd.orgSidPath", orgSidPath);
} else if ("3".equals(orgLevelKey)) {
orgSidPath = orgSidPath.substring(0, i3);
qw.like("bd.orgSidPath", orgSidPath);
} else if ("4".equals(orgLevelKey)) {
orgSidPath = orgSidPath.substring(0, i4);
qw.like("bd.orgSidPath", orgSidPath);
} else if ("5".equals(orgLevelKey)) {
qw.eq("bd.createBySid", query.getApplySid());
} else {
PagerVo<BusDeliveredApplyVo> p = new PagerVo<>();
return p;
}
} else {
PagerVo<BusDeliveredApplyVo> p = new PagerVo<>();
return p;
}
} else {
qw.eq("bd.applySid", query.getApplySid());
}
qw.eq("typeState",1);
}
IPage<BusDeliveredApply> page = PagerUtil.queryToPage(pq);
IPage<BusDeliveredApplyVo> pagging = baseMapper.selectPageVo(page, qw);
List<BusDeliveredApplyVo> records = pagging.getRecords();
for (BusDeliveredApplyVo record : records) {
if (query.getApplySid().equals(record.getCreateBySid())) {
record.setAllowModify(true);
} else {
record.setAllowModify(false);
}
}
PagerVo<BusDeliveredApplyVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public ResultBean unSave(UnBusDeliveredApplyDto dto) {
return null;
}
}

2
anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmvehicledemand/AppCrmSolutions.java

@ -97,6 +97,8 @@ public class AppCrmSolutions {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

1
anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java

@ -35,6 +35,7 @@ public enum ProcDefEnum {
BASEACCADJAPPLY("调账申请", "process_r6pyzqoz:4:1362508"),
// BUSDELIVEREDAPPLY("出库申请", "process_wgt1n66l:10:1700004"),
BUSDELIVEREDAPPLY("出库申请", "process_30ixry76:2:5357504"),
QKBUSDELIVEREDAPPLY("欠款出库申请", ""),
BASESHUNINVOICAPPLY("调车开票申请", "process_u4xrvaso:1:400008"),
BASEVEHINSTALLMODPRICE("上装调价申请", "process_s0a0svth:1:492508"),
SCMVEHREBATEWITHAPPLY("单车返利预提申请", "process_qegarc7r:1:535004"),

3
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/SolutionDetailsDto.java

@ -95,6 +95,9 @@ public class SolutionDetailsDto implements Dto {
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
private String otherPolicySid;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

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

@ -100,6 +100,10 @@ public class SolutionsDetailsVo implements Vo {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

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

@ -97,6 +97,7 @@ public class SolutionsDto implements Dto {
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("'融资首付")
private String loanDownPay;
@ApiModelProperty("总贷款金额")

3
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionssDto.java

@ -95,6 +95,9 @@ public class SolutionssDto implements Dto {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionssQuery.java

@ -72,6 +72,8 @@ public class SolutionssQuery implements Query {
private String returnTime;
private String otherPolicySid;
private String otherPolicyName;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
/*********************************金融方案费用明细*****************************/

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/app/SolutionssVo.java

@ -91,6 +91,8 @@ public class SolutionssVo implements Vo {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
/*************************方案汇总*********************************/
@ApiModelProperty("'融资首付")
private String loanDownPay;

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/calculate/CalculateQuery.java

@ -63,6 +63,8 @@ public class CalculateQuery {
private String otherPolicyYearRatio;
@ApiModelProperty("其他融sid")
private String otherPolicySid;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
/*********************************金融方案费用明细*****************************/

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansolutions/calculate/CalculateVo.java

@ -27,6 +27,8 @@ public class CalculateVo {
private String otherPolicyMonthlyRepay;
@ApiModelProperty("其它融利息总额")
private String otherPolicyInterest;
@ApiModelProperty("其他融年利率")
private String otherPolicyYearRatio;
/***********方案汇总*************/
@ApiModelProperty("'融资首付")

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

@ -82,6 +82,9 @@ public class LoanSolutionsOtherpolicy extends BaseEntity {
@ApiModelProperty("实际首付比例")
private String downPayAmountsRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
}

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loantemplate/LoanTemplateSolutionsDto.java

@ -90,6 +90,8 @@ public class LoanTemplateSolutionsDto implements Dto {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loantemplate/LoanTemplateSolutionsVo.java

@ -82,6 +82,8 @@ public class LoanTemplateSolutionsVo implements Vo {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

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

@ -1318,16 +1318,27 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
BigDecimal policyYearRatioNew = simpleCalculateRate(new BigDecimal(loanPeriod).doubleValue(), loanPayMoneyNew.doubleValue(), -loanAmount.doubleValue()).multiply(new BigDecimal("12")).multiply(new BigDecimal("100"));
//四舍五入取两位小数
policyYearRatioNew = policyYearRatioNew.setScale(2, BigDecimal.ROUND_HALF_UP);
if(policyYearRatioNew.compareTo(BigDecimal.ZERO)<0){
//根据年利率和期数、贷款金额计算月还
loanPayMoneyNew = calculatePMT(BigDecimal.ZERO.divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(loanPeriod).doubleValue(), loanAmount.doubleValue());
//根据月还计算利息总额=月还金额 乘以 期数 减去 本金
loanInterestNew = loanPayMoney.multiply(new BigDecimal(loanPeriod)).subtract(loanAmount);
//四舍五入取整数
loanPayMoneyNew = loanPayMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
loanInterestNew = loanInterest.setScale(0, BigDecimal.ROUND_HALF_UP);
loanPayMoneyAll = loanPayMoneyAll.add(loanPayMoneyNew);
policyYearRatioNew = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
}else{
//四舍五入取整数
loanPayMoneyNew = loanPayMoneyNew.setScale(0, BigDecimal.ROUND_HALF_UP);
loanInterestNew = loanInterestNew.setScale(0, BigDecimal.ROUND_HALF_UP);
}
loanPayMoneyAll = loanPayMoneyAll.add(loanPayMoneyNew);
interstAll = interstAll.add(loanInterestNew);
yueAll = yueAll.add(loanPayMoneyNew.multiply(new BigDecimal(loanPeriod)));
calculateVo.setLoanInterest(loanInterestNew.toString());
calculateVo.setPolicyYearRatio(policyYearRatioNew.toString());
calculateVo.setLoanPayMoney(loanPayMoneyNew.toString());
} else {
//年利率
BigDecimal policyYearRatio = loanFinPolicy.getYearRatio();
@ -1364,6 +1375,42 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
if (StringUtils.isBlank(otherPolicyPeriod)) {
otherPolicyPeriod = "0";
}
//其他融贴息
String otherDiscount = query.getOtherDiscount();
if (StringUtils.isNotBlank(otherDiscount) && !"0".equals(otherDiscount)) {
//根据年利率和期数、贷款金额计算旧月还
BigDecimal otherPolicyMonthlyRepay = calculatePMT(new BigDecimal(otherPolicyYearRatio).divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(loanPeriod).doubleValue(), loanAmount.doubleValue());
//根据月还计算旧利息总额=旧月还金额 乘以 期数 减去 本金
BigDecimal otherPolicyInterest = otherPolicyMonthlyRepay.multiply(new BigDecimal(otherPolicyPeriod)).subtract(new BigDecimal(otherPolicyAmount));
//根据旧利息总额和厂家贴息计算新利息总额
BigDecimal otherPolicyInterestNew = otherPolicyInterest.subtract(new BigDecimal(otherDiscount));
//再根据厂家贴息、旧月还计算新月还金额 = 旧月还金额 减去 厂家贴息 除以 期数
BigDecimal otherPolicyMonthlyRepayNew = otherPolicyMonthlyRepay.subtract(new BigDecimal(otherDiscount).divide(new BigDecimal(otherPolicyPeriod), 4, BigDecimal.ROUND_HALF_UP));
//根据新月还rate计算新年利率。
BigDecimal otherPolicyYearRatioNew = simpleCalculateRate(new BigDecimal(otherPolicyPeriod).doubleValue(), otherPolicyMonthlyRepayNew.doubleValue(), -new BigDecimal(otherPolicyAmount).doubleValue()).multiply(new BigDecimal("12")).multiply(new BigDecimal("100"));
//四舍五入取两位小数
otherPolicyYearRatioNew = otherPolicyYearRatioNew.setScale(2, BigDecimal.ROUND_HALF_UP);
if(otherPolicyYearRatioNew.compareTo(BigDecimal.ZERO)<0){
//根据年利率和期数、贷款金额计算月还
otherPolicyMonthlyRepayNew = calculatePMT(BigDecimal.ZERO.divide(new BigDecimal("100"), 4, BigDecimal.ROUND_CEILING).doubleValue(), new BigDecimal(otherPolicyPeriod).doubleValue(), new BigDecimal(otherPolicyAmount).doubleValue());
//根据月还计算利息总额=月还金额 乘以 期数 减去 本金
otherPolicyInterestNew = otherPolicyMonthlyRepay.multiply(new BigDecimal(otherPolicyPeriod)).subtract(new BigDecimal(otherPolicyAmount));
//四舍五入取整数
otherPolicyMonthlyRepayNew = otherPolicyMonthlyRepayNew.setScale(0, BigDecimal.ROUND_HALF_UP);
otherPolicyInterestNew = otherPolicyInterestNew.setScale(0, BigDecimal.ROUND_HALF_UP);
otherPolicyYearRatioNew = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
}else{
//四舍五入取整数
otherPolicyMonthlyRepayNew = otherPolicyMonthlyRepayNew.setScale(0, BigDecimal.ROUND_HALF_UP);
otherPolicyInterestNew = otherPolicyInterestNew.setScale(0, BigDecimal.ROUND_HALF_UP);
}
loanPayMoneyAll = loanPayMoneyAll.add(otherPolicyMonthlyRepayNew);
interstAll = interstAll.add(otherPolicyInterestNew);
yueAll = yueAll.add(otherPolicyMonthlyRepayNew.multiply(new BigDecimal(otherPolicyPeriod)));
calculateVo.setOtherPolicyInterest(otherPolicyInterestNew.toString());
calculateVo.setOtherPolicyYearRatio(otherPolicyYearRatioNew.toString());
calculateVo.setOtherPolicyMonthlyRepay(otherPolicyMonthlyRepayNew.toString());
}else{
loanDownPay = loanDownPay.subtract(new BigDecimal(otherPolicyAmount));
//总贷款金额的计算
loanAmountTotal = loanAmountTotal.add(new BigDecimal(otherPolicyAmount));
@ -1379,6 +1426,8 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
yueAll = yueAll.add(otherPolicyMonthlyRepay.multiply(new BigDecimal(otherPolicyPeriod)));
calculateVo.setOtherPolicyInterest(otherPolicyInterest.toString());
calculateVo.setOtherPolicyMonthlyRepay(otherPolicyMonthlyRepay.toString());
}
} else {
otherPolicyPeriod = "0";
}
@ -1991,6 +2040,15 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper
otherPolicyMonthlyRepayValue = otherPolicyMonthlyRepayValue.append("月还金额:").append("-");
}
list.add(getValueSpanSize(otherPolicyMonthlyRepayValue.toString(), 2, 0, false));
//其他融贴息
StringBuilder otherDiscountValue = new StringBuilder();
if (StringUtils.isNotBlank(solutionssVo.getOtherPolicyMonthlyRepay())) {
otherDiscountValue = otherDiscountValue.append("其它融贴息:").append(solutionssVo.getOtherDiscount());
} else {
otherDiscountValue = otherDiscountValue.append("其它融贴息:").append("-");
}
list.add(getValueSpanSize(otherDiscountValue.toString(), 2, 0, false));
}
//方案汇总
list.add(getValueSpanSize("方案汇总", 2, 1, true));

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionQuery.java

@ -73,6 +73,8 @@ public class AppSolutionQuery implements Query {
private String returnTime;
private String otherPolicySid;
private String otherPolicyName;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
/*********************************金融方案费用明细*****************************/

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionVo.java

@ -118,6 +118,8 @@ public class AppSolutionVo {
private String otherPolicyYearRatio;
private boolean otherPolicyIsMain;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
@JsonSerialize(using = ToStringSerializer.class)

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/solutions/AppSolutionssDto.java

@ -99,6 +99,8 @@ public class AppSolutionssDto implements Dto {
private String otherPolicyInterest;
@ApiModelProperty("其它融年利率")
private String otherPolicyYearRatio;
@ApiModelProperty("其他融贴息")
private String otherDiscount;
@ApiModelProperty("'融资首付")
private String loanDownPay;

Loading…
Cancel
Save