90 lines
3.9 KiB
Java
90 lines
3.9 KiB
Java
package com.tenwa.reckon.handler;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
import oracle.net.aso.e;
|
|
import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT_LOG;
|
|
import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT_TEMP;
|
|
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.are.jbo.BizObjectManager;
|
|
import com.amarsoft.are.jbo.BizObjectQuery;
|
|
import com.amarsoft.are.jbo.JBOException;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
|
|
|
|
public class DisributorAccountLogHandlerDelete extends CommonHandler{
|
|
|
|
//KKK经销商日志(新增/修改)通用方法
|
|
public String distributorLogUtilAddAndUpdate(JBOTransaction tx , DistributorAccountLogEntity dale
|
|
) throws JBOException{
|
|
//KKK增加经销商增删改日志
|
|
BizObjectManager bomPL = JBOFactory.getBizObjectManager(DISTRIBUTOR_ACCOUNT_LOG.CLASS_NAME, tx);
|
|
BizObject boPL = bomPL.newObject();
|
|
boPL.setAttributeValue("DISTRIBUTOR_ID", dale.getDistributorId());
|
|
boPL.setAttributeValue("ACTION_TYPE", dale.getActionType());
|
|
boPL.setAttributeValue("TIMESTAMP", dale.getTimestamp());
|
|
boPL.setAttributeValue("ACC_NUMBER", dale.getAccNumber());
|
|
boPL.setAttributeValue("ACCOUNT", dale.getAccount());
|
|
boPL.setAttributeValue("IS_MAIN", dale.getIsMain());
|
|
boPL.setAttributeValue("ACC_INFO", dale.getAccInfo());
|
|
boPL.setAttributeValue("OPEN_BANK", dale.getOpenBank());
|
|
boPL.setAttributeValue("PROVINCE", dale.getProvince());
|
|
boPL.setAttributeValue("DISTRICT", dale.getDistrict());
|
|
bomPL.saveObject(boPL);
|
|
return "logOK";
|
|
}
|
|
|
|
//KKK经销商日志(删除)方法
|
|
public String distributorLogUtilDelete(JBOTransaction tx , DistributorAccountLogEntity dale,String id) throws JBOException {
|
|
BizObjectManager bomPL = JBOFactory.getBizObjectManager(DISTRIBUTOR_ACCOUNT_TEMP.CLASS_NAME, tx);
|
|
BizObject boPL = bomPL.newObject();
|
|
|
|
BizObjectQuery boq = bomPL.createQuery(
|
|
"select distributor_id,acc_number,account,is_main,acc_info,open_bank,provinceInfo,district FROM O WHERE id=:ID");
|
|
boq.setParameter("ID",id);
|
|
boPL = boq.getSingleResult();
|
|
dale.setDistributorId(boPL.getAttribute("DISTRIBUTOR_ID")+"");
|
|
dale.setAccNumber(boPL.getAttribute("ACC_NUMBER")+"");
|
|
dale.setAccount(boPL.getAttribute("ACCOUNT")+"");
|
|
dale.setIsMain(boPL.getAttribute("IS_MAIN")+"");
|
|
dale.setAccInfo(boPL.getAttribute("ACC_INFO")+"");
|
|
dale.setOpenBank(boPL.getAttribute("OPEN_BANK")+"");
|
|
dale.setProvince(boPL.getAttribute("PROVINCEINFO")+"");
|
|
dale.setDistrict(boPL.getAttribute("DISTRICT")+"");
|
|
distributorLogUtilAddAndUpdate(tx,dale);
|
|
return "OK";
|
|
}
|
|
|
|
@Override
|
|
protected void beforeDelete(JBOTransaction tx, BizObject bo)
|
|
throws Exception {//删除前
|
|
DistributorAccountLogEntity daLogEntity = new DistributorAccountLogEntity();
|
|
//DISTRIBUTOR_ACCOUNT_TEMP
|
|
daLogEntity.setActionType("D");
|
|
daLogEntity.setTimestamp(String.valueOf(new Date().getTime()));
|
|
System.err.println("deletedelete!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!22");
|
|
distributorLogUtilDelete(tx,daLogEntity, bo.getAttribute("id").getString());
|
|
|
|
/*System.err.println("ID:"+bo.getAttribute("ID").getString());
|
|
System.err.println("DISTRIBUTOR_ID:"+bo.getAttribute("DISTRIBUTOR_ID").getString());
|
|
System.err.println("时间戳:"+String.valueOf(new Date().getTime()));
|
|
System.err.println("ACC_NUMBER:"+bo.getAttribute("ACC_NUMBER").getString());
|
|
System.err.println("ACCOUNT:"+bo.getAttribute("ACCOUNT").getString());
|
|
System.err.println("IS_MAIN:"+bo.getAttribute("IS_MAIN").getString());
|
|
System.err.println("ACC_INFO:"+bo.getAttribute("ACC_INFO").getString());
|
|
System.err.println("OPEN_BANK:"+bo.getAttribute("OPEN_BANK").getString());
|
|
System.err.println("PROVINCE:"+bo.getAttribute("provinceInfo").getString());
|
|
System.err.println("DISTRICT:"+bo.getAttribute("DISTRICT").getString());*/
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|