diff --git a/WebContent/Tenwa/Lease/App/calculation/calculationContractCar.jsp b/WebContent/Tenwa/Lease/App/calculation/calculationContractCar.jsp index 2614063db..a98aab31e 100644 --- a/WebContent/Tenwa/Lease/App/calculation/calculationContractCar.jsp +++ b/WebContent/Tenwa/Lease/App/calculation/calculationContractCar.jsp @@ -64,7 +64,8 @@ ratioRes = terminateInfo.ratio; yearrate = terminateInfo.yearrate; nominalPrice = terminateInfo.nominalPrice; - cautionmoney = terminateInfo.cautionmoney; + cautionmoney=AsControl.RunJavaMethod("com.tenwa.reckon.executor.RentTerminateHelper","getCautionMoney","contractId="+sReturn[0]); + //cautionmoney = terminateInfo.cautionmoney; // alert("contractId=" + sReturn[0]); // alert("paymentnumber=" + paymentnumber); // alert("ratioRes=" + ratioRes); diff --git a/calc/com/tenwa/reckon/executor/RentTerminateHelper.java b/calc/com/tenwa/reckon/executor/RentTerminateHelper.java new file mode 100644 index 000000000..e040cca8b --- /dev/null +++ b/calc/com/tenwa/reckon/executor/RentTerminateHelper.java @@ -0,0 +1,52 @@ +package com.tenwa.reckon.executor; + +import com.amarsoft.are.jbo.JBOException; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.reckon.util.Conn; + +import java.util.List; +import java.util.Map; + +public class RentTerminateHelper { + private String contractId; + /** + * 获取提期结清的 其他应退 + * @return + * @throws Exception + */ + public String getCautionMoney() throws Exception { + String fundSql ="select ifnull(round( sum(case lfi.FEE_TYPE when 'feetype2' then FACT_MONEY else 0 end)- sum(case lfi.FEE_TYPE when 'feetype2' then 0 else FACT_MONEY end ),2),0) as over_caution_monry" + + " from lc_fund_income lfi where lfi.CONTRACT_ID = ? and lfi.FEE_TYPE in ('feetype2', 'feetype16', 'feetype17')"; + JBOTransaction tx=null; + try { + tx= JBOFactory.createJBOTransaction(); + Conn conn = new Conn(tx); + List> list = conn.executeQuery(fundSql, this.contractId); + if(null != list && list.size() > 0 ){ + Map fundMap = list.get(0); + return fundMap.get("over_caution_monry"); + }else{ + return "0"; + } + } catch (JBOException e) { + tx.rollback(); + // TODO Auto-generated catch block + e.printStackTrace(); + }finally{ + if(tx!=null){ + tx.commit(); + } + } + return "-1"; + } + + + public String getContractId() { + return contractId; + } + + public void setContractId(String contractId) { + this.contractId = contractId; + } +}