33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package com.tenwa.lease.function;
|
|
|
|
import java.util.List;
|
|
|
|
import org.omg.CORBA.Object;
|
|
|
|
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
|
import jbo.com.tenwa.lease.comm.LB_FILE_ARCHIVING_INFO;
|
|
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.are.jbo.BizObjectManager;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
|
|
public class ImportContractId {
|
|
|
|
public void updateContractId(Transaction Sqlca ) throws Exception{
|
|
BizObjectManager lfaiManage=JBOFactory.getBizObjectManager(LB_FILE_ARCHIVING_INFO.CLASS_NAME,Sqlca);
|
|
BizObjectManager lciManage=JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,Sqlca);
|
|
List<BizObject> lfais = lfaiManage.createQuery(" (contract_id is null) and (contract_number is not null) ").getResultList(true);
|
|
for (int i=0;i<lfais.size();i++){
|
|
BizObject lfai = lfais.get(i);
|
|
if(lfai !=null ){
|
|
BizObject lci = lciManage.createQuery(" contract_no=:contract_no ").setParameter("contract_no", lfai.getAttribute("contract_number")==null?"":lfai.getAttribute("contract_number").getString()).getSingleResult(false);
|
|
lfai.setAttributeValue("contract_id", lci==null?"":lci.getAttribute("id").toString());
|
|
lfaiManage.saveObject(lfai);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|