Beispiel #1
0
  private String assemblyCurSubDeptTree(List<Department> subDeptList) {
    StringBuffer strBuf = new StringBuffer();
    for (Department department : subDeptList) {
      strBuf.append("{\"text\" : \"" + department.getDeptName() + "\",");
      strBuf.append("\"id\" : \"" + department.getId() + "\",");
      strBuf.append("\"deptType\" : \"" + department.getDeptType() + "\",");
      HashMap<String, Integer> nameMap = new HashMap<String, Integer>();
      nameMap.put("parentId", department.getId());
      List<Department> list = entityDao.getDepartmentList(nameMap);
      if (list != null && list.size() > 0) {
        strBuf.append("\"leaf\" : false ,");
        strBuf.append("\"cls\" :\"fold\"");
      } else {
        strBuf.append("\"cls\" :'file',");
        strBuf.append("\"leaf\" : true");
      }
      strBuf.append("},");
    }

    if (strBuf.length() > 0) {
      strBuf.delete(strBuf.length() - 1, strBuf.length());
    }

    return strBuf.toString();
  }
Beispiel #2
0
 private boolean hasMoreDepartment(Integer oldManager) {
   HashMap<String, Integer> nameMap = new HashMap<String, Integer>();
   nameMap.put("deptManager", oldManager);
   List<Department> list = entityDao.getDepartmentList(nameMap);
   if (list.size() > 1) return true;
   else return false;
 }
Beispiel #3
0
 public List<Department> getCurSubDepartmentList(Integer id) {
   HashMap<String, Integer> nameMap = new HashMap<String, Integer>();
   nameMap.put("parentId", id);
   return entityDao.getDepartmentList(nameMap);
 }