fix:提前结清测算功能调整

This commit is contained in:
maliang 2022-11-15 10:10:51 +08:00
parent fa2e6ae924
commit dd00aacad8
2 changed files with 54 additions and 1 deletions

View File

@ -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);

View File

@ -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<Map<String, String>> list = conn.executeQuery(fundSql, this.contractId);
if(null != list && list.size() > 0 ){
Map<String, String> 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;
}
}