定时代理插入system或登录人

This commit is contained in:
liuzhao 2018-08-27 11:59:21 +08:00
parent 53665f0989
commit ec2d8e5381
18 changed files with 100 additions and 38 deletions

View File

@ -26,6 +26,10 @@ public class AdjustStartDateYear implements Job {
public void execute(JobExecutionContext arg0) throws JobExecutionException{
JBOTransaction tx=null;
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx=JBOFactory.createJBOTransaction();
AdjustInterestController aic=new AdjustInterestController();
@ -63,9 +67,9 @@ public class AdjustStartDateYear implements Job {
logger.info("起租日年调息完成");
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.reckon.adjustInterest.AdjustStartDateYear", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.reckon.adjustInterest.AdjustStartDateYear", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.reckon.adjustInterest.AdjustStartDateYear", "success", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.reckon.adjustInterest.AdjustStartDateYear", "error", "ʧ°Ü", curUserId);
try {
if(tx!=null){
tx.rollback();

View File

@ -18,15 +18,17 @@ public class HelloJob implements Job {
public void execute(JobExecutionContext arg0) throws JobExecutionException {
//System.out.println(DateUtil.getSystemDateTime());
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
//System.out.println(ProductParamUtil.getProductComponentType("001", "PRD0314"));
BizObjectManager bom = JBOFactory.getBizObjectManager(MSG_SEND_RELATIVE.CLASS_NAME);
BizObject bo = bom.newObject();
bom.saveObject(bo);
//SendMessageUtil.sendMessageByHttpClient("13764771906", "²âÊÔ¶ÌÐÅ£¡");
QuartzUtil.insertLog(startime,"com.amarsoft.app.util.HelloJob", "success", "成功");
QuartzUtil.insertLog(startime,"com.amarsoft.app.util.HelloJob", "success", "成功", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.amarsoft.app.util.HelloJob", "success", "失败");
QuartzUtil.insertLog(startime,"com.amarsoft.app.util.HelloJob", "success", "失败", curUserId);
e.printStackTrace();
}
}

View File

@ -17,12 +17,12 @@ public class QuartzUtil {
* @param status 执行状态 success,notexecute,error
* @param Message 异常信息 成功,不执行或方法不存在,失败
*/
public static void insertLog(String startime,String method, String status, String Message) {
public static void insertLog(String startime,String method, String status, String Message, String username) {
Transaction tran = Transaction.createTransaction("als");
try {
String sql = "insert into qrtz_serial_log(id,method_name,status,close_date,inputtime,message) select '"+UUIDUtil.getUUID()+"','"
String sql = "insert into qrtz_serial_log(id,method_name,status,close_date,inputtime,message,user_name) select '"+UUIDUtil.getUUID()+"','"
+ method + "','" + status + "','"+startime.replaceAll(":", "")+"','"
+ StringFunction.getTodayNow().replaceAll(":", "¡÷") + "','" + Message
+ StringFunction.getTodayNow().replaceAll(":", "¡÷") + "','" + Message + "','" + username
+ "' from dual";
SqlObject so = new SqlObject(sql);
so.setDebugSql(so.getDebugSql().replaceAll("", ":"));

View File

@ -24,13 +24,17 @@ public class BaseMessageJob implements Job {
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx=null;
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx= JBOFactory.createJBOTransaction();
this.executeMessage(tx);
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BaseMessageJob", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BaseMessageJob", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BaseMessageJob", "success", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BaseMessageJob", "error", "ʧ°Ü", curUserId);
try {
if(tx!=null){
tx.rollback();

View File

@ -33,15 +33,19 @@ public class BusinessCancelJob implements Job {
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx=null;
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx= JBOFactory.createJBOTransaction();
this.executeMessage(tx,arg0);
//入项目进度日志
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "error", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "error", "ʧ°Ü", curUserId);
try {
if(tx!=null){
tx.rollback();

View File

@ -27,6 +27,8 @@ public class AutoBuckle implements Job {
CollectAuditInfoCache ca = new CollectAuditInfoCache();
JBOTransaction tx = null;
String plan_date = DateAssistant.getToday();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
// 获取传递过来的参数
try {
//
@ -47,10 +49,10 @@ public class AutoBuckle implements Job {
tx = JBOFactory.createJBOTransaction();
ca.queryBatchCollectStatus(tx);
}
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "success", "成功");
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "success", "³É¹¦", curUserId);
} catch (Exception e) {
e.printStackTrace();
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "error", "失败");
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "error", "ʧ°Ü", curUserId);
}finally{
try {
tx.commit();

View File

@ -69,11 +69,15 @@ public class AutoFiveGradeClassification 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 {
autoFiveGradeClassification();
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.AutoFiveGradeClassification", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.AutoFiveGradeClassification", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.AutoFiveGradeClassification", "success", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.AutoFiveGradeClassification", "error", "ʧ°Ü", curUserId);
e.printStackTrace();
}
}

View File

@ -24,6 +24,8 @@ public class AutoRefresh implements Job{
CollectAuditInfoCache ca = new CollectAuditInfoCache();
JBOTransaction tx = null;
String plan_date = DateAssistant.getToday();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx = JBOFactory.createJBOTransaction();
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('δÊÕ¿î', '²¿·ÖÊÕ¿î') and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
@ -39,10 +41,10 @@ public class AutoRefresh implements Job{
ca.setInputorgid("system");
ca.queryBatchCollectStatus(tx);
}
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoRefresh", "success", "成功");
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoRefresh", "success", "³É¹¦",curUserId);
} catch (Exception e) {
e.printStackTrace();
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoRefresh", "error", "失败");
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoRefresh", "error", "ʧ°Ü",curUserId);
}finally{
try {
tx.commit();

View File

@ -23,6 +23,10 @@ public class Commission implements Job{
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);
@ -32,9 +36,9 @@ public class Commission implements Job{
SqlObject asql = new SqlObject(sql);
Sqlca.executeSQL(asql);
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "ʧ°Ü", curUserId);
logger.error(e.getMessage());
e.printStackTrace();
}finally{

View File

@ -30,11 +30,15 @@ public class CreateSendMessageListAction 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 {
this.getDebitTipsList();
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateSendMessageListAction", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateSendMessageListAction", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateSendMessageListAction", "error", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateSendMessageListAction", "error", "ʧ°Ü", curUserId);
e.printStackTrace();
}

View File

@ -13,6 +13,10 @@ public class CreateVoucherMonthSettlementMission 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{
CreateVoucherMonthSettlement vouchermanage=new CreateVoucherMonthSettlement();
vouchermanage.CreateVoucher("PZ2018071200000017");//月结手续费(按月分摊)--回租
@ -26,9 +30,9 @@ public class CreateVoucherMonthSettlementMission implements Job {
vouchermanage.CreateVoucher("PZ2018072100000055");//日结税金--回租
vouchermanage.CreateVoucher("PZ2018080200000063");//日结税金--直租
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateVoucherMonthSettlementMission", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateVoucherMonthSettlementMission", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateVoucherMonthSettlementMission", "error", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateVoucherMonthSettlementMission", "error", "ʧ°Ü", curUserId);
}
}
}

View File

@ -16,6 +16,10 @@ public class CreateVoucherRentIncomeMission 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{
InsertVoucherRentIncome ivri=new InsertVoucherRentIncome();
@ -29,9 +33,9 @@ public class CreateVoucherRentIncomeMission implements Job {
cvis.CreateVoucher("PZ2018080200000064");//保险理赔 -记录理赔保险费--直租
//cvis.CreateVoucher("PZ2018080600000114");//理赔保险费冲抵逾期利息及逾期租金--直租
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "error", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "error", "ʧ°Ü", curUserId);
}
}

View File

@ -47,7 +47,11 @@ public class Daypenalty implements Job{
JBOTransaction tx=null;
Conn conn=null;
String startime =StringFunction.getTodayNow();;
String startime =StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx= JBOFactory.createJBOTransaction();
conn= new Conn(tx);
@ -56,9 +60,9 @@ public class Daypenalty implements Job{
conn.executeUpdate(sql);
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Daypenalty", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Daypenalty", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Daypenalty", "success", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Daypenalty", "success", "ʧ°Ü", curUserId);
logger.error(e.getMessage());
e.printStackTrace();
}finally{

View File

@ -32,6 +32,10 @@ public class QueryCommercialVehicleModeListAction implements Job{
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx = null;
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx = JBOFactory.createJBOTransaction();
BizObjectManager bm1 = JBOFactory.getBizObjectManager(LB_CARDATA_COMMERCIAL_BRAND.CLASS_NAME, tx);
@ -184,9 +188,9 @@ public class QueryCommercialVehicleModeListAction implements Job{
.setParameter("MODELVERSIONTIME",StringUtil.nullToString(versionListObject.get("model_version_time"),""))
.setParameter("INITIALVERSION",StringUtil.nullToString(versionListObject.get("from_version"),"")).executeUpdate();
}
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryCommercialVehicleModeListAction", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryCommercialVehicleModeListAction", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryCommercialVehicleModeListAction", "error", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryCommercialVehicleModeListAction", "error", "ʧ°Ü", curUserId);
try {
if(null != tx){

View File

@ -33,6 +33,10 @@ public class QueryPassengerVehicleModeListAction implements Job{
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx = null;
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try {
tx = JBOFactory.createJBOTransaction();
BizObjectManager bm1 = JBOFactory.getBizObjectManager(LB_CARDATA_BRAND.CLASS_NAME, tx);
@ -217,9 +221,9 @@ public class QueryPassengerVehicleModeListAction implements Job{
.setParameter("INITIALVERSION",StringUtil.nullToString(map.get("InitialVersion"),"")).executeUpdate();
}
System.out.println("³ËÓóµ³µÐÍ¿â¸üÐÂÍê±Ï!");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryPassengerVehicleModeListAction", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryPassengerVehicleModeListAction", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryPassengerVehicleModeListAction", "error", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.QueryPassengerVehicleModeListAction", "error", "ʧ°Ü", curUserId);
try {
if(null != tx){
tx.rollback();

View File

@ -45,14 +45,18 @@ public class SplitInts2 implements Job{
Transaction Sqlca =null;
String startime = StringFunction.getTodayNow();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
try{
Sqlca = Transaction.createTransaction("als");
Sqlca.executeSQL(new SqlObject("{call proc_financial_interest()}"));
Sqlca.commit();
discountApportion();
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.SplitInts", "success", "成功");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.SplitInts", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.SplitInts", "success", "失败");
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.SplitInts", "error", "ʧ°Ü", curUserId);
logger.error(e.getMessage());
e.printStackTrace();
}finally{

View File

@ -37,13 +37,17 @@ public class ContractInfoForNomalEndSign 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();
ownershipTransferSign(tx,arg0);
tx.commit();
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalEndSign", "success", "成功");
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalEndSign", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalEndSign", "success", "失败");
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalEndSign", "success", "ʧ°Ü", curUserId);
e.printStackTrace();
}
}

View File

@ -38,13 +38,17 @@ public class ContractInfoForNomalSettle 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();
ownershipTransferSign(tx,arg0);
tx.commit();
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalSettle", "success", "成功");
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalSettle", "success", "³É¹¦", curUserId);
} catch (Exception e) {
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalSettle", "success", "失败");
QuartzUtil.insertLog(startime, "quartz.ContractInfoForNomalSettle", "error", "ʧ°Ü", curUserId);
e.printStackTrace();
}
}