| | |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.CustomFieldMapper; |
| | | import kr.wisestone.owl.repository.CustomFieldRepository; |
| | | import kr.wisestone.owl.repository.IssueTypeCustomFieldRepository; |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | |
| | | |
| | | @Autowired |
| | | private CustomFieldRepository customFieldRepository; |
| | | |
| | | @Autowired |
| | | private IssueTypeCustomFieldRepository issueTypeCustomFieldRepository; |
| | | |
| | | @Autowired |
| | | private CustomFieldMapper customFieldMapper; |
| | |
| | | public void removeCustomFields(CustomFieldForm customFieldForm) { |
| | | // 사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다. |
| | | this.workspaceService.checkUseWorkspace(); |
| | | |
| | | if (customFieldForm.getRemoveIds().size() < 1) { |
| | | List<Long> removeIds = customFieldForm.getRemoveIds(); |
| | | if (removeIds.size() < 1) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_REMOVE_NOT_SELECT)); |
| | | }else { |
| | | for (Long id : removeIds) { |
| | | Long count = this.issueTypeCustomFieldRepository.countByCustomFieldId(id); |
| | | if (count > 0){ |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_USED_DATA_REMOVE)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (Long projectId : customFieldForm.getRemoveIds()) { |
| | |
| | | } |
| | | |
| | | // this.customFieldRepository.flush(); |
| | | this.customFieldRepository.flush(); |
| | | } |
| | | |
| | | private void removeCustomFields(Long customFieldId) { |
| | |
| | | customField.setUse(UseType.N.toString()); |
| | | this.customFieldRepository.saveAndFlush(customField); |
| | | // this.customFieldRepository.delete(customField); |
| | | this.customFieldRepository.delete(customField); |
| | | } |
| | | |
| | | // 이슈 엑셀 import 에서 사용한다. |