| | |
| | | @Override |
| | | @Transactional |
| | | public boolean removeRelationIssue(Map<String, Object> resJsonData, IssueRelationCondition condition) { |
| | | Long id = condition.getId(); |
| | | if (id != null) { |
| | | IssueRelation issueRelation = findOne(id); |
| | | if (issueRelation != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectRelationIssue(IssueHistoryType.DELETE, issueRelation, sb); |
| | | issueHistoryService.addIssueHistory(issueRelation.getIssue(), IssueHistoryType.MODIFY, sb.toString()); |
| | | //Long id = condition.getId(); |
| | | List<Long> relRemoveIds = condition.getRemoveIds(); |
| | | if (relRemoveIds != null && relRemoveIds.size() > 0) { |
| | | for (Long relId : relRemoveIds) { |
| | | IssueRelation issueRelation = findOne(relId); |
| | | if (issueRelation != null) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | issueHistoryService.detectRelationIssue(IssueHistoryType.DELETE, issueRelation, sb); |
| | | issueHistoryService.addIssueHistory(issueRelation.getIssue(), IssueHistoryType.MODIFY, sb.toString()); |
| | | |
| | | this.issueRelationRepository.deleteById(id); |
| | | |
| | | return true; |
| | | this.issueRelationRepository.deleteById(relId); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | } |