86 lines
3.7 KiB
Java
86 lines
3.7 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.JBOException;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
import com.amarsoft.awe.Configure;
|
|
import com.amarsoft.awe.util.ASResultSet;
|
|
import com.amarsoft.awe.util.SqlObject;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
import com.base.util.QuartzUtil;
|
|
import com.tenwa.collectaudit.cache.CollectAuditInfoCache;
|
|
import com.tenwa.collectaudit.cache.CollectAuditInfoCacheTj;
|
|
import com.tenwa.comm.util.date.DateAssistant;
|
|
import com.tenwa.lease.app.allinpay.service.impl.AllinpayPaymentQueryRun;
|
|
|
|
public class AutoRefresh implements Job{
|
|
|
|
@Override
|
|
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
|
CollectAuditInfoCache ca = new CollectAuditInfoCache();
|
|
JBOTransaction tx = null;
|
|
String plan_date = DateAssistant.getToday();
|
|
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
|
|
String curUserId = userId == null? "system" : userId.toString();
|
|
try {
|
|
tx = JBOFactory.createJBOTransaction();
|
|
Transaction Sqlca = Transaction.createTransaction(tx);
|
|
String sSql = "SELECT STATUS FROM lb_card_buckle_status WHERE STATUS='Y' ";
|
|
SqlObject asql = new SqlObject(sSql);
|
|
ASResultSet rs = Sqlca.getASResultSet(asql);
|
|
if(rs.next()) {
|
|
return ;
|
|
}
|
|
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('δÊÕ¿î', '²¿·ÖÊÕ¿î','´ú³¥') and O.SUBJECTID='aa740e4111c111eaaa0000163e0e11e6' and O.collect_type='YLcollect' and O.BATCH_STATUS='process' and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
|
|
StringBuffer ids = new StringBuffer();
|
|
if(bos!=null && bos.size()>0){
|
|
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.queryBatchCollectStatus(tx);
|
|
}
|
|
//Ìì½ò×Ô¶¯»ØÅÌ
|
|
CollectAuditInfoCacheTj caTj = new CollectAuditInfoCacheTj();
|
|
List<BizObject> bosTj = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('δÊÕ¿î', '²¿·ÖÊÕ¿î','´ú³¥') and O.SUBJECTID='d989246c11c111eaaa0000163e0e11e6' and O.collect_type='YLcollect' and O.BATCH_STATUS='process' and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
|
|
StringBuffer idsTj = new StringBuffer();
|
|
if(bosTj!=null && bosTj.size()>0){
|
|
for (BizObject bo : bosTj) {
|
|
idsTj.append(bo.getAttribute("id").getString()+"@");
|
|
}
|
|
caTj.setId(idsTj.toString().substring(0, idsTj.toString().length()-1));
|
|
Configure CurConfig = Configure.getInstance();
|
|
caTj.setFileSavePath(CurConfig.getConfigure("InterfaceFileSavePath"));
|
|
caTj.setInputuserid("system");
|
|
caTj.setInputorgid("system");
|
|
caTj.queryBatchCollectStatus(tx);
|
|
}
|
|
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoRefresh", "success", "³É¹¦",curUserId);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoRefresh", "error", "ʧ°Ü",curUserId);
|
|
}finally{
|
|
try {
|
|
tx.commit();
|
|
} catch (JBOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
AllinpayPaymentQueryRun run = new AllinpayPaymentQueryRun();
|
|
new Thread(run).start();
|
|
}
|
|
}
|