apzl_leasing/src_tenwa/com/tenwa/apzl/comm/CopyLbCarLicensePlateTempToForm.java
2020-04-29 19:23:04 +08:00

35 lines
1.6 KiB
Java

package com.tenwa.apzl.comm;
import java.util.HashMap;
import java.util.Map;
import jbo.com.tenwa.lease.comm.LB_CAR_LICENSE_PLATE_INFO;
import jbo.com.tenwa.lease.comm.LB_CAR_LICENSE_PLATE_INFO_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.flow.baseBussion.BaseBussiness;
public class CopyLbCarLicensePlateTempToForm extends BaseBussiness{
@Override
public Object run(Transaction Sqlca) throws Exception {
this.initBussinessParam(Sqlca);
String contract_id = this.getAttribute("ContractId").toString();
String flowunid = this.getAttribute("ObjectNo").toString();
Map<String,String> fromCondtion = new HashMap<String,String>();
fromCondtion.put("FLOWUNID", flowunid);
Map<String,String> toCondtion = new HashMap<String,String>();
toCondtion.put("contract_id", contract_id);
BizObject lclpit = JBOFactory.createBizObjectQuery(LB_CAR_LICENSE_PLATE_INFO_TEMP.CLASS_NAME, "FLOWUNID=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
if(lclpit !=null && lclpit.getAttribute("plate_number") !=null ){
Sqlca.executeSQL(new SqlObject("UPDATE LB_EQUIPMENT_CAR SET LICENSE_PLATE_NUMBER='"+lclpit.getAttribute("plate_number").getString()+"' WHERE contract_id='"+contract_id+"'"));
}
DataOperatorUtil.copySingleJBO(LB_CAR_LICENSE_PLATE_INFO_TEMP.CLASS_NAME, fromCondtion, LB_CAR_LICENSE_PLATE_INFO.CLASS_NAME, toCondtion, null, Sqlca);
return "true";
}
}