Search in sources :

Example 6 with InputDTO

use of io.choerodon.agile.infra.statemachineclient.dto.InputDTO in project agile-service by open-hand.

the class IssueServiceImpl method updateIssueStatusWithoutRuleNotice.

@Override
public IssueVO updateIssueStatusWithoutRuleNotice(Long projectId, Long issueId, Long transformId, Long objectVersionNumber, String applyType, IssueDTO triggerIssue, boolean autoTranferFlag) {
    Set<Long> influenceIssueIds = new HashSet<>();
    IssueVO result = doStateMachineTransformAndCustomFlow(projectId, issueId, applyType, influenceIssueIds, new TriggerCarrierVO(), false, transformId, new InputDTO(issueId, "updateStatus", updateTrigger(autoTranferFlag, triggerIssue)));
    if (backlogExpandService != null) {
        backlogExpandService.changeDetection(issueId, projectId, ConvertUtil.getOrganizationId(projectId));
    }
    IssueVO issueVO = queryIssueByUpdate(projectId, issueId, Collections.singletonList(STATUS_ID));
    issueVO.setInfluenceIssueIds(new ArrayList<>(influenceIssueIds));
    if (result != null) {
        issueVO.setErrorMsg(result.getErrorMsg());
    }
    return issueVO;
}
Also used : InputDTO(io.choerodon.agile.infra.statemachineclient.dto.InputDTO)

Example 7 with InputDTO

use of io.choerodon.agile.infra.statemachineclient.dto.InputDTO in project agile-service by open-hand.

the class BoardServiceImpl method move.

@Override
public IssueMoveVO move(Long projectId, Long issueId, Long transformId, IssueMoveVO issueMoveVO, Boolean isDemo) {
    // 执行状态机转换
    IssueDTO preIssueDTO = issueMapper.selectByPrimaryKey(issueId);
    if (preIssueDTO == null) {
        throw new CommonException("error.issue.notFound");
    }
    Long preStatusId = preIssueDTO.getStatusId();
    Long nowStatusId = issueMoveVO.getStatusId();
    InputDTO inputDTO = new InputDTO(issueId, UPDATE_STATUS_MOVE, JSON.toJSONString(handleIssueMoveRank(projectId, issueMoveVO)));
    Set<Long> influenceIssueIds = new HashSet<>();
    IssueVO issueVO = issueService.doStateMachineCustomFlowAndRuleNotice(projectId, issueId, SchemeApplyType.AGILE, influenceIssueIds, isDemo, transformId, inputDTO);
    IssueDTO issueDTO = issueMapper.selectByPrimaryKey(issueId);
    if (backlogExpandService != null) {
        backlogExpandService.changeDetection(issueId, projectId, ConvertUtil.getOrganizationId(projectId));
    }
    IssueMoveVO result = modelMapper.map(issueDTO, IssueMoveVO.class);
    if (!preStatusId.equals(nowStatusId)) {
        sendMsgUtil.sendMsgByIssueMoveComplete(projectId, issueMoveVO, issueDTO, DetailsHelper.getUserDetails().getUserId());
    }
    if (!ObjectUtils.isEmpty(issueVO)) {
        result.setErrorMsg(issueVO.getErrorMsg());
    }
    return result;
}
Also used : IssueDTO(io.choerodon.agile.infra.dto.business.IssueDTO) CommonException(io.choerodon.core.exception.CommonException) InputDTO(io.choerodon.agile.infra.statemachineclient.dto.InputDTO) IssueVO(io.choerodon.agile.api.vo.business.IssueVO)

Aggregations

InputDTO (io.choerodon.agile.infra.statemachineclient.dto.InputDTO)7 IssueConvertDTO (io.choerodon.agile.infra.dto.business.IssueConvertDTO)3 IssueDTO (io.choerodon.agile.infra.dto.business.IssueDTO)3 CommonException (io.choerodon.core.exception.CommonException)3 ProjectInfoDTO (io.choerodon.agile.infra.dto.ProjectInfoDTO)2 StateMachineTransformDTO (io.choerodon.agile.infra.statemachineclient.dto.StateMachineTransformDTO)2 Transactional (org.springframework.transaction.annotation.Transactional)2 IssueVO (io.choerodon.agile.api.vo.business.IssueVO)1 CreateIssuePayload (io.choerodon.agile.api.vo.event.CreateIssuePayload)1 CreateSubIssuePayload (io.choerodon.agile.api.vo.event.CreateSubIssuePayload)1