贴息字段修改
This commit is contained in:
parent
5f09982b1f
commit
1adb175c38
@ -8,7 +8,7 @@
|
|||||||
String flowunid = CurPage.getParameter("flowunid");
|
String flowunid = CurPage.getParameter("flowunid");
|
||||||
String projectId = CurPage.getParameter("projectId");
|
String projectId = CurPage.getParameter("projectId");
|
||||||
ASObjectModel doTemp = new ASObjectModel("LCCalcSubsectionInfoTemp");
|
ASObjectModel doTemp = new ASObjectModel("LCCalcSubsectionInfoTemp");
|
||||||
doTemp.setHtmlEvent( "DISCOUNT", "onblur", "changeDiscount" );
|
doTemp.setHtmlEvent( "DISCOUNT_INTEREST", "onblur", "changeDiscount" );
|
||||||
doTemp.setHtmlEvent( "DISCOUNT_RATE", "onblur", "changeDiscountRate" );
|
doTemp.setHtmlEvent( "DISCOUNT_RATE", "onblur", "changeDiscountRate" );
|
||||||
doTemp.setHtmlEvent( "CLEAN_LEASE_RATIO", "onblur", "changeCleanLeaseRatio" );
|
doTemp.setHtmlEvent( "CLEAN_LEASE_RATIO", "onblur", "changeCleanLeaseRatio" );
|
||||||
doTemp.setHtmlEvent( "CLEAN_LEASE_MONEY", "onblur", "changeCleanLeaseMoney" );
|
doTemp.setHtmlEvent( "CLEAN_LEASE_MONEY", "onblur", "changeCleanLeaseMoney" );
|
||||||
@ -16,16 +16,16 @@
|
|||||||
String discountCalcMethod = Sqlca.getString("select DISCOUNT_CALC_METHOD from LC_CALC_SUBSECTION_INFO_TEMP where FLOWUNID='"+flowunid+"'");
|
String discountCalcMethod = Sqlca.getString("select DISCOUNT_CALC_METHOD from LC_CALC_SUBSECTION_INFO_TEMP where FLOWUNID='"+flowunid+"'");
|
||||||
if(discountCalcMethod != null){
|
if(discountCalcMethod != null){
|
||||||
if(discountCalcMethod.equals("1")){
|
if(discountCalcMethod.equals("1")){
|
||||||
doTemp.setReadOnly("DISCOUNT",true);
|
doTemp.setReadOnly("DISCOUNT_INTEREST",true);
|
||||||
doTemp.setReadOnly("DISCOUNT_RATE",false);
|
doTemp.setReadOnly("DISCOUNT_RATE",false);
|
||||||
}else if (discountCalcMethod.equals("2")){
|
}else if (discountCalcMethod.equals("2")){
|
||||||
doTemp.setReadOnly("DISCOUNT",false);
|
doTemp.setReadOnly("DISCOUNT_INTEREST",false);
|
||||||
doTemp.setReadOnly("DISCOUNT_RATE",true);
|
doTemp.setReadOnly("DISCOUNT_RATE",true);
|
||||||
}else if (discountCalcMethod.equals("3")){//固定值,对应的值改为只读
|
}else if (discountCalcMethod.equals("3")){//固定值,对应的值改为只读
|
||||||
doTemp.setReadOnly("DISCOUNT_RATE",true);
|
doTemp.setReadOnly("DISCOUNT_RATE",true);
|
||||||
doTemp.setReadOnly("FINANCING_RATE",true);
|
doTemp.setReadOnly("FINANCING_RATE",true);
|
||||||
doTemp.setReadOnly("INCOME_NUMBER",true);
|
doTemp.setReadOnly("INCOME_NUMBER",true);
|
||||||
doTemp.setReadOnly("DISCOUNT",true);
|
doTemp.setReadOnly("DISCOUNT_INTEREST",true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||||
@ -43,19 +43,19 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function changeDiscount() {
|
function changeDiscount() {
|
||||||
var discountCalcMethod = getItemValue( 0, getRow(), 'DISCOUNT_CALC_METHOD' );
|
var discountCalcMethod = getItemValue( 0, getRow(), 'DISCOUNT_CALC_METHOD' );
|
||||||
var discount = getItemValue( 0, getRow(), 'DISCOUNT' );
|
var discount = getItemValue( 0, getRow(), 'DISCOUNT_INTEREST' );
|
||||||
if ( '2' === discountCalcMethod ) {
|
if ( '2' === discountCalcMethod ) {
|
||||||
var maximumDiscount = getItemValue( 0, getRow(), 'MAXIMUM_DISCOUNT' );
|
var maximumDiscount = getItemValue( 0, getRow(), 'MAXIMUM_DISCOUNT' );
|
||||||
if ( discount ) {
|
if ( discount ) {
|
||||||
if ( Decimal( discount ).gt( maximumDiscount ) ) {
|
if ( Decimal( discount ).gt( maximumDiscount ) ) {
|
||||||
alert( '贴息金额超出最大贴息金额,请重新输入' );
|
alert( '贴息金额超出最大贴息金额,请重新输入' );
|
||||||
setItemValue( 0, getRow(), 'DISCOUNT', '' );
|
setItemValue( 0, getRow(), 'DISCOUNT_INTEREST', '' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( discount ) {
|
if ( discount ) {
|
||||||
alert( '贴息计算方式为根据利率计算金额,不需要输入贴息金额' );
|
alert( '贴息计算方式为根据利率计算金额,不需要输入贴息金额' );
|
||||||
setItemValue( 0, getRow(), 'DISCOUNT', '' );
|
setItemValue( 0, getRow(), 'DISCOUNT_INTEREST', '' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@
|
|||||||
}
|
}
|
||||||
var discountCalcMethod = getItemValue( 0, i, 'DISCOUNT_CALC_METHOD' );
|
var discountCalcMethod = getItemValue( 0, i, 'DISCOUNT_CALC_METHOD' );
|
||||||
if ( '2' === discountCalcMethod ) {
|
if ( '2' === discountCalcMethod ) {
|
||||||
var discount = getItemValue( 0, i, 'DISCOUNT' );
|
var discount = getItemValue( 0, i, 'DISCOUNT_INTEREST' );
|
||||||
if ( '' === discount ) {
|
if ( '' === discount ) {
|
||||||
alert( '请填写第' + ( i + 1 ) + '行贴息金额' );
|
alert( '请填写第' + ( i + 1 ) + '行贴息金额' );
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -282,20 +282,21 @@ $(function(){
|
|||||||
//CalcControl.RentOrRateView();
|
//CalcControl.RentOrRateView();
|
||||||
var inerNumber = $("#INCOME_NUMBER").val();
|
var inerNumber = $("#INCOME_NUMBER").val();
|
||||||
$("#INCOME_NUMBER").empty();
|
$("#INCOME_NUMBER").empty();
|
||||||
var inNumber=calcRules['incomeNumber']['INCOME_NUMBER'];
|
var inNumber=calcRules['incomeNumber']['INCOME_NUMBER'];
|
||||||
inNumber=inNumber.split(",");
|
if(typeof inNumber != 'undefined'){
|
||||||
var inco={};
|
inNumber=inNumber.split(",");
|
||||||
for(var i=0;i<inNumber.length;i++){
|
var inco={};
|
||||||
inco[inNumber[i]]="1";
|
for(var i=0;i<inNumber.length;i++){
|
||||||
|
inco[inNumber[i]]="1";
|
||||||
|
}
|
||||||
|
$(incomeNumber).each(function(){
|
||||||
|
var value=$(this).attr("value");
|
||||||
|
if(inco[value]==1){
|
||||||
|
$("#INCOME_NUMBER").append(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#INCOME_NUMBER").val(inerNumber);
|
||||||
}
|
}
|
||||||
$(incomeNumber).each(function(){
|
|
||||||
var value=$(this).attr("value");
|
|
||||||
if(inco[value]==1){
|
|
||||||
$("#INCOME_NUMBER").append(this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("#INCOME_NUMBER").val(inerNumber);
|
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}else{
|
}else{
|
||||||
changeSettleMethod3();
|
changeSettleMethod3();
|
||||||
|
|||||||
@ -4768,6 +4768,7 @@
|
|||||||
<attribute name="MAX_INCOME_NUMBER" label="最大期次" type="STRING" length="32"/>
|
<attribute name="MAX_INCOME_NUMBER" label="最大期次" type="STRING" length="32"/>
|
||||||
<attribute name="MIN_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"/>
|
<attribute name="MIN_LEASE_MONEY" label="融资金额最小值" type="STRING" length="32"/>
|
||||||
|
<attribute name="DISCOUNT_INTEREST" label="贴息金额" type="DOUBLE" length="18" scale="2"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
<manager>
|
<manager>
|
||||||
<managerProperties>
|
<managerProperties>
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class CashFlowExecutor {
|
|||||||
dateList.add(cash.get("PLAN_DATE"));
|
dateList.add(cash.get("PLAN_DATE"));
|
||||||
}
|
}
|
||||||
if ("subsectionRate".equals(calcType) ){
|
if ("subsectionRate".equals(calcType) ){
|
||||||
String subsectionSql = "select IS_BALANCE_LENDING,DISCOUNT,DISCOUNT_COLLECTION_PERIOD from lc_calc_subsection_info_temp where FLOWUNID='"+tcb.getDocId()+"'";
|
String subsectionSql = "select IS_BALANCE_LENDING,DISCOUNT_INTEREST,DISCOUNT_COLLECTION_PERIOD from lc_calc_subsection_info_temp where FLOWUNID='"+tcb.getDocId()+"'";
|
||||||
List<Map<String, String>> subsectionData =DataOperatorUtil.getDataBySql(tx, subsectionSql, null);
|
List<Map<String, String>> subsectionData =DataOperatorUtil.getDataBySql(tx, subsectionSql, null);
|
||||||
BigDecimal tempMoney = BigDecimal.ZERO;
|
BigDecimal tempMoney = BigDecimal.ZERO;
|
||||||
int coss = 0;
|
int coss = 0;
|
||||||
@ -67,7 +67,7 @@ public class CashFlowExecutor {
|
|||||||
coss = Integer.parseInt( subsection.get("DISCOUNT_COLLECTION_PERIOD") );
|
coss = Integer.parseInt( subsection.get("DISCOUNT_COLLECTION_PERIOD") );
|
||||||
}
|
}
|
||||||
tempMoney = new BigDecimal( netList.get(coss) );
|
tempMoney = new BigDecimal( netList.get(coss) );
|
||||||
netList.set(coss, ( tempMoney.subtract( new BigDecimal( subsection.get("DISCOUNT") ) ) ).toString() );
|
netList.set(coss, ( tempMoney.subtract( new BigDecimal( subsection.get("DISCOUNT_INTEREST") ) ) ).toString() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String irr="";
|
String irr="";
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor {
|
|||||||
String afterDiscountRent = RentTools.getPMT( preDiscountRate.toString(), incomeNumber.toString(), cleanLeaseMoney.negate().toString(), "0", "0" );
|
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 ) );
|
BigDecimal discount = new BigDecimal( rent ).setScale( 2, 4 ).multiply( incomeNumber ).subtract( new BigDecimal( afterDiscountRent ).setScale( 2, 4 ).multiply( incomeNumber ) );
|
||||||
bo.setAttributeValue( "DISCOUNT", discount );
|
bo.setAttributeValue( "DISCOUNT_INTEREST", discount );
|
||||||
|
|
||||||
String fr = bo.getAttribute( "FINANCING_RATE" ).getString();
|
String fr = bo.getAttribute( "FINANCING_RATE" ).getString();
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor {
|
|||||||
bom.saveObject( bo );
|
bom.saveObject( bo );
|
||||||
} else if("2".equals( discountCalcMethod )) { //根据金额算利率
|
} else if("2".equals( discountCalcMethod )) { //根据金额算利率
|
||||||
// 贴息金额
|
// 贴息金额
|
||||||
BigDecimal discount = new BigDecimal( bo.getAttribute( "DISCOUNT" ).getString() );
|
BigDecimal discount = new BigDecimal( bo.getAttribute( "DISCOUNT_INTEREST" ).getString() );
|
||||||
// 标准利率计算租金
|
// 标准利率计算租金
|
||||||
String rent = RentTools.getPMT( preRate.toString(), incomeNumber.toString(), cleanLeaseMoney.negate().toString(), "0", "0" );
|
String rent = RentTools.getPMT( preRate.toString(), incomeNumber.toString(), cleanLeaseMoney.negate().toString(), "0", "0" );
|
||||||
// 贴息后租金
|
// 贴息后租金
|
||||||
@ -117,7 +117,7 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor {
|
|||||||
throw new BusinessException( "分段信息没有配置计算规则,无法测算!" );
|
throw new BusinessException( "分段信息没有配置计算规则,无法测算!" );
|
||||||
}
|
}
|
||||||
//校验贴息是否在配置的区间内
|
//校验贴息是否在配置的区间内
|
||||||
BigDecimal discountCheck = new BigDecimal( bo.getAttribute( "DISCOUNT" ).getString() );
|
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 ) ) {
|
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+"段的贴息金额不在产品配置的区间内!" );
|
throw new BusinessException( "分段融的第"+subsectionNumber+"段的贴息金额不在产品配置的区间内!" );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -783,11 +783,13 @@ public class ProductCondition {
|
|||||||
bo.setAttributeValue( "DISCOUNT_RATE", f.get( "DiscountRate" ) );
|
bo.setAttributeValue( "DISCOUNT_RATE", f.get( "DiscountRate" ) );
|
||||||
bo.setAttributeValue( "FINANCING_RATE", f.get( "DiscountRate" ) );
|
bo.setAttributeValue( "FINANCING_RATE", f.get( "DiscountRate" ) );
|
||||||
} else if( "2".equals( discountCalcMethod ) ){
|
} else if( "2".equals( discountCalcMethod ) ){
|
||||||
bo.setAttributeValue( "DISCOUNT", f.get( "Discount" ) );
|
// bo.setAttributeValue( "DISCOUNT", f.get( "Discount" ) );
|
||||||
|
bo.setAttributeValue( "DISCOUNT_INTEREST", f.get( "Discount" ) );
|
||||||
}else if ( "3".equals( discountCalcMethod ) ){
|
}else if ( "3".equals( discountCalcMethod ) ){
|
||||||
bo.setAttributeValue( "DISCOUNT_RATE", f.get( "DiscountRate" ) );
|
bo.setAttributeValue( "DISCOUNT_RATE", f.get( "DiscountRate" ) );
|
||||||
bo.setAttributeValue( "FINANCING_RATE", f.get( "DiscountRate" ) );
|
bo.setAttributeValue( "FINANCING_RATE", f.get( "DiscountRate" ) );
|
||||||
bo.setAttributeValue( "DISCOUNT", f.get( "Discount" ) );
|
// bo.setAttributeValue( "DISCOUNT", f.get( "Discount" ) );
|
||||||
|
bo.setAttributeValue( "DISCOUNT_INTEREST", f.get( "Discount" ) );
|
||||||
}
|
}
|
||||||
String isBalanceLending = f.get( "IsBalanceLending" );
|
String isBalanceLending = f.get( "IsBalanceLending" );
|
||||||
bo.setAttributeValue( "IS_BALANCE_LENDING", isBalanceLending );
|
bo.setAttributeValue( "IS_BALANCE_LENDING", isBalanceLending );
|
||||||
|
|||||||
@ -149,4 +149,8 @@ public interface LC_CALC_SUBSECTION_INFO_TEMP{
|
|||||||
* ÈÚ×ʽð¶î×îСֵ STRING(32<br>
|
* ÈÚ×ʽð¶î×îСֵ STRING(32<br>
|
||||||
*/
|
*/
|
||||||
public static final String MIN_LEASE_MONEY = "MIN_LEASE_MONEY";
|
public static final String MIN_LEASE_MONEY = "MIN_LEASE_MONEY";
|
||||||
|
/**
|
||||||
|
* ÌùÏ¢½ð¶î
|
||||||
|
*/
|
||||||
|
public static final String DISCOUNT_INTEREST = "DISCOUNT_INTEREST";
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user