From c855e8926fd3a55c352f9d3ab5de13d4962b69c3 Mon Sep 17 00:00:00 2001 From: yjf <2211675158@qq.com> Date: Thu, 9 Dec 2021 17:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=AE=B5=E8=9E=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LCCalcSubsectionInfoTempList.jsp | 30 +++++++++++-------- .../executor/CreateTransactionExecutor.java | 6 ++++ .../executor/SegmentedFinancingExecutor.java | 8 ++--- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp b/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp index 0f062b7a8..e0ff5e838 100644 --- a/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp +++ b/WebContent/Accounting/LoanSimulation/LCCalcSubsectionInfoTempList.jsp @@ -74,7 +74,7 @@ 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' ); - var cleanLeaseRatio = getItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO' ); + var cleanLeaseRatio = getItemValue( 0, this.id.replace(/[^\d]/g,'').substr(1,1), 'CLEAN_LEASE_RATIO' ); if ( subsectionConfig ) { var fcleanLeaseMoney ; if ( 'CarPrice' === subsectionConfig ) { @@ -82,17 +82,17 @@ } else { fcleanLeaseMoney = Decimal( cleanLeaseMoney ).mul( cleanLeaseRatio ).div( 100 ).toFixed( 2 ) } - var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' ) ; - var minLeaseMoney = getItemValue( 0, getRow(), 'MIN_LEASE_MONEY' ); + var maxLeaseMoney = getItemValue( 0,this.id.replace(/[^\d]/g,'').substr(1,1), 'MAX_LEASE_MONEY' ) ; + var minLeaseMoney = getItemValue( 0,this.id.replace(/[^\d]/g,'').substr(1,1), 'MIN_LEASE_MONEY' ); if(typeof(fcleanLeaseMoney)!="undefined" && fcleanLeaseMoney.length!=0 && (Number(fcleanLeaseMoney) > Number(maxLeaseMoney) || Number(fcleanLeaseMoney) < Number(minLeaseMoney))){ - setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', ''); - setItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO', ''); + setItemValue( 0, this.id.replace(/[^\d]/g,'').substr(1,1), 'CLEAN_LEASE_MONEY', ''); + setItemValue( 0, this.id.replace(/[^\d]/g,'').substr(1,1), 'CLEAN_LEASE_RATIO', ''); alert("该段的融资金额不在产品配置的区间内,请检查!"); return } - setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', fcleanLeaseMoney); + setItemValue( 0, this.id.replace(/[^\d]/g,'').substr(1,1), 'CLEAN_LEASE_MONEY', fcleanLeaseMoney); } else { - setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', '' ); + setItemValue( 0, this.id.replace(/[^\d]/g,'').substr(1,1), 'CLEAN_LEASE_MONEY', '' ); } } @@ -121,20 +121,24 @@ } function save() { + let subsectionConfig = parent.getItemValue( 0, 0, 'SUBSECTION_CONDIG' ); + if (!subsectionConfig) { + alert('请选择分段配置'); + return; + } var rowCount = getRowCount( 0 ); // var allRatio = Decimal( 0 ); var clmCheck = Decimal( 0 ); for ( var i = 0; i < rowCount; i ++ ) { - // var cleanLeaseRatio = getItemValue( 0, i, 'CLEAN_LEASE_RATIO' ); + var cleanLeaseRatio = getItemValue( 0, i, 'CLEAN_LEASE_RATIO' ); + if(!cleanLeaseRatio ){ + alert( '第' + ( i + 1 ) + '行融资额比例为空,请检查!' ); + return; + } var cleanLeaseMoney = getItemValue( 0, i, 'CLEAN_LEASE_MONEY' ); if ( cleanLeaseMoney ) { clmCheck = clmCheck.add( cleanLeaseMoney ); } - - if ( '' === cleanLeaseMoney ) { - alert( '请选择分段配置' ); - return; - } var discountCalcMethod = getItemValue( 0, i, 'DISCOUNT_CALC_METHOD' ); if ( '2' === discountCalcMethod ) { var discount = getItemValue( 0, i, 'DISCOUNT_INTEREST' ); diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index 6c81c0fa4..63a47e36b 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -771,6 +771,12 @@ public class CreateTransactionExecutor implements Transaction { ConditionHelper helper = new ConditionHelper(); helper.setTx(tx); helper.run(jsonObject, cb, bean, rentPlan,flag); + String settleMethod = bean.getCb().getSettleMethod(); + //更新商务条件表贴息字段--分段融 + if("segmented_financing".equals(settleMethod)){ + com.amarsoft.awe.util.Transaction.createTransaction(tx).executeSQL("update lc_calc_condition_temp lcct set lcct.DISCOUNT_INTEREST = (select sum(ifnull(DISCOUNT_INTEREST, 0)) from lc_calc_subsection_info_temp lcsit where lcct.FLOWUNID = lcsit.FLOWUNID) where lcct.FLOWUNID = '"+bean.getDocId()+"'"); + } + } diff --git a/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java b/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java index 68c431f2a..684e7864f 100644 --- a/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java +++ b/calc/com/tenwa/reckon/executor/SegmentedFinancingExecutor.java @@ -84,17 +84,13 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor { }else { bo.setAttributeValue( "DISCOUNT_INTEREST", discount ); } - String fr = bo.getAttribute( "FINANCING_RATE" ).getString(); - if ( StringUtils.isEmpty( fr ) || ( iulma!=null && "Y".equals(iulma) ) ) { financingRate = discountRate; bo.setAttributeValue( "FINANCING_RATE", discountRate.multiply( new BigDecimal( 100 ) ).toString() ); } else { financingRate = new BigDecimal( fr ).divide( new BigDecimal( 100 ), 20, 4 ); } - bo.setAttributeValue( tcb.getPlanCName(), tcb.getPlanCValue() ); - bom.saveObject( bo ); } else if("2".equals( discountCalcMethod )) { //根据金额算利率 // 贴息金额 BigDecimal discount = new BigDecimal( bo.getAttribute( "DISCOUNT_INTEREST" ).getString() ); @@ -116,13 +112,13 @@ public class SegmentedFinancingExecutor extends FundRentPlanExecutor { } else { financingRate = new BigDecimal( fr ).divide( new BigDecimal( 100 ), 20, 4 ); } - bo.setAttributeValue( tcb.getPlanCName(), tcb.getPlanCValue() ); - bom.saveObject( bo ); }else if("3".equals( discountCalcMethod )) { // 固定值 financingRate = new BigDecimal( bo.getAttribute( "FINANCING_RATE" ).getString() ).divide( new BigDecimal( 100 ), 20, 4 ); } else { throw new BusinessException( "分段信息没有配置计算规则,无法测算!" ); } + bo.setAttributeValue( tcb.getPlanCName(), tcb.getPlanCValue() ); + bom.saveObject( bo ); //校验贴息是否在配置的区间内 BigDecimal discountCheck = new BigDecimal( bo.getAttribute( "DISCOUNT_INTEREST" ).getString() ); if(discountCheck.compareTo( new BigDecimal( bo.getAttribute( "MAXIMUM_DISCOUNT" ).getString() ) ) < 0) {