Search in sources :

Example 6 with IssueDTO

use of io.choerodon.agile.infra.dto.business.IssueDTO in project agile-service by open-hand.

the class IssueServiceImpl method queryIssueByProjectIdAndIssueId.

@Override
public IssueConvertDTO queryIssueByProjectIdAndIssueId(Long projectId, Long issueId) {
    IssueDTO issueDTO = new IssueDTO();
    issueDTO.setProjectId(projectId);
    issueDTO.setIssueId(issueId);
    return modelMapper.map(issueMapper.selectOne(issueDTO), IssueConvertDTO.class);
}
Also used : IssueDTO(io.choerodon.agile.infra.dto.business.IssueDTO)

Example 7 with IssueDTO

use of io.choerodon.agile.infra.dto.business.IssueDTO in project agile-service by open-hand.

the class IssueServiceImpl method dragEpic.

@Override
public synchronized EpicDataVO dragEpic(Long projectId, EpicSequenceVO epicSequenceVO) {
    if (epicSequenceVO.getAfterSequence() == null && epicSequenceVO.getBeforeSequence() == null) {
        throw new CommonException("error.dragEpic.noSequence");
    }
    IssueDTO issueDTO = new IssueDTO();
    issueDTO.setIssueId(epicSequenceVO.getEpicId());
    issueDTO.setProjectId(projectId);
    IssueConvertDTO issueConvertDTO = modelMapper.map(issueMapper.selectOne(issueDTO), IssueConvertDTO.class);
    if (issueConvertDTO == null) {
        throw new CommonException("error.issue.notFound");
    } else {
        if (epicSequenceVO.getAfterSequence() == null) {
            Integer maxSequence = productVersionMapper.queryMaxAfterSequence(epicSequenceVO.getBeforeSequence(), projectId);
            epicSequenceVO.setAfterSequence(maxSequence);
        } else if (epicSequenceVO.getBeforeSequence() == null) {
            Integer minSequence = productVersionMapper.queryMinBeforeSequence(epicSequenceVO.getAfterSequence(), projectId);
            epicSequenceVO.setBeforeSequence(minSequence);
        }
        handleSequence(epicSequenceVO, projectId, issueConvertDTO);
    }
    return epicDataAssembler.toTarget(issueMapper.queryEpicListByEpic(epicSequenceVO.getEpicId(), projectId), EpicDataVO.class);
}
Also used : IssueConvertDTO(io.choerodon.agile.infra.dto.business.IssueConvertDTO) IssueDTO(io.choerodon.agile.infra.dto.business.IssueDTO) CommonException(io.choerodon.core.exception.CommonException)

Example 8 with IssueDTO

use of io.choerodon.agile.infra.dto.business.IssueDTO in project agile-service by open-hand.

the class IssueServiceImpl method buildTriggerCarrierVO.

@Override
public void buildTriggerCarrierVO(Long projectId, Long issueId, List<TriggerCarrierVO> list, List<Long> customFieldIds) {
    IssueDTO issueDTO = issueMapper.selectByPrimaryKey(issueId);
    if (ObjectUtils.isEmpty(issueDTO)) {
        return;
    }
    TriggerCarrierVO triggerCarrierVO = new TriggerCarrierVO();
    triggerCarrierVO.setInstanceId(issueId);
    triggerCarrierVO.setProjectId(projectId);
    triggerCarrierVO.setIssueTypeId(issueDTO.getIssueTypeId());
    triggerCarrierVO.setNoticeInstanceId(issueId);
    triggerCarrierVO.setFieldList(new ArrayList<>());
    triggerCarrierVO.setExecutedRules(new ArrayList<>());
    triggerCarrierVO.setMemberFieldIds(new HashSet<>(customFieldIds));
    triggerCarrierVO.setAuditDomain(issueDTO);
    list.add(triggerCarrierVO);
}
Also used : IssueDTO(io.choerodon.agile.infra.dto.business.IssueDTO)

Example 9 with IssueDTO

use of io.choerodon.agile.infra.dto.business.IssueDTO in project agile-service by open-hand.

the class IssueServiceImpl method pagedQueryByOptions.

@Override
public Page<IssueLinkVO> pagedQueryByOptions(Long projectId, PageRequest pageRequest, IssueQueryVO issueQueryVO) {
    List<Long> issueIds = issueQueryVO.getIssueIds();
    Page emptyPage = PageUtil.emptyPage(pageRequest.getPage(), pageRequest.getSize());
    if (ObjectUtils.isEmpty(issueIds)) {
        return emptyPage;
    }
    Page<IssueDTO> result = PageHelper.doPage(pageRequest, () -> issueMapper.listIssueInfoByIssueIds(projectId, issueIds, issueQueryVO));
    List<IssueDTO> content = result.getContent();
    if (ObjectUtils.isEmpty(content)) {
        return emptyPage;
    }
    List<IssueLinkVO> list = issueAssembler.issueDTOTOVO(projectId, content);
    return PageUtils.copyPropertiesAndResetContent(result, list);
}
Also used : IssueDTO(io.choerodon.agile.infra.dto.business.IssueDTO) Page(io.choerodon.core.domain.Page)

Example 10 with IssueDTO

use of io.choerodon.agile.infra.dto.business.IssueDTO in project agile-service by open-hand.

the class ProjectConfigServiceImpl method checkIssueUse.

private Boolean checkIssueUse(Long projectId, Long issueTypeId, Long statusId) {
    if (issueTypeId == 0) {
        return false;
    }
    IssueDTO issueDTO = new IssueDTO();
    issueDTO.setProjectId(projectId);
    issueDTO.setStatusId(statusId);
    issueDTO.setIssueTypeId(issueTypeId);
    List<IssueDTO> select = issueMapper.select(issueDTO);
    return !CollectionUtils.isEmpty(select);
}
Also used : IssueDTO(io.choerodon.agile.infra.dto.business.IssueDTO)

Aggregations

IssueDTO (io.choerodon.agile.infra.dto.business.IssueDTO)97 CommonException (io.choerodon.core.exception.CommonException)48 IssueConvertDTO (io.choerodon.agile.infra.dto.business.IssueConvertDTO)9 BigDecimal (java.math.BigDecimal)9 Collectors (java.util.stream.Collectors)8 Autowired (org.springframework.beans.factory.annotation.Autowired)8 JSONObject (com.alibaba.fastjson.JSONObject)7 io.choerodon.agile.api.vo (io.choerodon.agile.api.vo)7 java.util (java.util)7 ModelMapper (org.modelmapper.ModelMapper)7 ObjectUtils (org.springframework.util.ObjectUtils)7 IssueUpdateVO (io.choerodon.agile.api.vo.business.IssueUpdateVO)6 io.choerodon.agile.infra.dto (io.choerodon.agile.infra.dto)6 SchemeApplyType (io.choerodon.agile.infra.enums.SchemeApplyType)6 SimpleDateFormat (java.text.SimpleDateFormat)6 Sort (io.choerodon.mybatis.pagehelper.domain.Sort)5 Function (java.util.function.Function)5 CollectionUtils (org.springframework.util.CollectionUtils)5 IssueListVO (io.choerodon.agile.api.vo.business.IssueListVO)4 TriggerCarrierVO (io.choerodon.agile.api.vo.business.TriggerCarrierVO)4