Search in sources :

Example 1 with ProjectCategoryDTO

use of io.choerodon.agile.infra.feign.vo.ProjectCategoryDTO in project agile-service by open-hand.

the class ProjectCategory method isWaterfallProject.

public static boolean isWaterfallProject(Long projectId) {
    ProjectVO projectVO = ConvertUtil.queryProject(projectId);
    List<ProjectCategoryDTO> categories = projectVO.getCategories();
    if (CollectionUtils.isEmpty(categories)) {
        throw new CommonException(ERROR_CATEGORIES_IS_NULL);
    }
    Set<String> codes = categories.stream().map(ProjectCategoryDTO::getCode).collect(Collectors.toSet());
    return codes.contains(MODULE_WATERFALL) || codes.contains(MODULE_WATERFALL_AGILE);
}
Also used : ProjectCategoryDTO(io.choerodon.agile.infra.feign.vo.ProjectCategoryDTO) CommonException(io.choerodon.core.exception.CommonException) ProjectVO(io.choerodon.agile.api.vo.ProjectVO)

Aggregations

ProjectVO (io.choerodon.agile.api.vo.ProjectVO)1 ProjectCategoryDTO (io.choerodon.agile.infra.feign.vo.ProjectCategoryDTO)1 CommonException (io.choerodon.core.exception.CommonException)1