2018-08-27 11:59:21 +08:00

56 lines
1.8 KiB
Java

package com.tenwa.lease.app.quartzmession;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.log.Log;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.base.util.QuartzUtil;
public class Commission implements Job{
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx=null;
Transaction Sqlca=null;
String startime =StringFunction.getTodayNow();
startime = startime.substring(0, 10);
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx= JBOFactory.createJBOTransaction();
Sqlca=Transaction.createTransaction(tx);
String sql="{CALL proc_insert_jlyj_his("+"'"+startime+"'"+","+"'"+startime+"'"+")};";
//String sql="{CALL proc_insert_jlyj_his('2018/10/30','2018/10/30')};";
SqlObject asql = new SqlObject(sql);
Sqlca.executeSQL(asql);
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "ʧ°Ü", curUserId);
logger.error(e.getMessage());
e.printStackTrace();
}finally{
if(tx!=null){
try {
tx.rollback();
} catch (JBOException e) {
e.printStackTrace();
}
}
}
}
private static Log logger=ARE.getLog();
}