修改分段融

This commit is contained in:
tangfutang 2021-08-19 14:42:24 +08:00
parent dc466405d8
commit d0a94feeea
10 changed files with 116 additions and 57 deletions

View File

@ -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', '');
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -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((LeaseMoneyRatio<productCleanLeaseMoneyRatioMin)&&(productCleanLeaseMoneyRatioMin!=null)&&(productCleanLeaseMoneyRatioMin!="")){
AsDebug.showMessage("提示","综合融资额比例不能小于"+productCleanLeaseMoneyRatioMin+"%","","",true);
return ;
}
if((LeaseMoneyRatio>productCleanLeaseMoneyRatioMax)&&(productCleanLeaseMoneyRatioMax!=null)&&(productCleanLeaseMoneyRatioMax!="")){
AsDebug.showMessage("提示","综合融资额比例不能大于"+productCleanLeaseMoneyRatioMax+"%","","",true);
return ;
}
if((cleanLeaseMoney<productCleanLeaseMoneyMin)&&(productCleanLeaseMoneyMin!=null)&&(productCleanLeaseMoneyMin!="")){
AsDebug.showMessage("提示","融资额不能小于"+productCleanLeaseMoneyMin,"","",true);
return ;
}
if((cleanLeaseMoney>productCleanLeaseMoneyMax)&&(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((LeaseMoneyRatio<productCleanLeaseMoneyRatioMin)&&(productCleanLeaseMoneyRatioMin!=null)&&(productCleanLeaseMoneyRatioMin!="")){
AsDebug.showMessage("提示","综合融资额比例不能小于"+productCleanLeaseMoneyRatioMin+"%","","",true);
return ;
}
if((LeaseMoneyRatio>productCleanLeaseMoneyRatioMax)&&(productCleanLeaseMoneyRatioMax!=null)&&(productCleanLeaseMoneyRatioMax!="")){
AsDebug.showMessage("提示","综合融资额比例不能大于"+productCleanLeaseMoneyRatioMax+"%","","",true);
return ;
}
if((cleanLeaseMoney<productCleanLeaseMoneyMin)&&(productCleanLeaseMoneyMin!=null)&&(productCleanLeaseMoneyMin!="")){
AsDebug.showMessage("提示","融资额不能小于"+productCleanLeaseMoneyMin,"","",true);
return ;
}
if((cleanLeaseMoney>productCleanLeaseMoneyMax)&&(productCleanLeaseMoneyMax!=null)&&(productCleanLeaseMoneyMax!="")){
AsDebug.showMessage("提示","融资额不能大于"+productCleanLeaseMoneyMax,"","",true);
return ;
}
}
}
var startDate=getItemValue(0,getRow(),"START_DATE");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4674,6 +4674,9 @@
<attribute name="MAX_LEASE_MONEY" label="融资金额最大值" type="STRING" length="32"/>
<attribute name="MINIMUM_DISCOUNT" label="最小贴息金额" type="STRING" length="10"/>
<attribute name="IS_FIXED_DISCOUNT_RATE" label="贴息后利率是否固定" type="STRING" length="10"/>
<attribute name="MAX_INCOME_NUMBER" label="最大期次" type="STRING" length="32"/>
<attribute name="MIN_INCOME_NUMBER" label="最小期次" type="STRING" length="32"/>
<attribute name="MIN_LEASE_MONEY" label="融资金额最小值" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
@ -4714,6 +4717,9 @@
<attribute name="MAX_LEASE_MONEY" label="融资金额最大值" type="STRING" length="32"/>
<attribute name="MINIMUM_DISCOUNT" label="最小贴息金额" type="STRING" length="10"/>
<attribute name="IS_FIXED_DISCOUNT_RATE" label="贴息后利率是否固定" type="STRING" length="10"/>
<attribute name="MAX_INCOME_NUMBER" label="最大期次" type="STRING" length="32"/>
<attribute name="MIN_INCOME_NUMBER" label="最小期次" type="STRING" length="32"/>
<attribute name="MIN_LEASE_MONEY" label="融资金额最小值" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
@ -4755,6 +4761,9 @@
<attribute name="MAX_LEASE_MONEY" label="融资金额最大值" type="STRING" length="32"/>
<attribute name="MINIMUM_DISCOUNT" label="最小贴息金额" type="STRING" length="10"/>
<attribute name="IS_FIXED_DISCOUNT_RATE" label="贴息后利率是否固定" type="STRING" length="10"/>
<attribute name="MAX_INCOME_NUMBER" label="最大期次" type="STRING" length="32"/>
<attribute name="MIN_INCOME_NUMBER" label="最小期次" type="STRING" length="32"/>
<attribute name="MIN_LEASE_MONEY" label="融资金额最小值" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>

View File

@ -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";
}

View File

@ -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 {

View File

@ -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<BizObject> bos = bom.createQuery( "flowunid = :flowunid" ).setParameter( "flowunid", flowunid ).getResultList( false );
if ( bos.size() == 0 ) {
Map<String, List<Map<String, String>>> 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<Map<String, String>> 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 ++;
}

View File

@ -133,4 +133,16 @@ public interface LC_CALC_SUBSECTION_INFO{
* 季口빈적쪽角뤠미땍 STRING(10)<br>
*/
public static final String IS_FIXED_DISCOUNT_RATE = "IS_FIXED_DISCOUNT_RATE";
/**
* 最大期次 STRING(32)<br>
*/
public static final String MAX_INCOME_NUMBER = "MAX_INCOME_NUMBER";
/**
* 最小期次 STRING(32)<br>
*/
public static final String MIN_INCOME_NUMBER = "MIN_INCOME_NUMBER";
/**
* 融资金额最小值 STRING(10)<br>
*/
public static final String MIN_LEASE_MONEY = "MIN_LEASE_MONEY";
}

View File

@ -133,4 +133,17 @@ public interface LC_CALC_SUBSECTION_INFO_HIS{
* 季口빈적쪽角뤠미땍 STRING(10)<br>
*/
public static final String IS_FIXED_DISCOUNT_RATE = "IS_FIXED_DISCOUNT_RATE";
/**
* 最大期次 STRING(32)<br>
*/
public static final String MAX_INCOME_NUMBER = "MAX_INCOME_NUMBER";
/**
* 最小期次 STRING(32)<br>
*/
public static final String MIN_INCOME_NUMBER = "MIN_INCOME_NUMBER";
/**
* 融资金额最小值 STRING(32<br>
*/
public static final String MIN_LEASE_MONEY = "MIN_LEASE_MONEY";
}