74 lines
2.3 KiB
Java
74 lines
2.3 KiB
Java
package com.tenwa.lease.app.invoicemanager;
|
|
|
|
import com.amarsoft.are.jbo.JBOException;
|
|
import com.amarsoft.awe.util.ASResultSet;
|
|
import com.amarsoft.awe.util.SqlObject;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
import com.amarsoft.dict.als.cache.CacheLoaderFactory;
|
|
public class InvoiceManagerCache {
|
|
|
|
/**
|
|
* »ñÈ¡ÒÑ¿ª·¢Æ±½ð¶î(×ʽð)
|
|
* @param fundInvoiceId
|
|
* @return
|
|
* @throws JBOException
|
|
*/
|
|
public static String getFundInvoicedMoney(String fundInvoiceId) throws JBOException{
|
|
|
|
String suminvoicedmoney="";
|
|
Transaction Sqlca =null;
|
|
try {
|
|
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
|
String sql="SELECT SUM(INVOICE_MONEY) suminvoicedmoney FROM LI_FUND_INVOICE_DOWNLOAD_INFO WHERE FUND_INVOICE_ID=:fundinvoiceid group by FUND_INVOICE_ID ";
|
|
SqlObject asql = new SqlObject(sql);
|
|
asql.setParameter("fundinvoiceid", fundInvoiceId);
|
|
ASResultSet rs = null;
|
|
rs = Sqlca.getASResultSet(asql);
|
|
if(rs.next()){
|
|
suminvoicedmoney=rs.getStringValue("suminvoicedmoney");
|
|
}
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}finally{
|
|
if(Sqlca!=null){
|
|
Sqlca.disConnect();
|
|
Sqlca = null;
|
|
}
|
|
}
|
|
if(suminvoicedmoney==null||suminvoicedmoney.length()<=0){
|
|
suminvoicedmoney="0";
|
|
}
|
|
return suminvoicedmoney;
|
|
}
|
|
|
|
public static String getRentInvoicedMoney(String rentInvoiceId) throws JBOException{
|
|
|
|
String suminvoicedmoney="";
|
|
Transaction Sqlca =null;
|
|
try {
|
|
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
|
String sql="SELECT SUM(INVOICE_MONEY) suminvoicedmoney FROM LI_RENT_INVOICE_DOWNLOAD_INFO WHERE RENT_INVOICE_ID=:rentinvoiceid group by RENT_INVOICE_ID ";
|
|
SqlObject asql = new SqlObject(sql);
|
|
asql.setParameter("rentinvoiceid", rentInvoiceId);
|
|
ASResultSet rs = null;
|
|
rs = Sqlca.getASResultSet(asql);
|
|
if(rs.next()){
|
|
suminvoicedmoney=rs.getStringValue("suminvoicedmoney");
|
|
}
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}finally{
|
|
if(Sqlca!=null){
|
|
Sqlca.disConnect();
|
|
Sqlca = null;
|
|
}
|
|
}
|
|
if(suminvoicedmoney==null||suminvoicedmoney.length()<=0){
|
|
suminvoicedmoney="0";
|
|
}
|
|
return suminvoicedmoney;
|
|
}
|
|
}
|