66 lines
2.4 KiB
Java
66 lines
2.4 KiB
Java
package com.tenwa.flow.action.comm;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import jbo.com.tenwa.entity.comm.flow.D_DEPOSITCHARGE_INFO;
|
|
import jbo.com.tenwa.entity.comm.flow.D_DEPOSITRETURN_INFO;
|
|
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.are.jbo.BizObjectManager;
|
|
import com.amarsoft.are.jbo.JBOException;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
|
|
|
public class SelectBalance {
|
|
private String distributor_no;
|
|
private String CAUTION_MONEY;
|
|
public String getDistributor_no() {
|
|
return distributor_no;
|
|
}
|
|
public void setDistributor_no(String distributor_no) {
|
|
this.distributor_no = distributor_no;
|
|
}
|
|
|
|
public String getCAUTION_MONEY() {
|
|
return CAUTION_MONEY;
|
|
}
|
|
public void setCAUTION_MONEY(String cAUTION_MONEY) {
|
|
CAUTION_MONEY = cAUTION_MONEY;
|
|
}
|
|
|
|
|
|
public String runs(JBOTransaction tx) throws Exception{
|
|
Transaction scql=Transaction.createTransaction(tx);
|
|
String money="";
|
|
Map<String,String> params= new HashMap<String,String>();
|
|
params.put("distributor_id", distributor_no);
|
|
String sql="SELECT O.distributor_id,SUM(CASE WHEN O.money_type='ÊÕ¿î' THEN O.caution_money ELSE -O.caution_money END) AS money "
|
|
+ "FROM D_DEPOSITCHARGE_INFO O WHERE "
|
|
+ "O.distributor_id=:distributor_id GROUP BY O.distributor_id";
|
|
List<Map<String,String>> getSql = DataOperatorUtil.getDataBySql(scql, sql, params);
|
|
//if(aaa.size()>0){
|
|
money=getSql.get(0).get("money");
|
|
//}
|
|
return money;
|
|
|
|
|
|
/*BizObjectManager ddi = JBOFactory.getBizObjectManager(D_DEPOSITCHARGE_INFO.CLASS_NAME,tx);
|
|
BizObject dd = ddi.createQuery("select * from O where distributor_id=:distributorid").setParameter("distributor_id", distributor_no).getSingleResult(false);
|
|
String money = dd.getAttribute("caution_money").toString();
|
|
Integer mon=new Integer(money);
|
|
|
|
BizObjectManager ddi2 = JBOFactory.getBizObjectManager(D_DEPOSITRETURN_INFO.CLASS_NAME,tx);
|
|
BizObject dd2 = ddi2.createQuery("select caution_money from O where distributor_id=:distributorid").setParameter("distributor_id", distributor_no).getSingleResult(false);
|
|
String money2 = dd2.getAttribute("caution_money").toString();
|
|
Integer mon2=new Integer(money2);
|
|
double m = mon-mon2;
|
|
return "m="+m;*/
|
|
}
|
|
}
|
|
|