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); }
@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; }
public void addDept(CompanyDept dept) { dept.setDeptOrder(new Integer(99)); dept.setDeptStatus(new Integer(1)); systemDAO.saveDept(dept); }