if (theService.getIsLog() == null
|| theService.getIsLog().intValue() == DOService.LOG_NO) {
return;
}
BOInstance bi = theService.getBo().getInstance(uid);
if (bi == null) {
return;
}
SessionContext.getInstance().getThreadContext().put("old_instance",
oldInstance);
if (theService.getFilterClass() != null
&& !"".equals(theService.getFilterClass().trim())) {
DOAction ca = ActionFactory.getAction(theService.getFilterClass());
ca.setService(theService);
if (bi != null) {
ca.setInstance(bi);
}
try {
ca.excute();
} catch (ExedoException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return;
}
String optionType = null;
if (theService.getLogType() != null
&& !"".equals(theService.getLogType().trim())) {
optionType = theService.getLogType();
}
switch (theService.getType().intValue()) {
case DOService.TYPE_DELETE:
optionType = "删除";
break;
case DOService.TYPE_INSERT:
optionType = "新增";
break;
case DOService.TYPE_UPDATE_AUTO_PARA:
case DOService.TYPE_UPDATE:
optionType = "修改";
break;
}
// insert into
// do_log_data(objuid,table_name,col_name,who_uid,bo_uid,col_uid,oper_type,oper_data,
// oper_time,oper_data_uid,oper_pane_uid,old_value,new_value)
// values(?,?,?,?,?,?,?,?,?,?,?,?,?)
DOService aLogService = DOService.getService("do_log_data_insert");
BOInstance aLog = new BOInstance();
aLog.putValue("TABLE_NAME", theService.getBo().getL10n());
aLog.putValue("OPER_TYPE", optionType);
aLog.putValue("OPER_DATA", bi.getName());
aLog.putValue("oper_data_uid", bi.getUid());
if (oldInstance != null) {
aLog.putValue("old_value", oldInstance.getName() + "-------详细信息:"
+ oldInstance.toString());
}
try {
aLogService.invokeUpdate(aLog);