diff --git a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml index 258c5fb45..0299a6209 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml @@ -2919,5 +2919,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/calc/com/tenwa/reckon/handler/DisributorAccountLogHandlerDelete.java b/calc/com/tenwa/reckon/handler/DisributorAccountLogHandlerDelete.java new file mode 100644 index 000000000..ee959a830 --- /dev/null +++ b/calc/com/tenwa/reckon/handler/DisributorAccountLogHandlerDelete.java @@ -0,0 +1,89 @@ +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());*/ + } + + + + + + +} diff --git a/calc/com/tenwa/reckon/handler/DistributorAccountLogEntity.java b/calc/com/tenwa/reckon/handler/DistributorAccountLogEntity.java new file mode 100644 index 000000000..b37bf832b --- /dev/null +++ b/calc/com/tenwa/reckon/handler/DistributorAccountLogEntity.java @@ -0,0 +1,119 @@ +package com.tenwa.reckon.handler; + +/** + * DistributorAccountLogEntity + * this is table 'distributor_account_log' of entity + * @author K + * + */ +public class DistributorAccountLogEntity { + + private String distributorId,actionType,timestamp,accNumber,account,isMain,accInfo,openBank,province,district; + + public DistributorAccountLogEntity() { + super(); + } + + public DistributorAccountLogEntity(String distributorId, + String actionType, String timestamp, String accNumber, + String account, String isMain, String accInfo, String openBank, + String province, String district) { + super(); + this.distributorId = distributorId; + this.actionType = actionType; + this.timestamp = timestamp; + this.accNumber = accNumber; + this.account = account; + this.isMain = isMain; + this.accInfo = accInfo; + this.openBank = openBank; + this.province = province; + this.district = district; + } + + + public String getActionType() { + return actionType; + } + + + public void setActionType(String actionType) { + this.actionType = actionType; + } + + public String getDistributorId() { + return distributorId; + } + + public void setDistributorId(String distributorId) { + this.distributorId = distributorId; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String getAccNumber() { + return accNumber; + } + + public void setAccNumber(String accNumber) { + this.accNumber = accNumber; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getIsMain() { + return isMain; + } + + public void setIsMain(String isMain) { + this.isMain = isMain; + } + + public String getAccInfo() { + return accInfo; + } + + public void setAccInfo(String accInfo) { + this.accInfo = accInfo; + } + + public String getOpenBank() { + return openBank; + } + + public void setOpenBank(String openBank) { + this.openBank = openBank; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + + + +} diff --git a/calc/com/tenwa/reckon/handler/DistributorAccountLogHandler.java b/calc/com/tenwa/reckon/handler/DistributorAccountLogHandler.java new file mode 100644 index 000000000..ae9eba1ec --- /dev/null +++ b/calc/com/tenwa/reckon/handler/DistributorAccountLogHandler.java @@ -0,0 +1,110 @@ +package com.tenwa.reckon.handler; + +import java.util.Date; + +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.BusinessProcessData; +import com.amarsoft.awe.dw.handler.impl.CommonHandler; +import com.amarsoft.biz.workflow.graph.model.BusinessProcess; + +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(String.valueOf(new Date().getTime())); + 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(String.valueOf(new Date().getTime())); + 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(String.valueOf(new Date().getTime())); + 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(String.valueOf(new Date().getTime())); + 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); + + } + +}