Package com.sogou.qadev.service.cynthia.bean

Examples of com.sogou.qadev.service.cynthia.bean.JSTree


   * @return
   */
  public List<JSTree> getRootNode(int id)
  {
    PreparedStatement pstm = null;
    JSTree rootNode = new JSTree();
    List<JSTree> result = new ArrayList<JSTree>();
    Connection conn = null;
    ResultSet rs = null;
    try{
      conn = DbPoolConnection.getInstance().getReadConnection();
      String sql = "select * from tree where parent_id="+id+"";
      pstm = conn.prepareStatement(sql);
      rs = pstm.executeQuery();
      if(rs.next()){
        rootNode.setId(rs.getInt("id"));
        rootNode.setParentId(rs.getInt("parent_id"));
        rootNode.setPosition(rs.getInt("position"));
        rootNode.setUserName(rs.getString("user_name"));
        rootNode.setTitle(rs.getString("title"));
        result.add(rootNode);
      }
    }catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here


      conn = DbPoolConnection.getInstance().getReadConnection();
      String sql = "select * from tree where parent_id="+id+" and user_name='"+userName+"' order by title";
      pstm = conn.prepareStatement(sql);
      rs = pstm.executeQuery();
      while(rs.next()){
        JSTree jsTree = new JSTree();
        jsTree.setId(rs.getInt("id"));
        jsTree.setParentId(rs.getInt("parent_id"));
        jsTree.setPosition(rs.getInt("position"));
        jsTree.setUserName(rs.getString("user_name"));
        jsTree.setTitle(rs.getString("title"));
        jsTree.setFilters(rs.getString("filters"));
        result.add(jsTree);
      }
    }catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

        String deleteChildrenSql = "delete from tree where id in "+ids;
        pstm = conn.prepareStatement(deleteChildrenSql);
        pstm.execute();
      }
     
      JSTree node = this.getNodeById(id);

      //删除关注节点
      String filterIdsStr = node.getFilters();
      if (filterIdsStr != null) {
        String[] filterArray = filterIdsStr.split(",");
        if(filterArray != null && filterArray.length >0){
          for (String filterIdStr : filterArray) {
            DataAccessSession das = DataAccessFactory.getInstance().getSysDas();
            das.removeUserFocusFilter(DataAccessFactory.getInstance().createUUID(filterIdStr))
          }
        }
      }
     
      //删除定时器
      String deleteTimerSql = "delete from timer where filter_id in (" + filterIdsStr + ")" ;
      pstm = conn.prepareStatement(deleteTimerSql);
      pstm.execute();
     
      //更新同事节点的位置信息
      String updatePositionSql = "update tree set position=(position-1) where parent_id=? and position >?";
      pstm = conn.prepareStatement(updatePositionSql);
      pstm.setInt(1, node.getParentId());
      pstm.setInt(2, node.getPosition());
      pstm.execute();
     
    } catch (Exception e) {
      e.printStackTrace();
    }finally{
View Full Code Here

   */
  public boolean removeFilterId(int filterId,int parentId)
  {
    Connection conn = null;
    PreparedStatement pstm = null;
    JSTree parentNode = this.getNodeById(parentId);
    try{
      conn = DbPoolConnection.getInstance().getConnection();
      String oldFiltersStr = parentNode.getFilters();
      if(oldFiltersStr!=null&&!"".equals(oldFiltersStr))
      {
        String[] oldFiltersOld = oldFiltersStr.split(",");
        List<String> oldFiltersList= new ArrayList<String>();
        for(String str : oldFiltersOld)
View Full Code Here

   */
  public boolean addFilterToFolder(String filterId,int nodeId)
  {
    Connection conn = null;
    PreparedStatement pstm = null;
    JSTree node = this.getNodeById(nodeId);
    try
    {
      conn = DbPoolConnection.getInstance().getConnection();
      String oldFilters = node.getFilters();
      String newFilters = null;
      if(oldFilters==null||"".equals(oldFilters))
      {
        newFilters = filterId;
      }else
View Full Code Here

   */
  public boolean moveFilter(int filterId,int refId,int parentId)
  {
    Connection conn = null;
    PreparedStatement pstm = null;
    JSTree refNode = this.getNodeById(refId);
    JSTree parentNode = this.getNodeById(parentId);
    try{
      if(refId == parentId)
        return true;
      conn = DbPoolConnection.getInstance().getConnection();

      String oldFiltersStr = parentNode.getFilters();
      String newFiltersStr = refNode.getFilters();
      //先加入新的文件夹
      if(newFiltersStr!=null&&!"".equals(newFiltersStr))
      {
        if(newFiltersStr.contains(Integer.toString(filterId)))
View Full Code Here

  public boolean moveNode(int id,int refId,int position,String title,boolean copy,String userName){

    Connection conn = null;
    PreparedStatement pstm = null;

    JSTree node = this.getNodeById(id);
    JSTree refNode = this.getNodeById(refId);
   
    try{
      conn = DbPoolConnection.getInstance().getConnection();
      if(!copy)
      {
View Full Code Here

   * @param id
   * @return
   */
  public JSTree getNodeById(int id)
  {
    JSTree jsTree = new JSTree();
    PreparedStatement pstm = null;
    Connection conn = null;
    ResultSet rs = null;
    try{
      conn = DbPoolConnection.getInstance().getReadConnection();
      pstm = conn.prepareStatement("SELECT * FROM tree WHERE id =?");
      pstm.setInt(1, id);
      rs = pstm.executeQuery();
      if(rs.next()){
        jsTree.setId(rs.getInt("id"));
        jsTree.setParentId(rs.getInt("parent_id"));
        jsTree.setPosition(rs.getInt("position"));
        jsTree.setUserName(rs.getString("user_name"));
        jsTree.setTitle(rs.getString("title"));
        jsTree.setFilters(rs.getString("filters"));
      }
    }catch(Exception e)
    {
      e.printStackTrace();
    }finally
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.bean.JSTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.