| | |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.HostingFieldMapper; |
| | | import kr.wisestone.owl.repository.HostingFieldRepository; |
| | | import kr.wisestone.owl.service.CompanyFieldService; |
| | | import kr.wisestone.owl.service.HostingFieldService; |
| | | import kr.wisestone.owl.service.WorkspaceService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | |
| | | |
| | | @Autowired |
| | | private WorkspaceService workspaceService; |
| | | |
| | | @Autowired |
| | | private CompanyFieldService companyFieldService; |
| | | |
| | | @Autowired |
| | | private ExcelView excelView; |
| | |
| | | public void remove(HostingFieldForm HostingFieldForm) { |
| | | if (HostingFieldForm.getRemoveIds().size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.COMPANY_REMOVE_NOT_SELECT)); |
| | | this.messageAccessor.getMessage(MsgConstants.HOSTING_REMOVE_NOT_SELECT)); |
| | | } |
| | | for (Long id : HostingFieldForm.getRemoveIds()) { |
| | | List<CompanyField> companyField = this.companyFieldService.findByHosting(id); |
| | | if (companyField != null && companyField.size() > 0) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.HOSTING_EXIST_COMPANY)); |
| | | } else { |
| | | this.hostingFieldRepository.deleteById(id); |
| | | |
| | | } |
| | | } |
| | | this.hostingFieldRepository.flush(); |
| | | } |