56 lines
1.8 KiB
Java
56 lines
1.8 KiB
Java
package com.tenwa.lease.app.quartzmession;
|
|
|
|
import com.amarsoft.are.jbo.JBOException;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
import com.amarsoft.are.sql.Connection;
|
|
import com.amarsoft.are.util.StringFunction;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
import com.base.util.QuartzUtil;
|
|
|
|
import org.quartz.Job;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
|
|
import java.sql.CallableStatement;
|
|
import java.time.LocalDate;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
|
/**
|
|
* 天津税控自动拷表
|
|
*/
|
|
public class AutoCopyTaxInfoTJ implements Job {
|
|
@Override
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
JBOTransaction tx;
|
|
Transaction tran = null;
|
|
String startime = StringFunction.getTodayNow();
|
|
Object userId = jobExecutionContext.getTrigger().getJobDataMap().get("CurUserId");
|
|
String curUserId = userId == null? "system" : userId.toString();
|
|
try {
|
|
tx = JBOFactory.createJBOTransaction();
|
|
tran = Transaction.createTransaction(tx);
|
|
|
|
Connection connection = tran.getConnection(tran);
|
|
CallableStatement callableStatement = connection.prepareCall("{call PROC_calc_tax_tj}");
|
|
callableStatement.execute();
|
|
callableStatement.close();
|
|
|
|
tran.commit();
|
|
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.AutoCopyTaxInfoTJ", "success", "成功", curUserId);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.AutoCopyTaxInfoTJ", "error", "失败", curUserId);
|
|
try {
|
|
if (tran != null) {
|
|
tran.rollback();
|
|
}
|
|
} catch (JBOException e1) {
|
|
e1.printStackTrace();
|
|
}
|
|
throw new JobExecutionException(e);
|
|
}
|
|
}
|
|
}
|