| | |
| | | import kr.wisestone.owl.web.condition.DepartmentCondition; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentForm; |
| | | import kr.wisestone.owl.web.form.UserDepartmentForm; |
| | | import org.springframework.ui.Model; |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.common.ExcelConditionCheck; |
| | |
| | | } |
| | | |
| | | for (Long id : departmentForm.getRemoveIds()) { |
| | | if (!this.userService.useUserLevel(id)) { |
| | | this.departmentRepository.deleteById(id); |
| | | } else { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.DEPARTMENT_ALREADY_IN_USE)); |
| | | } |
| | | |
| | | this.departmentRepository.deleteById(id); |
| | | this.departmentRepository.flush(); |
| | | } |
| | | this.departmentRepository.flush(); |
| | | } |
| | | |
| | | |
| | | |
| | | // 부서 목록을 엑셀로 다운로드 한다. |
| | |
| | | return department; |
| | | } |
| | | |
| | | |
| | | // 삭제 할 부서 유저가 사용하고 있는지 확인 |
| | | @Override |
| | | public boolean department(Long Id) { |
| | |
| | | return this.departmentMapper.findByDepartmentIds(condition); |
| | | } |
| | | |
| | | |
| | | // 검색 결과를 DepartmentVo 로 변환한다. |
| | | private List<DepartmentVo> convertDepartmentVoToMap(List<Map<String, Object>> results, Long totalDepartmentsCount, Pageable pageable, Map<String, Object> resJsonData) { |
| | | List<DepartmentVo> departmentVos = Lists.newArrayList(); |
| | | |
| | | for (Map<String, Object> result : results) { |
| | | DepartmentVo departmentVo = ConvertUtil.convertMapToClass(result, DepartmentVo.class); |
| | | departmentVo.setByName(departmentVo.getDepartmentName()); |
| | | departmentVos.add(departmentVo); |
| | | } |
| | | |