diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/Daypenalty.java b/src_tenwa/com/tenwa/lease/app/quartzmession/Daypenalty.java new file mode 100644 index 000000000..56d4d49e9 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/Daypenalty.java @@ -0,0 +1,79 @@ +package com.tenwa.lease.app.quartzmession; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jbo.com.tenwa.lease.comm.CONTRACT_RENT_MONTH; + +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import com.amarsoft.app.awe.config.InitDBType; +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.ASResultSet; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; +import com.base.util.QuartzUtil; +import com.tenwa.leasing.service.voucher.CreateVoucherService; +import com.tenwa.leasing.serviceImpl.voucher.CreateVoucherServiceImpl; +import com.tenwa.reckon.constant.Scale; +import com.tenwa.reckon.util.Conn; +import com.tenwa.reckon.util.DateTools; +import com.tenwa.reckon.util.DateUtils; + +public class Daypenalty implements Job{ + + + /* + * (non-Javadoc) + * @see org.quartz.Job#execute(org.quartz.JobExecutionContext) + * 定时生成罚息,更新lc_rent_plan表penalty和插入日志表。 + */ + @Override + public void execute(JobExecutionContext arg0) throws JobExecutionException { + + JBOTransaction tx=null; + Conn conn=null; + String startime =StringFunction.getTodayNow();; + try { + tx= JBOFactory.createJBOTransaction(); + conn= new Conn(tx); + // 未计提或发生变更的合同重新计提 + String sql="UPDATE lc_rent_plan SET penalty =getRentPenalty(lc_rent_plan.PAYMENT_NUMBER,lc_rent_plan.PLAN_LIST,DATE_FORMAT (SYSDATE(),'%Y/%m/%d')) "; + conn.executeUpdate(sql); + tx.commit(); + + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Daypenalty", "success", "成功"); + } catch (Exception e) { + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Daypenalty", "success", "失败"); + logger.error(e.getMessage()); + e.printStackTrace(); + }finally{ + if(tx!=null){ + try { + tx.rollback(); + } catch (JBOException e) { + e.printStackTrace(); + } + conn = null; + } + } + } + + private static Log logger=ARE.getLog(); +} + +