80 lines
2.6 KiB
Java
80 lines
2.6 KiB
Java
package com.tenwa.lease.app.quartzmession;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import jbo.app.tenwa.calc.LC_RENT_INCOME;
|
|
import jbo.app.tenwa.calc.VI_LC_RENT_PLAN;
|
|
import jbo.com.tenwa.lease.comm.CONFIGURATE;
|
|
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
|
|
|
import org.quartz.Job;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
|
|
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;
|
|
import com.amarsoft.are.util.StringFunction;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
import com.amarsoft.dict.als.cache.CacheLoaderFactory;
|
|
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
|
import com.tenwa.reckon.util.UUIDUtil;
|
|
|
|
|
|
/**
|
|
* 结清半年后网银自动确认收入
|
|
* @author tangfutang
|
|
*/
|
|
public class SurplusMoneyMakeSureIn implements Job{
|
|
|
|
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
|
JBOTransaction tx=null;
|
|
Transaction Sqlca = null;
|
|
try {
|
|
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
|
tx = Sqlca.getTransaction();
|
|
String date_sql = "SELECT DATE_ADD(STR_TO_DATE(lri.hire_date,'%Y/%m/%d'),INTERVAL 183 DAY) as hire_date,contract_id FROM lb_contract_info lci LEFT JOIN (SELECT lria.hire_date, lria.contract_id FROM lc_rent_income lria WHERE lria.hire_date = (SELECT MAX(lrib.hire_date) FROM lc_rent_income lrib WHERE lria.contract_id = lrib.contract_id) GROUP BY contract_id) lri ON lri.contract_id = lci.id WHERE lci.contract_status ='100' OR lci.contract_status ='105'";
|
|
List<Map<String, String>> date_list = DataOperatorUtil.getDataBySql(date_sql);
|
|
for(int i=0;i<date_list.size();i++){
|
|
String contractId = date_list.get(i).get("contract_id");
|
|
String hireDate = date_list.get(i).get("hire_date");
|
|
Date nowDate=new Date();
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
Date old=df.parse(hireDate);
|
|
if(!nowDate.before(old)){
|
|
//多余的网银收款进行确认收入
|
|
}
|
|
}
|
|
|
|
} catch (JBOException e) {
|
|
if (tx != null) {
|
|
try {
|
|
tx.rollback();
|
|
tx=null;
|
|
} catch (JBOException e1) {
|
|
e1.printStackTrace();
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}finally{
|
|
try {
|
|
if(tx !=null){
|
|
|
|
tx.commit();
|
|
}
|
|
} catch (JBOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|