65 lines
1.9 KiB
Java
65 lines
1.9 KiB
Java
package com.tenwa.customer.cache;
|
|
|
|
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 OverdueDunningCache {
|
|
//´ß¿îÔ±
|
|
public static String getPartDept(String id) throws JBOException
|
|
{
|
|
String username="";
|
|
Transaction Sqlca =null;
|
|
try {
|
|
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
|
String sql="SELECT usr.username FROM overdue_dunning_info over LEFT JOIN user_info usr ON over.part_dept=usr.userid WHERE contract_id=:contract_id";
|
|
SqlObject asql = new SqlObject(sql);
|
|
asql.setParameter("contract_id", id);
|
|
ASResultSet rs = null;
|
|
rs = Sqlca.getASResultSet(asql);
|
|
if(rs.next()){
|
|
username=rs.getStringValue("username");
|
|
}
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}finally{
|
|
if(Sqlca!=null){
|
|
Sqlca.disConnect();
|
|
Sqlca = null;
|
|
}
|
|
}
|
|
return username;
|
|
}
|
|
//´ß¿îÔ±
|
|
public static String getPartDeptID(String id) throws JBOException
|
|
{
|
|
String username="";
|
|
Transaction Sqlca =null;
|
|
try {
|
|
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
|
String sql="SELECT usr.userid FROM overdue_dunning_info over LEFT JOIN user_info usr ON over.part_dept=usr.userid WHERE contract_id=:contract_id";
|
|
SqlObject asql = new SqlObject(sql);
|
|
asql.setParameter("contract_id", id);
|
|
ASResultSet rs = null;
|
|
rs = Sqlca.getASResultSet(asql);
|
|
if(rs.next()){
|
|
username=rs.getStringValue("userid");
|
|
}
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}finally{
|
|
if(Sqlca!=null){
|
|
Sqlca.disConnect();
|
|
Sqlca = null;
|
|
}
|
|
}
|
|
return username;
|
|
}
|
|
}
|