68 lines
2.6 KiB
Java
68 lines
2.6 KiB
Java
package com.tenwa.lease.app.quartzmession;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
|
|
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.base.util.QuartzUtil;
|
|
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
|
import com.tenwa.reckon.util.Conn;
|
|
|
|
import jbo.app.tenwa.customer.LB_TEST;
|
|
import jbo.com.tenwa.entity.comm.own.LC_SOURCE_OF_FUNDS;
|
|
|
|
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();
|
|
|
|
try {
|
|
JBOTransaction tx = JBOFactory.createJBOTransaction();
|
|
//BizObjectManager LCBizObjectManager =JBOFactory.getBizObjectManager(LC_SOURCE_OF_FUNDS.CLASS_NAME,tx);
|
|
Transaction Sqlca = null;
|
|
Sqlca = Transaction.createTransaction(tx);
|
|
String insertSql="INSERT INTO LC_SOURCE_OF_FUNDS (id, contract_no, businesstype, lease_acc_name)"+
|
|
" (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 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);
|
|
tx.commit();
|
|
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();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|