From 646ee76b8e0fd03ca20905eeb330fa4d7bc947ed Mon Sep 17 00:00:00 2001 From: "zhanglei@ap-leasing.com.cn" Date: Mon, 26 Jun 2023 14:51:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AE=A1=E7=90=86=E9=83=A8?= =?UTF-8?q?=E6=9C=88=E5=BA=A6=E7=9B=91=E6=8E=A7=E6=8A=A5=E8=A1=A8=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsertReportOperationMonthly.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportOperationMonthly.java diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportOperationMonthly.java b/src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportOperationMonthly.java new file mode 100644 index 000000000..594fb62cd --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportOperationMonthly.java @@ -0,0 +1,62 @@ +package com.tenwa.lease.app.quartzmession; + + +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; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +public class InsertReportOperationMonthly 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 insert_operation_report()};"; + SqlObject asql = new SqlObject(sql); + Sqlca.executeSQL(asql); + 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(); + if(Sqlca!=null){ + try { + Sqlca.rollback(); + Sqlca = null; + } catch (JBOException e1) { + e1.printStackTrace(); + } + } + }finally{ + if(Sqlca!=null){ + try { + Sqlca.commit(); + Sqlca.disConnect(); + Sqlca = null; + } catch (JBOException e) { + e.printStackTrace(); + } + } + } + } + private static Log logger=ARE.getLog(); +}