luojian e4311faa30 1
2018-08-04 19:12:45 +08:00

33 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.tenwa.lease.app.quartzmession;
import jbo.sys.QRTZ_TRIGGERS;
import org.quartz.JobExecutionContext;
import org.quartz.JobKey;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
public class JobInitUserName {
private static JobInitUserName instance;
private JobInitUserName (){}
public static synchronized JobInitUserName getInstance() {
if (instance == null) {
instance = new JobInitUserName();
}
return instance;
}
public static String getUserId(JobExecutionContext arg0,JBOTransaction tx ) throws JBOException{
JobKey jobKey = arg0.getJobDetail().getKey();
String jobName=jobKey.getName();
BizObjectManager Bm=JBOFactory.getBizObjectManager(QRTZ_TRIGGERS.CLASS_NAME, tx);
BizObject bo = Bm.createQuery(" NEXT_FIRE_TIME is null and JOB_NAME='" + jobName + "'").getSingleResult(false);
return bo!=null?bo.getAttribute(QRTZ_TRIGGERS.USERID).toString():"8009U00000002";//·´Ö®ÎªsystemÓû§
}
}