use of io.choerodon.agile.infra.dto.WikiRelationDTO in project agile-service by open-hand.
the class WikiRelationServiceImpl method checkRepeat.
private Boolean checkRepeat(WikiRelationDTO wikiRelationDTO) {
WikiRelationDTO wikiRelation = new WikiRelationDTO();
wikiRelation.setProjectId(wikiRelationDTO.getProjectId());
wikiRelation.setIssueId(wikiRelationDTO.getIssueId());
wikiRelation.setSpaceId(wikiRelationDTO.getSpaceId());
WikiRelationDTO res = wikiRelationMapper.selectOne(wikiRelation);
return res != null;
}
use of io.choerodon.agile.infra.dto.WikiRelationDTO in project agile-service by open-hand.
the class WikiRelationServiceImpl method deleteByWorkSpaceId.
@Override
public void deleteByWorkSpaceId(Long projectId, Long workSpaceId) {
WikiRelationDTO wikiRelationDTO = new WikiRelationDTO();
wikiRelationDTO.setSpaceId(workSpaceId);
List<WikiRelationDTO> wikiRelationDTOS = wikiRelationMapper.select(wikiRelationDTO);
if (!CollectionUtils.isEmpty(wikiRelationDTOS)) {
wikiRelationDTOS.forEach(v -> iWikiRelationService.deleteBase(wikiRelationDTO));
}
}
use of io.choerodon.agile.infra.dto.WikiRelationDTO in project agile-service by open-hand.
the class WikiRelationServiceImpl method deleteById.
@Override
public void deleteById(Long projectId, Long id) {
WikiRelationDTO wikiRelationDTO = new WikiRelationDTO();
wikiRelationDTO.setProjectId(projectId);
wikiRelationDTO.setId(id);
iWikiRelationService.deleteBase(wikiRelationDTO);
BaseFieldUtil.updateIssueLastUpdateInfo(wikiRelationDTO.getIssueId(), projectId);
}
use of io.choerodon.agile.infra.dto.WikiRelationDTO in project agile-service by open-hand.
the class WikiRelationServiceImpl method queryByIssueId.
@Override
public KnowledgeRelationVO queryByIssueId(Long projectId, Long issueId) {
WikiRelationDTO wikiRelationDTO = new WikiRelationDTO();
wikiRelationDTO.setIssueId(issueId);
List<WikiRelationDTO> wikiRelationDTOList = wikiRelationMapper.select(wikiRelationDTO);
List<WikiRelationVO> result = new ArrayList<>();
if (wikiRelationDTOList != null && !wikiRelationDTOList.isEmpty()) {
List<Long> spaceIds = wikiRelationDTOList.stream().map(WikiRelationDTO::getSpaceId).collect(Collectors.toList());
Map<Long, WorkSpaceVO> workSpaceMap = new HashMap<>();
workSpaceMap.putAll(knowledgebaseClientOperator.querySpaceByIds(projectId, spaceIds).stream().collect(Collectors.toMap(WorkSpaceVO::getId, Function.identity())));
for (WikiRelationDTO wikiRelation : wikiRelationDTOList) {
WorkSpaceVO workSpaceVO = workSpaceMap.get(wikiRelation.getSpaceId());
if (!ObjectUtils.isEmpty(workSpaceVO)) {
WikiRelationVO wikiRelationVO = new WikiRelationVO();
BeanUtils.copyProperties(wikiRelation, wikiRelationVO);
wikiRelationVO.setWorkSpaceVO(workSpaceVO);
result.add(wikiRelationVO);
}
}
}
KnowledgeRelationVO knowledgeRelation = new KnowledgeRelationVO();
knowledgeRelation.setKnowledgeRelationList(result);
return knowledgeRelation;
}
use of io.choerodon.agile.infra.dto.WikiRelationDTO in project agile-service by open-hand.
the class WikiRelationServiceImpl method create.
@Override
public void create(Long projectId, List<WikiRelationVO> wikiRelationVOList) {
List<WikiRelationDTO> wikiRelationDTOList = modelMapper.map(wikiRelationVOList, new TypeToken<List<WikiRelationDTO>>() {
}.getType());
if (wikiRelationDTOList != null && !wikiRelationDTOList.isEmpty()) {
for (WikiRelationDTO wikiRelationDTO : wikiRelationDTOList) {
if (!checkRepeat(wikiRelationDTO)) {
iWikiRelationService.createBase(wikiRelationDTO);
BaseFieldUtil.updateIssueLastUpdateInfo(wikiRelationDTO.getIssueId(), wikiRelationDTO.getProjectId());
}
}
}
}
Aggregations