Пример #1
0
 public void editDept(CompanyDept dept) {
   CompanyDept dept0 = systemDAO.getDeptById(dept.getId());
   dept.setEmployeeAmount(dept0.getEmployeeAmount());
   dept.setRoles(dept0.getRoles());
   dept.setEmployees(dept0.getEmployees());
   systemDAO.saveDept(dept);
 }
Пример #2
0
  @SuppressWarnings("unchecked")
  public List<CompanyDept> getDeptTree(int upDeptId) {

    List deptList = systemDAO.getDeptList(upDeptId);
    Iterator iterator = deptList.iterator();
    while (iterator.hasNext()) {
      String strA = "";
      CompanyDept dept = (CompanyDept) iterator.next();
      if (dept.getId() == 1) {
        tempList.clear();
      }
      if (dept.getUpDeptId() == 0) {
        strA = "";
      } else {
        strA = "——" + strA;
      }
      dept.setName(strA + " " + dept.getName());
      tempList.add(dept);
      // System.out.println(dept.getId() + dept.getName());
      getDeptTree(dept.getId());
    }
    return tempList;
  }