create_archive_process.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:2k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ page import="java.util.GregorianCalendar" %>
  2. <%@ page import="java.util.Calendar" %>
  3. <%@ page import="com.vnex.intranet.pub.BaseJdbcDAO" %>
  4. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  5. <jsp:useBean id="ab" scope="request" class="com.vnex.intranet.archives.value.ArchiveValueBean" />
  6. <jsp:useBean id="archiveProxy" scope="application" class="com.vnex.intranet.archives.proxy.ArchiveProxyBean" />
  7. <jsp:setProperty name="ab" property="*" />
  8. <%
  9.     if(request.getParameter("createDate") != null && !request.getParameter("createDate").equals(""))
  10.     {
  11.        String createDate = request.getParameter("createDate")+" 00:00:00";
  12.        ab.setCreateDate(TimeStamp.convertTimestampToCalendar(TimeStamp.toTimestamp(createDate)));
  13.     }   
  14.     Calendar cal = TimeStamp.convertTimestampToCalendar(BaseJdbcDAO.getDBSystemDate());
  15.     int y = cal.get(Calendar.YEAR);
  16.     int m = cal.get(Calendar.MONTH)+1;
  17.     int d = cal.get(Calendar.DAY_OF_MONTH);
  18.     String year = ""+y;
  19.     String month = m>10? ""+m:"0"+m;
  20.     String day = d>10? ""+d:"0"+d;
  21.     int sequence = archiveProxy.getMaxSequence();
  22.     if(sequence <= 0)
  23.        sequence = 1;
  24.     else
  25.        ++sequence;    
  26.     String surffix = "";
  27.     if(sequence < 10)
  28.        surffix = "00"+sequence;
  29.     else if(sequence >=10 && sequence <100)
  30.        surffix = "0"+sequence;
  31.     else
  32.        surffix = ""+sequence;   
  33.     ab.setSequence(sequence);
  34.     String displayId = "TD-"+year+month+day+"-"+surffix;
  35.     ab.setArchiveDisplayId(displayId);
  36.     int archiveId = archiveProxy.createArchive(ab);
  37. %>
  38. <html>
  39. <head>
  40. <script language=javascript>
  41. function forward()
  42. {
  43. document.location = "/mainctrl/archive/archiveDetail?archiveId=<%=archiveId%>";
  44. }
  45. </script>
  46. </head>
  47. <body onload="javascript:forward()">
  48. </body>
  49. <html>