/** * This method is used to format any date string. * Database can use different default date formats. * * @param date the Date to format * @return The proper date formatted String. * @deprecated use to_date function. */ public String getDateString(Date date, String format) { return to_date(date, format); }
/** * This method is used to format any date string. * * @param date the Date to format * @return The date formatted String for Oracle. * @deprecated use to_date function. */ public String getDateString(String date) { return to_date(date); }
/** * This method is used to format any date string. * Database can use different default date formats. * * @param date the Date to format * @return The proper date formatted String. * @deprecated use to_date function. */ public String getDateString(Date date) { return to_date(date); }
/** * This method is used to format any date string. * * @param date the Date to format * @return The date formatted String for Oracle. * @deprecated use to_date function. */ public String getDateString(String date, String format) { return to_date(date, format); }
/** * */ protected ListInfo getDataList(String sortKey, boolean arg1) { ListInfo listInfo = null; String chnlid = request.getParameter("channelid"); String sqlstr = "select a.document_id,a.start_time,a.end_time,a.order_no,a.op_user,a.op_time,b.subtitle,case when " + DBUtil.getDBAdapter().to_date(new Date()) + ">to_date(end_time,'yyyy-mm-dd hh24-mi-ss') then 1 else 0 end as overtime " + " from Td_Cms_Doc_Arrange a inner join td_cms_document b " + " on a.document_id=b.document_id and b.status!=7 and b.channel_id = " + chnlid + " order by overtime,a.order_no desc"; try { listInfo = getDocArrangeList(sqlstr); }catch(Exception e) { e.printStackTrace(); } return listInfo; }
public void citeDoc(int docid, int channelid, int userid, int type, int siteid) throws DocumentManagerException { DBUtil db = new DBUtil(); String sql; try { sql = "insert into td_cms_chnl_ref_doc(chnl_id,doc_id,op_user_id,op_time,citetype,site_id) values(" + channelid + "," + docid + "," + userid + "," + DBUtil.getDBAdapter().to_date(new Date()) + "," + type + "," + siteid + ")"; db.executeInsert(sql); } catch (SQLException se) { se.printStackTrace(); throw new DocumentManagerException("引用文档时数据库操作失败" + se.getMessage()); } }
/** * 更新文档发布时间 * * @param docid * @throws DocumentManagerException */ public void updateDocPublishTime(int docid) throws DocumentManagerException { DBUtil dbUtil = new DBUtil(); String sqlUpdate = "update td_cms_document set publishtime = " + DBUtil.getDBAdapter().to_date(new Date()) + " where document_id=" + docid; try { dbUtil.executeUpdate(sqlUpdate); } catch (Exception e) { e.printStackTrace(); throw new DocumentManagerException(e.getMessage()); } }
public void pigeonholeDoc(int docid, int userId) throws DocumentManagerException { DBUtil db = new DBUtil(); String sqlUpdate = "update td_cms_document set status = 7, guidangtime = " + DBUtil.getDBAdapter().to_date(new Date()) + ",guidangman=" + userId + " where document_id=" + docid; try { db.executeUpdate(sqlUpdate); if (ArrangeDocExist(String.valueOf(docid))) { String sqlDel = "delete Td_Cms_Doc_Arrange where document_id=" + docid + ""; db.executeDelete(sqlDel); } } catch (SQLException e) { e.printStackTrace(); throw new DocumentManagerException("归档时出现异常" + e.getMessage()); } }
public int addOneTask(int docid, int preTaskId, int preStatus, int submitId, int[] executerIds) throws DocumentManagerException { DBUtil db = new DBUtil(); String sql = ""; long taskId = -1; try { taskId = db.getNextPrimaryKey("td_cms_doc_task"); if (preTaskId != 0) sql = "insert into td_cms_doc_task(TASK_ID,pre_task_id,document_id,pre_status,submit_id,submit_time) " + "values(" + taskId + "," + preTaskId + "," + docid + "," + preStatus + "," + submitId + "," + DBUtil.getDBAdapter().to_date(new Date()) + ")"; else sql = "insert into td_cms_doc_task(TASK_ID,document_id,pre_status,submit_id,submit_time) " + "values(" + taskId + "," + docid + "," + preStatus + "," + submitId + "," + DBUtil.getDBAdapter().to_date(new Date()) + ")"; db.executeInsert(sql); // 往任务表中增加一条任务 // 在任务明细表中为每一个执行人添加一条任务 for (int i = 0; i < executerIds.length; i++) { sql = "insert into td_cms_doc_task_detail(task_id,performer)" + "values(" + taskId + "," + executerIds[i] + ")"; db.executeInsert(sql); } } catch (Exception se) { se.printStackTrace(); throw new DocumentManagerException("新增任务失败" + se.getMessage()); } return (int) taskId; }
public void completeOneTask(int taskId, int desStatus, int performer, String opinion) throws DocumentManagerException { DBUtil db1 = new DBUtil(); if (opinion == null) opinion = ""; try { String sql = ""; // 将当前执行人performer的待审任务更新,填写任务完成时间和审核意见等 sql = "update td_cms_doc_task_detail set complete_time =" + DBUtil.getDBAdapter().to_date(new Date()) + ",after_status = " + desStatus + ",opinion='" + opinion + "' where valid = 1 " + "and task_id =" + taskId + " and performer =" + performer; db1.executeUpdate(sql); // 将非当前执行人performer的待审任务置为无效 sql = "update td_cms_doc_task_detail set valid = 0 where valid = 1" + " and task_id =" + taskId + " and performer !=" + performer; db1.executeUpdate(sql); } catch (Exception se) { se.printStackTrace(); throw new DocumentManagerException("完成任务更新失败" + se.getMessage()); } }
.append(userjoborg.getSameJobUserSn()).append("', '") .append(userjoborg.getJobSn()).append("', ") .append(DBUtil.getDBAdapter().to_date(new Date())) .append(", '").append(userjoborg.getFettle()).append("')"); dbUtil.executeInsert(sql.toString());
public void storeOldStatus(ContentContext context, DocumentStatus oldStatus) throws DocumentManagerException { DBUtil db = new DBUtil(); String docid = context.getContentid(); String status = oldStatus.getStatus(); String publisherStr = context.getPublisher()[1]; String publisher = publisherStr.substring(publisherStr.indexOf("[") + 1, publisherStr.indexOf("]")); try { String sql = "select * from td_cms_doc_publishing where document_id = " + docid; db.executeSelect(sql); if (db.size() == 0) { String sql1 = "insert into td_cms_doc_publishing(document_id,old_status,publisher,pub_start_time) values(" + docid + "," + status + ",'" + publisher + "'," + DBUtil.getDBAdapter().to_date(new Date()) + ")"; db.executeInsert(sql1); } } catch (SQLException e) { e.printStackTrace(); throw new DocumentManagerException("保存文档发布之前的状态时出错!" + e.getMessage()); } }
+ userid + "," + DBUtil.getDBAdapter().to_date(new Date()) + ",2," + preTaskid + ")"; else sqlInsert = "insert into td_cms_doc_task(task_id,document_id,submit_id,submit_time,pre_status) " + "values(" + docTaskId + "," + docid + "," + userid + "," + DBUtil.getDBAdapter().to_date(new Date()) + ",2)"; + DBUtil.getDBAdapter().to_date(new Date()) + ",after_status = 2 where valid = 1 " + "and task_id =" + preTaskid + " and performer =" + userid; db.executeUpdate(sqlUpdate);
private void saveUser(String userId, String jobId, String orgId, int samesn) { try { String jobsnsql = "select c.job_sn from td_sm_orgjob c where c.org_id ='" + orgId + "' and c.job_id='" + jobId + "'"; DBUtil temp = new DBUtil(); temp.executeSelect(jobsnsql); String jobsn = "1"; if (temp.size() > 0) jobsn = temp.getInt(0, 0) + ""; DBUtil db = new DBUtil(); String sql = "insert into td_sm_userjoborg" + " (user_id,job_id,org_id,JOB_SN,SAME_JOB_USER_SN,JOB_STARTTIME,JOB_FETTLE)" + " values(" + userId + ",'" + jobId + "','" + orgId + "'," + jobsn + "," + samesn + "," + DBUtil.getDBAdapter().to_date(new Date()) + ",1)"; db.executeInsert(sql); } catch (Exception e) { e.printStackTrace(); } }
+ jobSn + "," + DBUtil.getDBAdapter().to_date(new Date()) + ",1)"; try { db.executeInsert(sql);
sql = "update td_cms_document set status = 3, audittime = " + DBUtil.getDBAdapter().to_date(new Date()) + " where document_id =" + docid; db.executeUpdate(sql); sql = "update td_cms_doc_task_detail set complete_time =" + DBUtil.getDBAdapter().to_date(new Date()) + ",after_status = 3,opinion='" + comment + "' where valid = 1 " + "and task_id =" + taskid + " and performer =" + auditorid; db.executeUpdate(sql); } else if (flag == 0) { sql = "update td_cms_document set status = 4, audittime = " + DBUtil.getDBAdapter().to_date(new Date()) + " where document_id =" + docid; db.executeUpdate(sql); sql = "update td_cms_doc_task_detail set complete_time =" + DBUtil.getDBAdapter().to_date(new Date()) + ",after_status = 4,opinion='" + comment + "' where valid = 1 " + "and task_id =" + taskid + " and performer =" + auditorid; + auditorid + "," + DBUtil.getDBAdapter().to_date(new Date()) + ")"; db.executeInsert(sql);
+ js + "'," + DBUtil.getDBAdapter().to_date(new Date()) + ",1)";
+ (i + 1) + "',JOB_SN='" + (Integer.parseInt(jobSn) + 1) + "',JOB_STARTTIME=" + DBUtil.getDBAdapter().to_date(new Date()) + ",JOB_FETTLE=1 where USER_ID=" + userId[i] + "and JOB_ID='" + jobId + "' and ORG_ID='" + orgId
+ DBUtil.getDBDate(starttime) + "," + "" + DBUtil.getDBAdapter().to_date(new Date()) + ",0)";