修改贴息校验和租金计划还款日的默认规则
This commit is contained in:
parent
f9e66cf4d4
commit
638ad6892a
@ -330,10 +330,10 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
if("ZC".equals(channel)){
|
||||
planDateList = getPlanDateListZC(incomeNumber, incomeIntervalMonth, startDate);
|
||||
}else{
|
||||
if("02".equals(defaultDueDay)) {
|
||||
planDateList = getPlanDateListFixed(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
} else {
|
||||
if("01".equals(defaultDueDay)) {
|
||||
planDateList = getPlanDateList(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
} else {
|
||||
planDateList = getPlanDateListFixed(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -76,13 +76,20 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor {
|
||||
String afterDiscountRent = RentTools.getPMT( preDiscountRate.toString(), incomeNumber.toString(), cleanLeaseMoney.negate().toString(), "0", "0" );
|
||||
// 计算贴息
|
||||
BigDecimal discount = new BigDecimal( rent ).setScale( 2, 4 ).multiply( incomeNumber ).subtract( new BigDecimal( afterDiscountRent ).setScale( 2, 4 ).multiply( incomeNumber ) );
|
||||
bo.setAttributeValue( "DISCOUNT_INTEREST", discount );
|
||||
//客户要求,如果算出的贴息比配置的大,贴息金额为配置的最大金额,算出的贴息金额小于配置的最小值,贴息金额为配置的最小值,产品利率和融资利率不做调整
|
||||
if ( discount.compareTo( new BigDecimal( bo.getAttribute( "MAXIMUM_DISCOUNT" ).getString() ) ) > 0 ) {
|
||||
bo.setAttributeValue( "DISCOUNT_INTEREST", bo.getAttribute( "MAXIMUM_DISCOUNT" ).getString() );
|
||||
}else if ( discount.compareTo( new BigDecimal( bo.getAttribute( "MINIMUM_DISCOUNT" ).getString() ) ) < 0 ){
|
||||
bo.setAttributeValue( "DISCOUNT_INTEREST", bo.getAttribute( "MINIMUM_DISCOUNT" ).getString() );
|
||||
}else {
|
||||
bo.setAttributeValue( "DISCOUNT_INTEREST", discount );
|
||||
}
|
||||
|
||||
String fr = bo.getAttribute( "FINANCING_RATE" ).getString();
|
||||
|
||||
if ( StringUtils.isEmpty( fr ) || ( iulma!=null && "Y".equals(iulma) ) ) {
|
||||
financingRate = discountRate.divide( new BigDecimal( 100 ), 20, 4 );
|
||||
bo.setAttributeValue( "FINANCING_RATE", discountRate.toString() );
|
||||
financingRate = discountRate;
|
||||
bo.setAttributeValue( "FINANCING_RATE", discountRate.multiply( new BigDecimal( 100 ) ).toString() );
|
||||
} else {
|
||||
financingRate = new BigDecimal( fr ).divide( new BigDecimal( 100 ), 20, 4 );
|
||||
}
|
||||
@ -118,9 +125,13 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor {
|
||||
}
|
||||
//校验贴息是否在配置的区间内
|
||||
BigDecimal discountCheck = new BigDecimal( bo.getAttribute( "DISCOUNT_INTEREST" ).getString() );
|
||||
if ( !( discountCheck.compareTo( new BigDecimal( bo.getAttribute( "MAXIMUM_DISCOUNT" ).getString() ) ) <= 0 && discountCheck.compareTo( new BigDecimal( bo.getAttribute( "MINIMUM_DISCOUNT" ).getString() ) ) >= 0 ) ) {
|
||||
throw new BusinessException( "分段融的第"+subsectionNumber+"段的贴息金额不在产品配置的区间内!" );
|
||||
if(discountCheck.compareTo( new BigDecimal( bo.getAttribute( "MAXIMUM_DISCOUNT" ).getString() ) ) < 0) {
|
||||
|
||||
}
|
||||
|
||||
/* if ( !( discountCheck.compareTo( new BigDecimal( bo.getAttribute( "MAXIMUM_DISCOUNT" ).getString() ) ) <= 0 && discountCheck.compareTo( new BigDecimal( bo.getAttribute( "MINIMUM_DISCOUNT" ).getString() ) ) >= 0 ) ) {
|
||||
throw new BusinessException( "分段融的第"+subsectionNumber+"段的贴息金额不在产品配置的区间内!" );
|
||||
}*/
|
||||
|
||||
// 融资期利率
|
||||
BigDecimal preFinancingRate = financingRate.divide( incomeNumberYear, 20, 4 );
|
||||
@ -220,4 +231,8 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor {
|
||||
|
||||
return irr;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new BigDecimal("12709.80").compareTo(new BigDecimal("10000.00")));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user