From 5734ca8e9af55e6db68e17028b648f977b919d8e Mon Sep 17 00:00:00 2001 From: tangfutang Date: Thu, 14 Jan 2021 16:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=81=B5=E6=B4=BB=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=B9=B4=E5=88=A9=E7=8E=87=E5=92=8Cirr=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../executor/CreateTransactionExecutor.java | 18 ++++++++++++++---- .../com/tenwa/reckon/help/ConditionHelper.java | 12 ++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index 0b6eeefd8..7a08930d2 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -185,12 +185,22 @@ public class CreateTransactionExecutor implements Transaction { try { Map> productRevenues = ProductParamUtil.getProductComponentType( tcb.getProductId(), "PRD0390" ); tcb.setProductRevenues( productRevenues ); - //年利率和成本利率不一样,对应的年利率改在页面进行校验 - /*String rateMin = productRevenues.get( "CostInterestRate" ).get( "CostInterestRate-MIN" ); - String rateMax = productRevenues.get( "CostInterestRate" ).get( "CostInterestRate-MAX" ); + + Map> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350"); + Map productRate = productRates.get("product_rate"); + String isFixedRate = productRate.get("isFixedRate"); + if("Y".equals(isFixedRate)){//固定利率校验 + String prodRate = productRate.get("ProductRate"); + if(!(yearRate.compareTo(new BigDecimal( prodRate )) == 0) ){ + throw new BusinessException( "测算年利率跟产品配置的不相等,请检查!" ); + } + } + //区间利率校验 + String rateMin = productRate.get("RateTermScope-MIN"); + String rateMax = productRate.get("RateTermScope-MAX"); if ( !( yearRate.compareTo( new BigDecimal( rateMax ) ) <= 0 && yearRate.compareTo( new BigDecimal( rateMin ) ) >= 0 ) ) { throw new BusinessException( "年利率: " + yearRate.setScale( 6, 4 ).toString() + ",不在产品配置区间范围内" ); - }*/ + } } catch ( Exception e ) { e.printStackTrace(); throw new BusinessException( e.getMessage() ); diff --git a/calc/com/tenwa/reckon/help/ConditionHelper.java b/calc/com/tenwa/reckon/help/ConditionHelper.java index fef064cb9..b00be94e4 100644 --- a/calc/com/tenwa/reckon/help/ConditionHelper.java +++ b/calc/com/tenwa/reckon/help/ConditionHelper.java @@ -90,6 +90,18 @@ public class ConditionHelper { Map> productRevenues = bean.getProductRevenues(); String roaValue = productRevenues.get( "StrategyROA" ).get( "StrategyROA" ); //String roaMax = productRevenues.get( "StrategyROA" ).get( "StrategyROA-MAX" ); + if(roaValue == null || roaValue.isEmpty()){ + throw new BusinessException( "灵活产品ROA必须配置,请联业务人员!" ); + } + BigDecimal irr = new BigDecimal ( cb.getIrr() ) ; + String irrMin = productRevenues.get( "IRR" ).get( "IRR-MIN" ); + String irrMan = productRevenues.get( "IRR" ).get( "IRR-MAX" ); + if(irrMin == null || irrMin.isEmpty() || irrMan == null || irrMan.isEmpty()){ + throw new BusinessException( "灵活产品IRR区间值必须配置,请联业务人员!" ); + } + if( !( irr.compareTo( new BigDecimal( irrMan ) ) <= 0 && irr.compareTo( new BigDecimal( irrMin ) ) >= 0 ) ){ + throw new BusinessException( "IRR: "+irr.setScale( 2, 4 ).toString()+",不在产品配置区间范围内!" ); + } //修改计算中的税率取值 List> pslData = DataOperatorUtil.getDataBySql("select leasform from prd_specific_library where productid='"+bean.getProductId()+"'"); BigDecimal interestRate =null; // 利息税率