添加灵活产品年利率和irr校验

This commit is contained in:
tangfutang 2021-01-14 16:15:52 +08:00
parent 4604a790a1
commit 5734ca8e9a
2 changed files with 26 additions and 4 deletions

View File

@ -185,12 +185,22 @@ public class CreateTransactionExecutor implements Transaction {
try {
Map<String, Map<String, String>> 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<String, Map<String, String>> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350");
Map<String, String> 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() );

View File

@ -90,6 +90,18 @@ public class ConditionHelper {
Map<String, Map<String, String>> 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<Map<String, String>> pslData = DataOperatorUtil.getDataBySql("select leasform from prd_specific_library where productid='"+bean.getProductId()+"'");
BigDecimal interestRate =null; // 利息税率