apzl_leasing/calc/com/tenwa/flow/CopyDChargeFormalToTemp.java
2018-06-28 11:09:10 +08:00

43 lines
1.7 KiB
Java

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<String,String> fromCondtion = new HashMap<String,String>();
fromCondtion.put("ID",id);
Map<String,String> otherProperty = new HashMap<String,String>();
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";
}
}