package com.tenwa.flow; import java.util.HashMap; import java.util.Map; import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT; import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT_TEMP; import jbo.app.tenwa.customer.DISTRIBUTOR_INFO; import jbo.app.tenwa.customer.DISTRIBUTOR_INFO_TEMP; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.awe.util.Transaction; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.baseBussion.BaseBussiness; public class CopyDChargeFormalToTemp extends BaseBussiness{ @Override public Object run(Transaction Sqlca) throws Exception { this.initBussinessParam(Sqlca); String flowunid = this.getAttribute("ObjectNo").toString(); String id = this.getAttribute("ProjectId").toString(); BizObject bizObject=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"id=:id") .setParameter("id",id).getSingleResult(false); String distributorno=""; if(bizObject!=null){ distributorno=bizObject.getAttribute("distributor_no")==null?"":bizObject.getAttribute("distributor_no").toString(); } Map fromCondtion = new HashMap(); fromCondtion.put("ID",id); Map otherProperty = new HashMap(); otherProperty.put("FLOWUNID",flowunid); DataOperatorUtil.copySingleJBO(DISTRIBUTOR_INFO.CLASS_NAME, fromCondtion, DISTRIBUTOR_INFO_TEMP.CLASS_NAME, null, otherProperty, Sqlca); fromCondtion.clear(); fromCondtion.put("distributor_id", distributorno); DataOperatorUtil.copySingleJBO(DISTRIBUTOR_ACCOUNT.CLASS_NAME, fromCondtion, DISTRIBUTOR_ACCOUNT_TEMP.CLASS_NAME, null, otherProperty, Sqlca); return "true"; } }