package com.tenwa.reckon.handler; import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT_LOG; 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.are.util.StringFunction; import com.amarsoft.awe.dw.handler.impl.CommonHandler; public class DistributorAccountLogHandler 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"; } /*@Override protected void beforeInsert(JBOTransaction tx, BizObject bo) throws Exception {//增加前 DistributorAccountLogEntity daLogEntity = new DistributorAccountLogEntity(); daLogEntity.setDistributorId(bo.getAttribute("DISTRIBUTOR_ID").getString()); daLogEntity.setActionType("A"); daLogEntity.setTimestamp(StringFunction.getTodayNow()); daLogEntity.setAccNumber(bo.getAttribute("ACC_NUMBER").getString()); daLogEntity.setAccount(bo.getAttribute("ACCOUNT").getString()); daLogEntity.setIsMain(bo.getAttribute("IS_MAIN").getString()); daLogEntity.setAccInfo(bo.getAttribute("ACC_INFO").getString()); daLogEntity.setOpenBank(bo.getAttribute("OPEN_BANK").getString()); daLogEntity.setProvince(bo.getAttribute("PROVINCEINFO").getString()); daLogEntity.setDistrict(bo.getAttribute("DISTRICT").getString()); distributorLogUtilAddAndUpdate(tx,daLogEntity); }*/ @Override protected void afterInsert(JBOTransaction tx, BizObject bo) throws Exception {//增加后 DistributorAccountLogEntity daLogEntity = new DistributorAccountLogEntity(); daLogEntity.setDistributorId(bo.getAttribute("DISTRIBUTOR_ID").getString()); daLogEntity.setActionType("A"); daLogEntity.setTimestamp(StringFunction.getTodayNow()); daLogEntity.setAccNumber(bo.getAttribute("ACC_NUMBER").getString()); daLogEntity.setAccount(bo.getAttribute("ACCOUNT").getString()); daLogEntity.setIsMain(bo.getAttribute("IS_MAIN").getString()); daLogEntity.setAccInfo(bo.getAttribute("ACC_INFO").getString()); daLogEntity.setOpenBank(bo.getAttribute("OPEN_BANK").getString()); daLogEntity.setProvince(bo.getAttribute("provinceInfo").getString()); daLogEntity.setDistrict(bo.getAttribute("DISTRICT").getString()); distributorLogUtilAddAndUpdate(tx,daLogEntity); } @Override protected void beforeUpdate(JBOTransaction tx, BizObject bo) throws Exception {//修改前 DistributorAccountLogEntity daLogEntity = new DistributorAccountLogEntity(); daLogEntity.setDistributorId(bo.getAttribute("DISTRIBUTOR_ID").getString()); daLogEntity.setActionType("U"); daLogEntity.setTimestamp(StringFunction.getTodayNow()); daLogEntity.setAccNumber(bo.getAttribute("ACC_NUMBER").getString()); daLogEntity.setAccount(bo.getAttribute("ACCOUNT").getString()); daLogEntity.setIsMain(bo.getAttribute("IS_MAIN").getString()); daLogEntity.setAccInfo(bo.getAttribute("ACC_INFO").getString()); daLogEntity.setOpenBank(bo.getAttribute("OPEN_BANK").getString()); daLogEntity.setProvince(bo.getAttribute("provinceInfo").getString()); daLogEntity.setDistrict(bo.getAttribute("DISTRICT").getString()); distributorLogUtilAddAndUpdate(tx,daLogEntity); } @Override protected void afterUpdate(JBOTransaction tx, BizObject bo) throws Exception {//修改后 DistributorAccountLogEntity daLogEntity = new DistributorAccountLogEntity(); daLogEntity.setDistributorId(bo.getAttribute("DISTRIBUTOR_ID").getString()); daLogEntity.setActionType("U"); daLogEntity.setTimestamp(StringFunction.getTodayNow()); daLogEntity.setAccNumber(bo.getAttribute("ACC_NUMBER").getString()); daLogEntity.setAccount(bo.getAttribute("ACCOUNT").getString()); daLogEntity.setIsMain(bo.getAttribute("IS_MAIN").getString()); daLogEntity.setAccInfo(bo.getAttribute("ACC_INFO").getString()); daLogEntity.setOpenBank(bo.getAttribute("OPEN_BANK").getString()); daLogEntity.setProvince(bo.getAttribute("provinceInfo").getString()); daLogEntity.setDistrict(bo.getAttribute("DISTRICT").getString()); distributorLogUtilAddAndUpdate(tx,daLogEntity); } }