diff --git a/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp b/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp index 36569e88c..75c90b18f 100644 --- a/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp +++ b/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp @@ -12,6 +12,7 @@ doTemp.setHtmlEvent( "DISCOUNT_RATE", "onblur", "changeDiscountRate" ); doTemp.setHtmlEvent( "CLEAN_LEASE_RATIO", "onblur", "changeCleanLeaseRatio" ); doTemp.setHtmlEvent( "CLEAN_LEASE_MONEY", "onblur", "changeCleanLeaseMoney" ); + doTemp.setHtmlEvent( "INCOME_NUMBER", "onchange", "changeIncomeNumber" ); String discountCalcMethod = Sqlca.getString("select DISCOUNT_CALC_METHOD from LC_CALC_SUBSECTION_INFO_TEMP where FLOWUNID='"+flowunid+"'"); if(discountCalcMethod != null){ if(discountCalcMethod.equals("1")){ @@ -71,7 +72,6 @@ } function changeCleanLeaseRatio() { - debugger; var subsectionConfig = parent.getItemValue( 0, 0, 'SUBSECTION_CONDIG' ); var equipAmt = parent.getItemValue( 0, 0, 'EQUIP_AMT' ); var cleanLeaseMoney = parent.getItemValue( 0, 0, 'CLEAN_LEASE_MONEY' ); @@ -84,8 +84,9 @@ fcleanLeaseMoney = Decimal( cleanLeaseMoney ).mul( cleanLeaseRatio ).div( 100 ).toFixed( 2 ) } var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' ) ; - if( (Number(fcleanLeaseMoney) ) > ( Number(maxLeaseMoney) ) ){ - alert("该段的融资金额不能大于:"+maxLeaseMoney+",请检查!"); + var minLeaseMoney = getItemValue( 0, getRow(), 'MIN_LEASE_MONEY' ); + if( Number(clm) > Number(maxLeaseMoney) || Number(clm) < Number(minLeaseMoney)){ + alert("该段的融资金额不在产品配置的区间内,请检查!"); setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', ''); setItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO', ''); return @@ -102,8 +103,9 @@ var cleanLeaseMoney = parent.getItemValue( 0, 0, 'CLEAN_LEASE_MONEY' ); var clm = getItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY' ); var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' ); - if( Number(clm) > Number(maxLeaseMoney) ){ - alert("该段的融资金额不能大于:"+maxLeaseMoney+",请检查!"); + var minLeaseMoney = getItemValue( 0, getRow(), 'MIN_LEASE_MONEY' ); + if( Number(clm) > Number(maxLeaseMoney) || Number(clm) < Number(minLeaseMoney)){ + alert("该段的融资金额不在产品配置的区间内,请检查!"); setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', ''); setItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO', ''); return @@ -121,13 +123,15 @@ function save() { var rowCount = getRowCount( 0 ); - var allRatio = Decimal( 0 ); + // var allRatio = Decimal( 0 ); + var clmCheck = Decimal( 0 ); for ( var i = 0; i < rowCount; i ++ ) { - var cleanLeaseRatio = getItemValue( 0, i, 'CLEAN_LEASE_RATIO' ); - if ( cleanLeaseRatio ) { - allRatio = allRatio.add( cleanLeaseRatio ); - } + // var cleanLeaseRatio = getItemValue( 0, i, 'CLEAN_LEASE_RATIO' ); var cleanLeaseMoney = getItemValue( 0, i, 'CLEAN_LEASE_MONEY' ); + if ( cleanLeaseMoney ) { + clmCheck = clmCheck.add( cleanLeaseMoney ); + } + if ( '' === cleanLeaseMoney ) { alert( '请选择分段配置' ); return; @@ -167,8 +171,9 @@ return; } } - if ( !allRatio.eq( 100 ) ) { - alert( '融资额比例总额不等于100%,请确认' ); + var parCLM = Decimal (parent.getItemValue( 0, 0, 'CLEAN_LEASE_MONEY' ) ); + if ( parseFloat(clmCheck) != parseFloat(parCLM) ) { + alert( '融资金额和综合融资不相等,请检查!' ); return; } as_save( 0 ); @@ -210,5 +215,14 @@ } } + function changeIncomeNumber(){ + var inumber = getItemValue( 0, getRow(), 'INCOME_NUMBER' ); + var maxIn = getItemValue( 0, getRow(), 'MAX_INCOME_NUMBER' ); + var minIn = getItemValue( 0, getRow(), 'MIN_INCOME_NUMBER' ); + if( Number(inumber) > Number(maxIn) || Number(inumber) < Number(minIn)){ + alert("该段的期次不在产品配置的区间内,请检查!"); + setItemValue( 0, getRow(), 'INCOME_NUMBER', ''); + } + } <%@ include file="/Frame/resources/include/include_end.jspf"%> diff --git a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp index 322131210..2625c1299 100644 --- a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp +++ b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp @@ -1138,12 +1138,12 @@ function saveRecord(sPostEvents){ alert('融资额需大于0 !!!'); return ; } - var incomeNumebr = getItemValue(0,getRow(),"INCOME_NUMBER"); - if(incomeNumebr && Number(incomeNumebr) <= 0){ - alert('还租次数需大于0 !!!'); - return ; - } if(settleMethod != 'segmented_financing') { + var incomeNumebr = getItemValue(0,getRow(),"INCOME_NUMBER"); + if(incomeNumebr && Number(incomeNumebr) <= 0){ + alert('还租次数需大于0 !!!'); + return ; + } var termMin = parseInt("<%=termMin%>"); var termMax = parseInt("<%=termMax%>"); var incomeNumber = parseInt(getItemValue(0, 0, "INCOME_NUMBER")); @@ -1171,31 +1171,32 @@ function saveRecord(sPostEvents){ return; } } - } - //贷款比例不能大于产品配置 - var cleanLeaseMoney=eval(getItemValue(0,0,"CLEAN_LEASE_MONEY"));//融资额 - var EQUIP_AMT=eval(getItemValue(0,0,"EQUIP_AMT")); - var LeaseMoneyRatio = Number(cleanLeaseMoney/EQUIP_AMT*100).toFixed(6); - if(calcRules["fund"]["CLEAN_LEASE_MONEY"]){ - var productCleanLeaseMoneyRatioMax = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["LeaseMoneyRatio"]["max"]);//贷款比例上限 - var productCleanLeaseMoneyRatioMin = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["LeaseMoneyRatio"]["min"]);//贷款比例下限 - var productCleanLeaseMoneyMax = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["max"]);//融资额上限 - var productCleanLeaseMoneyMin = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["min"]);//融资额下限 - if((LeaseMoneyRatioproductCleanLeaseMoneyRatioMax)&&(productCleanLeaseMoneyRatioMax!=null)&&(productCleanLeaseMoneyRatioMax!="")){ - AsDebug.showMessage("提示","综合融资额比例不能大于"+productCleanLeaseMoneyRatioMax+"%","","",true); - return ; - } - if((cleanLeaseMoneyproductCleanLeaseMoneyMax)&&(productCleanLeaseMoneyMax!=null)&&(productCleanLeaseMoneyMax!="")){ - AsDebug.showMessage("提示","融资额不能大于"+productCleanLeaseMoneyMax,"","",true); - return ; + + //贷款比例不能大于产品配置 + var cleanLeaseMoney=eval(getItemValue(0,0,"CLEAN_LEASE_MONEY"));//融资额 + var EQUIP_AMT=eval(getItemValue(0,0,"EQUIP_AMT")); + var LeaseMoneyRatio = Number(cleanLeaseMoney/EQUIP_AMT*100).toFixed(6); + if(calcRules["fund"]["CLEAN_LEASE_MONEY"]){ + var productCleanLeaseMoneyRatioMax = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["LeaseMoneyRatio"]["max"]);//贷款比例上限 + var productCleanLeaseMoneyRatioMin = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["LeaseMoneyRatio"]["min"]);//贷款比例下限 + var productCleanLeaseMoneyMax = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["max"]);//融资额上限 + var productCleanLeaseMoneyMin = eval(calcRules["fund"]["CLEAN_LEASE_MONEY"]["min"]);//融资额下限 + if((LeaseMoneyRatioproductCleanLeaseMoneyRatioMax)&&(productCleanLeaseMoneyRatioMax!=null)&&(productCleanLeaseMoneyRatioMax!="")){ + AsDebug.showMessage("提示","综合融资额比例不能大于"+productCleanLeaseMoneyRatioMax+"%","","",true); + return ; + } + if((cleanLeaseMoneyproductCleanLeaseMoneyMax)&&(productCleanLeaseMoneyMax!=null)&&(productCleanLeaseMoneyMax!="")){ + AsDebug.showMessage("提示","融资额不能大于"+productCleanLeaseMoneyMax,"","",true); + return ; + } } } var startDate=getItemValue(0,getRow(),"START_DATE"); diff --git a/WebContent/WEB-INF/etc/app/component/component-config.xml b/WebContent/WEB-INF/etc/app/component/component-config.xml index a3f4a429f..147a9f006 100644 --- a/WebContent/WEB-INF/etc/app/component/component-config.xml +++ b/WebContent/WEB-INF/etc/app/component/component-config.xml @@ -1107,4 +1107,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/app/component/component-parameter-config.xml b/WebContent/WEB-INF/etc/app/component/component-parameter-config.xml index 3ae3af03d..730aa5bd9 100644 --- a/WebContent/WEB-INF/etc/app/component/component-parameter-config.xml +++ b/WebContent/WEB-INF/etc/app/component/component-parameter-config.xml @@ -196,4 +196,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/jbo/jbo_calc.xml b/WebContent/WEB-INF/etc/jbo/jbo_calc.xml index 5b2cb5912..14e1f8e83 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_calc.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_calc.xml @@ -4674,6 +4674,9 @@ + + + @@ -4714,6 +4717,9 @@ + + + @@ -4755,6 +4761,9 @@ + + + diff --git a/calc/com/tenwa/reckon/check/SubsectionCheck.java b/calc/com/tenwa/reckon/check/SubsectionCheck.java index 4acb7b5d2..b1a4f1b30 100644 --- a/calc/com/tenwa/reckon/check/SubsectionCheck.java +++ b/calc/com/tenwa/reckon/check/SubsectionCheck.java @@ -32,7 +32,11 @@ public class SubsectionCheck { if( dataClm != null && dataClm.size() > 0 ){ clm = new BigDecimal(dataClm.get(0).get("CLEAN_LEASE_MONEY")); } - if(subsectionCondig.equals("CarPrice")){ + //不管根据什么计算,都校验分段融的金额和综合融资额 + if(new BigDecimal(cleanLeaseMoney).compareTo( clm ) != 0){ + return "分段融资额和综合融资额不一致,请检查!"; + } + /*if(subsectionCondig.equals("CarPrice")){ if(new BigDecimal(equipAmt).compareTo( clm ) != 0){ return "分段融资额和车价金额不一致,请检查!"; } @@ -42,7 +46,7 @@ public class SubsectionCheck { } }else{ return "没有检查到对应的分段配置,请检查!"; - } + }*/ return "success"; } diff --git a/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java b/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java index e1590d72c..02a0cb96b 100644 --- a/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java +++ b/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java @@ -63,6 +63,8 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor { String discountCalcMethod = bo.getAttribute( "DISCOUNT_CALC_METHOD" ).getString(); // 融资利率 BigDecimal financingRate; + //获取融资利率是否只读,如果只读每次计算需要更新融资利率 + String iulma =bo.getAttribute( "IS_UPDATE_LEASE_MONEY_RATIO" ).getString(); if ( "1".equals( discountCalcMethod ) ) { // 根据利率计算贴息金额 // 贴息后利率 BigDecimal discountRate = new BigDecimal( bo.getAttribute( "DISCOUNT_RATE" ).getString() ).divide( new BigDecimal( 100 ), 20, 4 ); @@ -77,7 +79,8 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor { bo.setAttributeValue( "DISCOUNT", discount ); String fr = bo.getAttribute( "FINANCING_RATE" ).getString(); - if ( StringUtils.isEmpty( fr ) ) { + + if ( StringUtils.isEmpty( fr ) || ( iulma!=null && "Y".equals(iulma) ) ) { financingRate = discountRate.divide( new BigDecimal( 100 ), 20, 4 ); bo.setAttributeValue( "FINANCING_RATE", discountRate.toString() ); } else { @@ -100,7 +103,7 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor { BigDecimal discountRate = getIRR( cashFlow, incomeNumberYear ).setScale( 6, 4 ); bo.setAttributeValue( "DISCOUNT_RATE", discountRate.toString() ); String fr = bo.getAttribute( "FINANCING_RATE" ).getString(); - if ( StringUtils.isEmpty( fr ) ) { + if ( StringUtils.isEmpty( fr ) || ( iulma!=null && "Y".equals(iulma) ) ) { financingRate = discountRate.divide( new BigDecimal( 100 ), 20, 4 ); bo.setAttributeValue( "FINANCING_RATE", discountRate.toString() ); } else { diff --git a/calc/com/tenwa/reckon/product/ProductCondition.java b/calc/com/tenwa/reckon/product/ProductCondition.java index fda148de0..9a2174ab0 100644 --- a/calc/com/tenwa/reckon/product/ProductCondition.java +++ b/calc/com/tenwa/reckon/product/ProductCondition.java @@ -1,5 +1,6 @@ package com.tenwa.reckon.product; +import java.math.BigDecimal; import java.util.Calendar; import java.util.HashMap; import java.util.List; @@ -764,8 +765,8 @@ public class ProductCondition { List bos = bom.createQuery( "flowunid = :flowunid" ).setParameter( "flowunid", flowunid ).getResultList( false ); if ( bos.size() == 0 ) { Map>> configs = ProductParamUtil.getProductComponentDecisionTable( productId, "PRD0301", - "Rate", "Discount", "DiscountRate", "DiscountCalcMethod", "IsBalanceLending", "DiscountCollectionPeriod", "MaximumDiscount" ,"incomeNumber", - "isFixedDiscount","isUpdateLeaseMoneyRatio","maxLeaseMoney","MinimumDiscount","isFixedDiscountRate"); + "Rate", "Discount", "DiscountRate", "DiscountCalcMethod", "IsBalanceLending", "DiscountCollectionPeriod", "MaximumDiscount" , + "isFixedDiscount","isUpdateLeaseMoneyRatio","maxLeaseMoney","MinimumDiscount","MaxincomeNumber","MinincomeNumber","MinLeaseMoney"); List> sf = configs.get( "segmented_financing" ); int i = 1; String discountCalcMethod = null ; @@ -798,20 +799,22 @@ public class ProductCondition { bo.setAttributeValue( "MAXIMUM_DISCOUNT", f.get( "MaximumDiscount" ) ); bo.setAttributeValue( "FLOWUNID", flowunid ); //根据产品配置期次,如果配置赋值给对应的值 - String incomeNumber = f.get( "incomeNumber" ); - if(incomeNumber == null || incomeNumber.isEmpty() ){ - bo.setAttributeValue( "IS_ONLYREAD_INCOME_NUMBER", "N" ); - }else{ + String MinincomeNumber = f.get( "MinincomeNumber" ); + String MaxincomeNumber = f.get( "MaxincomeNumber" ); + if(MinincomeNumber != null && MaxincomeNumber != null && new BigDecimal(MinincomeNumber).compareTo(new BigDecimal(MaxincomeNumber))==0 ){ bo.setAttributeValue( "IS_ONLYREAD_INCOME_NUMBER", "Y" ); - bo.setAttributeValue( "INCOME_NUMBER", incomeNumber ); + bo.setAttributeValue( "INCOME_NUMBER", MaxincomeNumber ); + }else{ + bo.setAttributeValue( "IS_ONLYREAD_INCOME_NUMBER", "N" ); } + bo.setAttributeValue( "MAX_INCOME_NUMBER", MaxincomeNumber ); + bo.setAttributeValue( "MIN_INCOME_NUMBER", MinincomeNumber ); bo.setAttributeValue( "IS_FIXED_DISCOUNT", f.get( "isFixedDiscount" ) ); bo.setAttributeValue( "IS_UPDATE_LEASE_MONEY_RATIO", f.get( "isUpdateLeaseMoneyRatio" ) ); bo.setAttributeValue( "MAX_LEASE_MONEY", f.get( "maxLeaseMoney" ) ); + bo.setAttributeValue( "MIN_LEASE_MONEY", f.get( "MinLeaseMoney" ) ); bo.setAttributeValue( "MINIMUM_DISCOUNT", f.get( "MinimumDiscount" ) ); - bo.setAttributeValue( "IS_FIXED_DISCOUNT_RATE", f.get( "isFixedDiscountRate" ) ); - bom.saveObject( bo ); i ++; } diff --git a/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO.java b/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO.java index d3bceab49..4957803a7 100644 --- a/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO.java +++ b/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO.java @@ -133,4 +133,16 @@ public interface LC_CALC_SUBSECTION_INFO{ * 贴息后利率是否固定 STRING(10)
*/ public static final String IS_FIXED_DISCOUNT_RATE = "IS_FIXED_DISCOUNT_RATE"; + /** + * 最大期次 STRING(32)
+ */ + public static final String MAX_INCOME_NUMBER = "MAX_INCOME_NUMBER"; + /** + * 最小期次 STRING(32)
+ */ + public static final String MIN_INCOME_NUMBER = "MIN_INCOME_NUMBER"; + /** + * 融资金额最小值 STRING(10)
+ */ + public static final String MIN_LEASE_MONEY = "MIN_LEASE_MONEY"; } \ No newline at end of file diff --git a/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO_HIS.java b/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO_HIS.java index c662becdf..d834134ed 100644 --- a/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO_HIS.java +++ b/src_jbo/jbo/app/tenwa/calc/LC_CALC_SUBSECTION_INFO_HIS.java @@ -133,4 +133,17 @@ public interface LC_CALC_SUBSECTION_INFO_HIS{ * 贴息后利率是否固定 STRING(10)
*/ public static final String IS_FIXED_DISCOUNT_RATE = "IS_FIXED_DISCOUNT_RATE"; + + /** + * 最大期次 STRING(32)
+ */ + public static final String MAX_INCOME_NUMBER = "MAX_INCOME_NUMBER"; + /** + * 最小期次 STRING(32)
+ */ + public static final String MIN_INCOME_NUMBER = "MIN_INCOME_NUMBER"; + /** + * 融资金额最小值 STRING(32
+ */ + public static final String MIN_LEASE_MONEY = "MIN_LEASE_MONEY"; } \ No newline at end of file