package com.amarsoft.acct.accounting.web; import com.amarsoft.app.base.businessobject.BusinessObject; import com.amarsoft.app.base.businessobject.BusinessObjectManager; import com.amarsoft.app.base.util.BUSINESSOBJECT_CONSTANTS; import com.amarsoft.app.base.util.DateHelper; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.are.lang.DataElement; import com.amarsoft.awe.dw.handler.impl.CommonHandler; public class CommonTransactionHandler extends CommonHandler{ protected void afterUpdate(JBOTransaction tx, BizObject bo) throws Exception { BusinessObjectManager bomanager = BusinessObjectManager.createBusinessObjectManager(tx); String transSerialNo = this.asPage.getParameter("ObjectNo"); BusinessObject transaction = bomanager.loadBusinessObject(BUSINESSOBJECT_CONSTANTS.transaction, "SerialNo",this.asPage.getParameter("ObjectNo")); if(transaction == null ) throw new Exception("未找到对应的交易【"+transSerialNo+"】"); String transDate =""; DataElement e = bo.getAttribute("TransDate"); if(e == null) transDate = DateHelper.getBusinessDate(); else transDate = e.getString(); transaction.setAttributeValue("TransStatus", "0"); transaction.setAttributeValue("TransDate", transDate); bomanager.updateBusinessObject(transaction); bomanager.updateDB(); } }