zhouyahui 810bde88ba 1
2018-08-01 09:22:31 +08:00

44 lines
1.6 KiB
Java

package com.tenwa.lease.app.quartzmession;
import java.util.List;
import jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.Configure;
import com.tenwa.collectaudit.cache.CollectAuditInfoCache;
import com.tenwa.comm.util.date.DateAssistant;
public class AutoBuckle implements Job{
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
CollectAuditInfoCache ca = new CollectAuditInfoCache();
JBOTransaction tx;
String plan_date = DateAssistant.getToday();
try {
tx = JBOFactory.createJBOTransaction();
//and (O.rent<>'' or O.rent<>'0' or O.rent<>'0.0')
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('δÊÕ¿î', '²¿·ÖÊÕ¿î') and O.PLAN_DATE <= '"+plan_date+"' and O.BATCH_STATUS<>'process' ").getResultList(true);
StringBuffer ids = new StringBuffer();
for (BizObject bo : bos) {
ids.append(bo.getAttribute("id").getString()+"@");
}
ca.setId(ids.toString().substring(0, ids.toString().length()-1));
Configure CurConfig = Configure.getInstance();
ca.setFileSavePath(CurConfig.getConfigure("InterfaceFileSavePath"));
ca.setInputuserid("system");
ca.setInputorgid("system");
ca.batchCollectManage(tx);
} catch (Exception e) {
e.printStackTrace();
}
}
}