| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import kr.wisestone.owl.domain.UserLevel; |
| | | import kr.wisestone.owl.web.form.UserLevelForm; |
| | | import org.springframework.ui.Model; |
| | | import com.google.common.collect.Lists; |
| | |
| | | @Override |
| | | public List<DepartmentManageVo> findDepartment(Map<String, Object> resJsonData, |
| | | DepartmentManageCondition condition, Pageable pageable) { |
| | | |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | |
| | |
| | | |
| | | return this.convertDepartmentManageVoToMap(results, totalDepartmentCount, pageable, resJsonData); |
| | | } |
| | | |
| | | |
| | | |
| | | // 사용자 부서 ID로 조회한다. |
| | | @Override |
| | |
| | | |
| | | // 부서를 삭제한다. |
| | | @Override |
| | | public void removeUserLevel(DepartmentManageForm departmentManageForm) { |
| | | public void removeDepartment(DepartmentManageForm departmentManageForm) { |
| | | if (departmentManageForm.getRemoveIds().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.PROJECT_REMOVE_NOT_SELECT)); |
| | | } |
| | | this.departmentManageRepository.flush(); |
| | | } |
| | | |
| | | // 부서 상세 조회한다. |
| | | @Override |
| | | public void detailDepartment(Map<String, Object> resJsonData, DepartmentManageCondition departmentManageCondition) { |
| | | DepartmentManageVo departmentManageVo = new DepartmentManageVo(); |
| | | |
| | | if (departmentManageVo.getId() != null) { |
| | | DepartmentManage departmentManage = this.getDepartment(departmentManageCondition.getId()); |
| | | departmentManageVo = ConvertUtil.copyProperties(departmentManage, DepartmentManageVo.class); |
| | | } |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, departmentManageVo); |
| | | } |
| | | |
| | | // 부서 정보를 수정한다. |
| | | @Override |
| | | public void modifyDepartment(DepartmentManageForm departmentManageForm) { |
| | | DepartmentManage departmentManage = ConvertUtil.copyProperties(departmentManageForm, DepartmentManage.class); |
| | | departmentManageRepository.saveAndFlush(departmentManage); |
| | | } |
| | | |
| | | |
| | |
| | | return departmentManageVos; |
| | | } |
| | | |
| | | // 부서 목록을 엑셀로 다운로드 한다. |
| | | @Override |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | |
| | |
| | | excelInfo.setFileName(this.messageAccessor.message("부서 목록")); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("departmentName", this.messageAccessor.message("departmentManage.departmentName"), 6, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("departmentDescription", this.messageAccessor.message("departmentManage.departmentDescription"), 20, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("departmentCount", this.messageAccessor.message("departmentManage.departmentCount"), 3, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | |
| | | excelInfo.setDatas(departmentManageVos); |
| | | |