72 lines
2.6 KiB
Java
72 lines
2.6 KiB
Java
package com.tenwa.lease.app.quartzmession;
|
|
|
|
import org.quartz.Job;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
|
|
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.base.util.QuartzUtil;
|
|
|
|
public class LBTESTinfo implements Job{
|
|
@Override
|
|
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
|
String startime = StringFunction.getTodayNow();
|
|
|
|
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
|
|
String curUserId = userId == null? "system" : userId.toString();
|
|
|
|
Transaction Sqlca = null;
|
|
try {
|
|
JBOTransaction tx = JBOFactory.createJBOTransaction();
|
|
//BizObjectManager LCBizObjectManager =JBOFactory.getBizObjectManager(LC_SOURCE_OF_FUNDS.CLASS_NAME,tx);
|
|
Sqlca = Transaction.createTransaction(tx);
|
|
String insertSql="INSERT INTO LC_SOURCE_OF_FUNDS (id, contract_no, businesstype, lease_acc_name,if_loan_money)"+
|
|
" (SELECT REPLACE(UUID(), '-', '') AS id,"+
|
|
"lci.contract_no AS contract_no,"+
|
|
"CASE lci.businesstype WHEN '2' THEN '´«Í³Àà' WHEN '3' THEN 'Æû³µÀഫͳ' ELSE 'Æû³µÀà' END AS businesstype,"+
|
|
"CASE WHEN lci.businesstype='1' THEN oo.own_name ELSE oi.own_name END AS lease_acc_name,"+
|
|
"CASE WHEN lci.businesstype='1' THEN 'money03' ELSE '' END AS if_loan_money "+
|
|
"FROM lb_contract_info lci "+
|
|
"LEFT JOIN LB_LESSOR_INFO lit"+
|
|
" ON lci.id = lit.contract_id"+
|
|
" LEFT JOIN OWN_INFO oi "+
|
|
"ON lit.lessor = oi.own_number"+
|
|
" LEFT JOIN OWN_INFO oo ON 1=1 AND oo.id='50ffe19bbff24153ac3406a3b4f5e40d'"+
|
|
" WHERE lci.contract_status >= '31' "+
|
|
"AND lci.contract_no NOT IN "+
|
|
"(SELECT IFNULL(contract_no, '') AS contract_no FROM LC_SOURCE_OF_FUNDS))";
|
|
Sqlca.executeSQL(insertSql);
|
|
QuartzUtil.insertLog(startime, "com.tenwa.lease.app.quartzmession.LBTESTinfo", "success", "³É¹¦", curUserId);
|
|
} catch (Exception e) {
|
|
QuartzUtil.insertLog(startime, "com.tenwa.lease.app.quartzmession.LBTESTinfo", "error", "ʧ°Ü", curUserId);
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|