添加分段融综合利率计算
This commit is contained in:
parent
894885ac93
commit
3407183f35
@ -85,10 +85,10 @@
|
||||
}
|
||||
var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' ) ;
|
||||
var minLeaseMoney = getItemValue( 0, getRow(), 'MIN_LEASE_MONEY' );
|
||||
if( Number(clm) > Number(maxLeaseMoney) || Number(clm) < Number(minLeaseMoney)){
|
||||
alert("该段的融资金额不在产品配置的区间内,请检查!");
|
||||
if( Number(fcleanLeaseMoney) > Number(maxLeaseMoney) || Number(fcleanLeaseMoney) < Number(minLeaseMoney)){
|
||||
setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', '');
|
||||
setItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO', '');
|
||||
alert("该段的融资金额不在产品配置的区间内,请检查!");
|
||||
return
|
||||
}
|
||||
setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', fcleanLeaseMoney);
|
||||
@ -105,9 +105,9 @@
|
||||
var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' );
|
||||
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', '');
|
||||
alert("该段的融资金额不在产品配置的区间内,请检查!");
|
||||
return
|
||||
}
|
||||
if ( subsectionConfig ) {
|
||||
|
||||
@ -1426,6 +1426,7 @@
|
||||
<attribute name="PERSONAL_INSURANCE" label="个人意外险" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="DISCOUNT_INTEREST" label="贴息" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="SUBSECTION_CONDIG" label="分段配置" type="STRING" length="32"/>
|
||||
<attribute name="COMPREHENSIVE_RATE" label="综合利率" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -2788,6 +2789,7 @@
|
||||
<attribute name="PERSONAL_INSURANCE" label="个人意外险" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="DISCOUNT_INTEREST" label="贴息" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="SUBSECTION_CONDIG" label="分段配置" type="STRING" length="32"/>
|
||||
<attribute name="COMPREHENSIVE_RATE" label="综合利率" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -3374,6 +3376,7 @@
|
||||
<attribute name="PERSONAL_INSURANCE" label="个人意外险" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="DISCOUNT_INTEREST" label="贴息" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="SUBSECTION_CONDIG" label="分段配置" type="STRING" length="32"/>
|
||||
<attribute name="COMPREHENSIVE_RATE" label="综合利率" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
|
||||
@ -177,6 +177,9 @@ public class ConditionBean implements Cloneable{
|
||||
private String discountInterest; // 贴息(不参与融资)
|
||||
private String personalInsurance; // 个人意外险
|
||||
/*****************************/
|
||||
/* ******* 分段融 ****************/
|
||||
private String comprehensiveRate; // 综合利率
|
||||
/*****************************/
|
||||
|
||||
/***********************************************************************************
|
||||
* 暂时未使用字段(历史版本字段)
|
||||
@ -1453,6 +1456,7 @@ public class ConditionBean implements Cloneable{
|
||||
param = (param.isEmpty() ? "0" : param);
|
||||
return param;
|
||||
}
|
||||
|
||||
/*
|
||||
* 期初为租金计划的最后一期在加一期,期末为租金计划最后一期
|
||||
*/
|
||||
@ -1832,6 +1836,13 @@ public class ConditionBean implements Cloneable{
|
||||
public void setPersonalInsurance(String personalInsurance) {
|
||||
this.personalInsurance = personalInsurance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setComprehensiveRate(String comprehensiveRate) {
|
||||
this.comprehensiveRate = comprehensiveRate;
|
||||
}
|
||||
|
||||
public String getComprehensiveRate() {
|
||||
return defaultZero(comprehensiveRate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.SqlObject;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.gnete.bc.util.Strings;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.reckon.bean.ConditionBean;
|
||||
import com.tenwa.reckon.bean.TabCalBean;
|
||||
@ -34,19 +35,32 @@ public class CashFlowExecutor {
|
||||
public String run(ConditionBean cb , TabCalBean tcb) throws Exception{
|
||||
this.delete(tcb, cb);
|
||||
this.add(cb, tcb);
|
||||
String irr = this.getIrr(cb,tcb);
|
||||
String irr = "";
|
||||
if( "segmented_financing".equals( cb.getSettleMethod() ) ){
|
||||
irr = this.getIrr(cb,tcb,"subsectionIRR");
|
||||
String subsectionRate = this.getIrr(cb, tcb, "subsectionRate");
|
||||
cb.setComprehensiveRate( subsectionRate );
|
||||
}else{
|
||||
irr = this.getIrr(cb,tcb,"normal");
|
||||
}
|
||||
cb.setIrr(irr);
|
||||
return irr;
|
||||
}
|
||||
private String getIrr(ConditionBean cb ,TabCalBean tcb) throws Exception{
|
||||
//calcType 计算类型 normal正常合同计算IRR;subsectionIRR:分段融计算IRR,subsectionRate:分段融计算综合利率
|
||||
private String getIrr(ConditionBean cb , TabCalBean tcb, String calcType) throws Exception{
|
||||
String cashSql = "select NET_FLOW,PLAN_DATE from "+Tools.getTable(tcb.getContractCashTb())+" where flowunid ='"+tcb.getDocId()+"' and "+tcb.getPlanCName()+"='"+tcb.getPlanCValue()+"' order by plan_date";
|
||||
List<Map<String, String>> cashes =DataOperatorUtil.getDataBySql(tx, cashSql, null);
|
||||
List<String > netList = new ArrayList<String>();
|
||||
List<String > dateList = new ArrayList<String>();
|
||||
for(Map<String, String> cash :cashes){
|
||||
netList.add(cash.get("NET_FLOW"));
|
||||
dateList.add(cash.get("PLAN_DATE"));
|
||||
for(Map<String, String> cash :cashes){
|
||||
netList.add(cash.get("NET_FLOW"));
|
||||
dateList.add(cash.get("PLAN_DATE"));
|
||||
}
|
||||
if ("subsectionRate".equals(calcType) ){
|
||||
String cleanLeaseMoney = cb.getCleanLeaseMoney();
|
||||
netList.set(0,"-"+cleanLeaseMoney);
|
||||
}
|
||||
|
||||
String irr="";
|
||||
if("STAGE_IRR".equals(cb.getIrrType())){//°´ÆÚIRR
|
||||
BigDecimal issueRate=IRRCalculateUtil.getIRR2(netList);
|
||||
|
||||
@ -81,7 +81,9 @@ public class ConditionHelper {
|
||||
//更新保证金抵扣
|
||||
params.put("CAUTION_DEDUCTION_MONEY",cb.getCautionDeductionMoney());
|
||||
params.put("CAUTION_MONEY_REMAIN",cb.getCautionMoneyRemain());
|
||||
|
||||
if( "segmented_financing".equals( cb.getSettleMethod() ) ){
|
||||
params.put( "COMPREHENSIVE_RATE",cb.getComprehensiveRate() );
|
||||
}
|
||||
if ( "Y".equals( cb.getFlexible() ) ) {
|
||||
// 灵活产品计算其他项
|
||||
try {
|
||||
|
||||
@ -617,4 +617,9 @@ public interface LC_CALC_CONDITION{
|
||||
* ÌùÏ¢<br>
|
||||
*/
|
||||
public static final String DISCOUNT_INTEREST = "DISCOUNT_INTEREST";
|
||||
|
||||
/**
|
||||
* 履북적쪽<br>
|
||||
*/
|
||||
public static final String COMPREHENSIVE_RATE = "COMPREHENSIVE_RATE";
|
||||
}
|
||||
@ -617,4 +617,8 @@ public interface LC_CALC_CONDITION_HIS{
|
||||
* ÌùÏ¢<br>
|
||||
*/
|
||||
public static final String DISCOUNT_INTEREST = "DISCOUNT_INTEREST";
|
||||
/**
|
||||
* 履북적쪽<br>
|
||||
*/
|
||||
public static final String COMPREHENSIVE_RATE = "COMPREHENSIVE_RATE";
|
||||
}
|
||||
@ -617,4 +617,8 @@ public interface LC_CALC_CONDITION_TEMP{
|
||||
* ÌùÏ¢<br>
|
||||
*/
|
||||
public static final String DISCOUNT_INTEREST = "DISCOUNT_INTEREST";
|
||||
/**
|
||||
* 履북적쪽<br>
|
||||
*/
|
||||
public static final String COMPREHENSIVE_RATE = "COMPREHENSIVE_RATE";
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user