Пример #1
0
  /**
   * 设置进入查看详细信息页面的初始值 setEditDefault
   *
   * @param aWebForm EditForm
   * @param request HttpServletRequest
   * @param response HttpServletResponse
   */
  public static void setEditDefault(
      EditForm pWebForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    try {
      // 初始化页面,初始化投诉形式下拉菜单
      int type = 0;
      Connection mConn = null;
      PreparedStatement pstmt = null;

      try {
        mConn = CDBManager.getConn(); // 创建数据库连接
        // 设置进入修改页面的初始值SQL
        String mSQL =
            "select A.CHENGPIID,A.COMPLAINEDPERSON,A.COMPLAINPERSON, A.COMPLAINEDUNIT, A.COMPLAINUNIT, A.COMPLAINEDDUTY, A.COMPLAINDUTY, A.QUESTIONKIND, A.COMPLAINVERSION, "
                + "  A.CONTENTABSTRACT,   A.SUGGESTION,   A.SIGN1,  to_char(A.DATE1, 'yyyy-mm-dd') DATE1,A.LEADERCONFIRM, A.SIGN2,   to_char(A.DATE2, 'yyyy-mm-dd') DATE2, A.REMARK,   A.BUSINESSID, "
                + " decode(A.BUSINESSTYPE,'1','建设工程','2','行政许可','3','政府采购','4','重大事项','5','行政执法','6','财政预算','7','信访','8','应急预案') BUSINESSTYPE,"
                + "   t.abbrname,A.COMPLAINEDGRADE,A.XZGCXYFL,A.SUBXZGCXYFL,A.XZGLFL,A.XZGCBXXS from T_YW_ZDSX_JCJ_TSCHENGPIBIAO A,t_Sys_Department t where  A.COMPLAINEDUNIT = t.id  and A.CHENGPIID = ?";
        pstmt = mConn.prepareStatement(mSQL);
        pstmt.setString(1, pWebForm.getCHENGPIID()); // 主键
        ResultSet rs = pstmt.executeQuery();
        if (rs.next()) {
          pWebForm.getTTsChengpibiao().setCHENGPIID(rs.getString(1)); // 呈批表编号
          pWebForm.getTTsChengpibiao().setCOMPLAINEDPERSON(rs.getString(2)); // 呈批表被投诉人姓名
          pWebForm.getTTsChengpibiao().setCOMPLAINPERSON(rs.getString(3)); // 呈批表投诉人姓名
          pWebForm.getTTsChengpibiao().setCOMPLAINEDUNIT(rs.getString(4)); // 呈批表被投诉人单位
          pWebForm.getTTsChengpibiao().setCOMPLAINUNIT(rs.getString(5)); // 呈批表投诉人单位
          pWebForm.getTTsChengpibiao().setCOMPLAINEDDUTY(rs.getString(6)); // 呈批表被投诉人职务
          pWebForm.getTTsChengpibiao().setCOMPLAINDUTY(rs.getString(7)); // 呈批表投诉人职务
          pWebForm.getTTsChengpibiao().setQUESTIONKIND(rs.getString(8)); // 呈批表问题性质
          pWebForm.getTTsChengpibiao().setCOMPLAINVERSION(rs.getInt(9)); // 呈批表投诉形式
          type = rs.getInt(9);
          pWebForm.getTTsChengpibiao().setCONTENTABSTRACT(rs.getString(10)); // 呈批表内容摘要
          pWebForm.getTTsChengpibiao().setSUGGESTION(rs.getString(11)); // 呈批表拟办意见
          pWebForm.getTTsChengpibiao().setSIGN1(rs.getString(12)); // 呈批表拟办人签字
          pWebForm.getTTsChengpibiao().setDATE1_STR(rs.getString(13)); // 呈批表拟办人签字日期
          pWebForm.getTTsChengpibiao().setLEADERCONFIRM(rs.getString(14)); // 呈批表局领导批示
          pWebForm.getTTsChengpibiao().setSIGN2(rs.getString(15)); // 呈批表局领导签字
          pWebForm.getTTsChengpibiao().setDATE2_STR(rs.getString(16)); // 呈批表局领导签字日期
          pWebForm.getTTsChengpibiao().setREMARK(rs.getString(17)); // 呈批表备注
          pWebForm.getTTsChengpibiao().setBUSINESSID(rs.getString(18));
          pWebForm.setTypename(rs.getString(19));
          pWebForm.setDepartmentname(rs.getString(20));
          pWebForm.getTTsChengpibiao().setCOMPLAINEDGRADE(rs.getInt(21));
          pWebForm.getTTsChengpibiao().setXZGCXYFL(rs.getInt(22));
          pWebForm.getTTsChengpibiao().setSUBXZGCXYFL(rs.getInt(23));
          pWebForm.getTTsChengpibiao().setXZGLFL(rs.getInt(24));
          pWebForm.getTTsChengpibiao().setXZGCBXXS(rs.getInt(25));

        } else {
          throw new CDealException(
              "使用编号 " + pWebForm.getCHENGPIID() + "未能找到数据。", new Exception("查询数据失败。"));
        }
        TreeMap COMPLAINVERSIONList = new TreeMap();
        CCodeMap aCodeMap = new CCodeMap();
        COMPLAINVERSIONList = aCodeMap.getMapByType("行政效能投诉形式");
        String busitypename = (String) COMPLAINVERSIONList.get("" + type);
        pWebForm.setTsxingshu(busitypename);
        // 处理附件
        UploadForm aUploadForm = new UploadForm();
        aUploadForm.setType("行政效能");
        aUploadForm.setBid2("办理呈批表");
        aUploadForm.setBid(Long.parseLong(pWebForm.getTTsChengpibiao().getCHENGPIID()));
        com.tjsoft.system.upload.CDeal.setUploadDefault(aUploadForm, request, response);
        pWebForm.setUploadedFile(aUploadForm.getUploadedFile());
      } catch (Exception e) {
        throw e;
      } finally {
        if (pstmt != null)
          try {
            pstmt.close();
          } catch (Exception e) {
          }
        ;
        if (mConn != null)
          try {
            mConn.close();
          } catch (Exception e) {
          }
        ;
      }
    } catch (Exception e) {
      throw new CDealException("进入修改" + mModuleName + "时失败。", e);
    }
  }
Пример #2
0
  /**
   * Process an HTML get or post.
   *
   * @exception ServletException From inherited class.
   * @exception IOException From inherited class.
   */
  public void scanOutXML(
      PrintWriter out,
      String strDirectory,
      String strFilename,
      String[] strPlus,
      String[] strMinus,
      boolean bExcludeParams,
      boolean bAnalyzeParams)
      throws IOException {
    File dir = new File(strDirectory + '/' + strFilename);
    if (dir.isDirectory()) return;

    try {
      FileReader is = new FileReader(strDirectory + '/' + strFilename);
      BufferedReader r = new BufferedReader(is);
      String string = null;
      Hashtable ht = new Hashtable();
      Set setstrExtensions = new HashSet();
      int iCount = 0;
      int iBytes = 0;
      while ((string = r.readLine()) != null) {
        StringTokenizer st = new StringTokenizer(string, " \"", false);
        Data data = new Data();
        int iTokenCount = 0;
        while (st.hasMoreTokens()) {
          iTokenCount++;
          string = st.nextToken();
          if (iTokenCount == IP) data.m_IP = string;
          if (iTokenCount == URL) {
            if (bExcludeParams)
              if (string.indexOf('?') != -1) string = string.substring(0, string.indexOf('?'));
            if (bAnalyzeParams)
              if (string.indexOf('?') != -1) string = string.substring(string.indexOf('?') + 1);
            data.m_URL = string;
          }
          if (iTokenCount == PROTOCOL)
            if (!string.startsWith("HTTP")) {
              data.m_URL += " " + string;
              iTokenCount--;
            }
          if (iTokenCount == BYTES) data.m_iBytes = Integer.parseInt(string);
        }
        if (!this.filterURL(data.m_URL, strPlus, strMinus, setstrExtensions)) continue;
        iCount++;
        iBytes += data.m_iBytes;
        if (ht.get(data.m_URL) == null) ht.put(data.m_URL, data);
        else {
          int iThisBytes = data.m_iBytes;
          data = (Data) ht.get(data.m_URL);
          data.m_iCount++;
          data.m_iBytes += iThisBytes;
        }
      }
      Comparator comparator = new Test();
      TreeMap tm = new TreeMap(comparator);
      Iterator iterator = ht.values().iterator();
      while (iterator.hasNext()) {
        Data data = (Data) iterator.next();
        tm.put(new Integer(data.m_iCount), data);
      }
      out.println("<file>");
      this.printXML(out, "directory", strDirectory);
      this.printXML(out, "name", strFilename);
      iterator = tm.values().iterator();
      while (iterator.hasNext()) {
        out.println("<data>");
        Data data = (Data) iterator.next();
        this.printXML(out, "url", data.m_URL);
        this.printXML(out, "count", Integer.toString(data.m_iCount));
        out.println("</data>");
      }
      this.printXML(out, "hits", Integer.toString(iCount));
      this.printXML(out, "bytes", Integer.toString(iBytes));
      this.printXML(out, "unique", Integer.toString(tm.size()));

      iterator = setstrExtensions.iterator();
      out.println("<extensions>");
      while (iterator.hasNext()) {
        this.printXML(out, "extension", (String) iterator.next());
      }
      out.println("</extensions>");

      out.println("</file>");
    } catch (FileNotFoundException ex) {
      ex.printStackTrace();
    } catch (IOException ex) {
      ex.printStackTrace();
    }
  }