⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbprofilemanager.java

📁 一套完整的工商12315的源程序jsp部分在12315里,后台JAVA部分在gs12315src里,没有打包数据库.
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    }
  }
  public boolean isSupervisor(String unitid, int userid,int level){
    boolean is = false;
    User[] users = getAllUserInUnitFormLevel(unitid,level);
    for(int i = 0;i < users.length;i++){
      int usrID = users[i].getID();
      if(userid == usrID)
        return true;
    }
    return is;
  }
  public boolean isSupervisor(String unitid, int userid){
    return isSupervisor(unitid,userid,4);
  }

  public User[] getAllUserInUnitFormLevel(String unitid, int level) {
    User[] users = null;
    HashMap table = new HashMap();
    try {
      Unit unit = this.getUnit(unitid);
      ArrayList unitList = unit.getAllInsideSubUnits(unit);
      for (int i = 0; i < unitList.size(); i++) {
        unit = (Unit) unitList.get(i);
        int[] groupIDs = unit.getAssociateGroups();
        for (int j = 0; j < groupIDs.length; j++) {
          Group group = this.getGroup(groupIDs[j]);
          if (group.getPriority() == level) {
            Iterator iter = group.members();
            for (int k = 0; k < group.getMemberCount(); k++) {
              User user = (User) iter.next();
              table.put(user.getID() + "", user);
            }
          }
        }
      }
    }
    catch (Exception e) {}
    users = new User[table.size()];
    Iterator iterator = table.keySet().iterator();
    int m = 0;
    while (iterator.hasNext()) {
      String s_ID = (String) iterator.next();
      users[m] = (User) table.get(s_ID);
      m++;
    }
    return users;
  }

  public User[] getUserInUnitFormLevel(String unitid, int level) {
    User[] users = null;
    HashMap table = new HashMap();
    try {
      Unit unit = this.getUnit(unitid);
      int[] groupIDs = unit.getAssociateGroups();
      for (int j = 0; j < groupIDs.length; j++) {
        Group group = this.getGroup(groupIDs[j]);
        if (group.getPriority() == level) {
          Iterator iter = group.members();
          for (int k = 0; k < group.getMemberCount(); k++) {
            User user = (User) iter.next();
            table.put(user.getID() + "", user);
          }
        }
      }
    }
    catch (Exception e) {}
    users = new User[table.size()];
    Iterator iterator = table.keySet().iterator();
    int m = 0;
    while (iterator.hasNext()) {
      String s_ID = (String) iterator.next();
      users[m] = (User) table.get(s_ID);
      m++;
    }
    return users;
  }
  /**
   * 处理登记内容表
   */
  private final static String GET_userDJ_ByTypeAndStatus =
      "select djbh from u_djnrb where tslx=? and lrrID=? and final_clbz='0'";

  private final static String GET_DJS_ByCLR =//得到处理人的案件
      "select djbh from u_djnrb where clr=? and final_clbz='0' and (gxdw=? or cldw=?) and tslx=?";

  private final static String GET_UnDoDJs =
      "SELECT djbh FROM u_djnrb where (gxdw=? or cldw=?) and final_clbz='0'";
  private final static String GET_UnDoDJsByType =
      "SELECT djbh FROM u_djnrb where (gxdw=? or cldw=?) and final_clbz='0' and tslx=?";

  private final static String GET_UnDoDJsByType2 =
      "SELECT djbh FROM u_djnrb where (gxdw=? and cldw=?) and final_clbz='0' and tslx=?";

  private final static String GET_DoingDJsByTypeForSupervisor =
      "SELECT djbh,zb_path FROM u_djnrb where  clbz='0' and final_clbz='0' and tslx=? ";
  private final static String GET_UnFinishedList =
      "SELECT djbh,lrr,tslx,tsrmc,btsdw,tsrq,clbz FROM u_djnrb where (djjg=? or cldw=?) and final_clbz='0' and tsrq<getdate() and tslx<>'0' order by tslx asc";

  public String[] getUnDoByCLR(String clr,String gxdw,String cldw,String type){
    String[] list = null;
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_DJS_ByCLR);
      pstmt.setString(1, clr);
      pstmt.setString(2, gxdw);
      pstmt.setString(3, cldw);
      pstmt.setString(4, type);
      ResultSet rs = pstmt.executeQuery();
      ArrayList djList = new ArrayList();
      while (rs.next()) {
        djList.add(rs.getString(1));
      }
      list = new String[djList.size()];
      for (int i = 0; i < djList.size(); i++) {
        list[i] = (String) djList.get(i);
      }
    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }
  public ArrayList getUnFinishedList(String djjg,String cldw){
    ArrayList list = new ArrayList();
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_UnFinishedList);
      pstmt.setString(1, djjg);
      pstmt.setString(2, cldw);
      ResultSet rs = pstmt.executeQuery();
      while (rs.next()) {
        U_djnrbImp obj = new U_djnrbImp();
        String djbh = rs.getString("djbh");
        String lrr = rs.getString("lrr");
        String tslx = rs.getString("tslx");
        String tsrmc = rs.getString("tsrmc");
        String btsdw = rs.getString("btsdw");
        String tsrq = rs.getString("tsrq");
        obj.setdjbh(djbh);
        obj.setlrr(lrr);
        obj.settslx(tslx);
        obj.settsrmc(tsrmc);
        obj.setbtsdw(btsdw);
        obj.settsrq(StringUtils.handleDate(tsrq,dateFormat));
        try{
          obj.setclbz(rs.getString("clbz"));
        }catch(Exception e){}
        list.add(obj);
      }

    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }


  public String[] getUnDoByType(String gxdw,String cldw,String type){
    String[] list = null;
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_UnDoDJsByType);
      pstmt.setString(1, gxdw);
      pstmt.setString(2, cldw);
      pstmt.setString(3, type);
      ResultSet rs = pstmt.executeQuery();
      ArrayList djList = new ArrayList();
      while (rs.next()) {
        djList.add(rs.getString(1));
      }
      list = new String[djList.size()];
      for (int i = 0; i < djList.size(); i++) {
        list[i] = (String) djList.get(i);
      }
    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }
  public String[] getUnDoByType2(String gxdw,String cldw,String type){
    String[] list = null;
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_UnDoDJsByType2);
      pstmt.setString(1, gxdw);
      pstmt.setString(2, cldw);
      pstmt.setString(3, type);
      ResultSet rs = pstmt.executeQuery();
      ArrayList djList = new ArrayList();
      while (rs.next()) {
        djList.add(rs.getString(1));
      }
      list = new String[djList.size()];
      for (int i = 0; i < djList.size(); i++) {
        list[i] = (String) djList.get(i);
      }
    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }

  //GET_DoingDJsByType
  public String[] getDoingByTypeForSupervisor(String type,String gxdw,String supervisorID){
    String[] list = null;
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_DoingDJsByTypeForSupervisor);
      pstmt.setString(1, type);
    //  pstmt.setString(2, supervisorID);
      ResultSet rs = pstmt.executeQuery();
      ArrayList djList = new ArrayList();
      while (rs.next()) {
        String s_djbh = rs.getString("djbh");
        String s_zb_path = rs.getString("zb_path");
        boolean bOk = false;
        if(s_zb_path!=null&&s_zb_path.length()>0){
          String[] paths = s_zb_path.split("-");
          if (paths.length > 0) {
            for (int i = 0; i < paths.length; i++) {
              if (paths[i].equals(gxdw)) {
                bOk = true;
                break;
              }
            }
          }
        }
        if(bOk)
          djList.add(s_djbh);
      }
      list = new String[djList.size()];
      for (int i = 0; i < djList.size(); i++) {
        list[i] = (String) djList.get(i);
      }
    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }


  public String[] getUnDoDjs(String gxdw,String cldw){
    String[] list = null;
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_UnDoDJs);
      pstmt.setString(1, gxdw);
      pstmt.setString(2, cldw);
      ResultSet rs = pstmt.executeQuery();
      ArrayList djList = new ArrayList();
      while (rs.next()) {
        djList.add(rs.getString(1));
      }
      list = new String[djList.size()];
      for (int i = 0; i < djList.size(); i++) {
        list[i] = (String) djList.get(i);
      }
    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }

 public String[] getUserDjByTypeAndStatus(String type,String userID){
    String[] list = null;
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(GET_userDJ_ByTypeAndStatus);
      pstmt.setString(1, type);
      pstmt.setString(2, userID);
      ResultSet rs = pstmt.executeQuery();
      ArrayList djList = new ArrayList();
      while (rs.next()) {
        djList.add(rs.getString(1));
      }
      list = new String[djList.size()];
      for (int i = 0; i < djList.size(); i++) {
        list[i] = (String) djList.get(i);
      }
    }
    catch (SQLException sqle) {
      sqle.printStackTrace();
    }
    finally {
      try {
        pstmt.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      try {
        con.close();
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

    return list;
  }





  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -