| | |
| | | import kr.wisestone.owl.mapper.HostingFieldMapper; |
| | | import kr.wisestone.owl.repository.HostingFieldRepository; |
| | | import kr.wisestone.owl.service.HostingFieldService; |
| | | import kr.wisestone.owl.service.UserService; |
| | | import kr.wisestone.owl.service.WorkspaceService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.vo.HostingFieldVo; |
| | |
| | | private HostingFieldMapper hostingFieldMapper; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private WorkspaceService workspaceService; |
| | | |
| | | @Autowired |
| | |
| | | return this.hostingFieldRepository; |
| | | } |
| | | |
| | | // 업체 추가 |
| | | // Hosting 추가 |
| | | @Override |
| | | public HostingField add(HostingFieldForm HostingFieldForm) { |
| | | HostingField HostingField = ConvertUtil.copyProperties(HostingFieldForm, HostingField.class); |
| | |
| | | return HostingField; |
| | | } |
| | | |
| | | // 업체 목록을 가져온다. |
| | | // Hosting 목록을 가져온다. |
| | | @Override |
| | | public List<HostingFieldVo> find(Map<String, Object> resJsonData, |
| | | HostingFieldCondition condition, Pageable pageable) { |
| | |
| | | } |
| | | |
| | | |
| | | // 업체 상세 조회한다. |
| | | // Hosting 상세 조회한다. |
| | | @Override |
| | | public void detail(Map<String, Object> resJsonData, HostingFieldCondition hostingFieldCondition) { |
| | | HostingFieldVo HostingFieldVo = new HostingFieldVo(); |
| | |
| | | resJsonData.put(Constants.REQ_KEY_CONTENT, HostingFieldVo); |
| | | } |
| | | |
| | | // 업체 정로를 수정한다. |
| | | // Hosting 정로를 수정한다. |
| | | @Override |
| | | public void modify(HostingFieldForm HostingFieldForm) { |
| | | HostingField HostingField = ConvertUtil.copyProperties(HostingFieldForm, HostingField.class); |
| | |
| | | } |
| | | |
| | | |
| | | // 업체를 삭제한다. |
| | | // Hosting를 삭제한다. |
| | | @Override |
| | | public void remove(HostingFieldForm HostingFieldForm) { |
| | | if (HostingFieldForm.getRemoveIds().size() < 1) { |
| | |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANY_REMOVE_NOT_SELECT)); |
| | | } |
| | | for (Long id : HostingFieldForm.getRemoveIds()) { |
| | | if (!this.userService.useUserLevel(id)) { |
| | | this.hostingFieldRepository.deleteById(id); |
| | | } else { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.DEPARTMENT_ALREADY_IN_USE)); |
| | | } |
| | | |
| | | } |
| | | this.hostingFieldRepository.flush(); |
| | | } |
| | | |
| | | // 업체 목록을 엑셀로 다운로드 한다. |
| | | // Hosting 목록을 엑셀로 다운로드 한다. |
| | | @Override |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | ModelAndView modelAndView = this.workspaceService.checkUseExcelDownload(model); |
| | |
| | | List<HostingFieldVo> hostingFieldVos = ConvertUtil.convertListToListClass(results, HostingFieldVo.class); |
| | | // code_ko_KR 에 code명 설정 |
| | | ExportExcelVo excelInfo = new ExportExcelVo(); |
| | | excelInfo.setFileName(this.messageAccessor.message("업체 목록")); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyName", this.messageAccessor.message("Hosting.companyName"), 6, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyManager", this.messageAccessor.message("Hosting.companyManager"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyTel", this.messageAccessor.message("Hosting.companyTel"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyEmail", this.messageAccessor.message("Hosting.companyEmail"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("companyMemo", this.messageAccessor.message("Hosting.companyMemo"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.setFileName(this.messageAccessor.message("Hosting 목록")); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("name", this.messageAccessor.message("Hosting.HostingName"), 6, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("code", this.messageAccessor.message("Hosting.HostingCode"), 6, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("manager", this.messageAccessor.message("Hosting.HostingManager"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("tel", this.messageAccessor.message("Hosting.HostingTel"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("email", this.messageAccessor.message("Hosting.HostingEmail"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("memo", this.messageAccessor.message("Hosting.HostingMemo"), 10, ExportExcelAttrVo.ALIGN_CENTER)); |
| | | |
| | | excelInfo.setDatas(hostingFieldVos); |
| | | |
| | |
| | | return hostingFieldVos; |
| | | } |
| | | |
| | | // 업체 ID 로 조회한다 |
| | | // Hosting ID 로 조회한다 |
| | | @Override |
| | | public HostingField getHosting(Long id) { |
| | | if (id == null) { |