use of io.choerodon.agile.api.vo.ProjectVO 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);
}
use of io.choerodon.agile.api.vo.ProjectVO in project agile-service by open-hand.
the class ProjectCategory method getProjectApplyType.
public static List<String> getProjectApplyType(Long projectId) {
ProjectVO projectVO = ConvertUtil.queryProject(projectId);
if (CollectionUtils.isEmpty(projectVO.getCategories())) {
throw new CommonException(ERROR_CATEGORIES_IS_NULL);
}
List<String> applyTypes = new ArrayList<>();
Set<String> codes = projectVO.getCategories().stream().map(ProjectCategoryDTO::getCode).collect(Collectors.toSet());
if (codes.contains(ProjectCategory.MODULE_PROGRAM)) {
applyTypes.add(SchemeApplyType.PROGRAM);
}
if (codes.contains(ProjectCategory.MODULE_AGILE) || codes.contains(ProjectCategory.MODULE_WATERFALL_AGILE)) {
applyTypes.add(SchemeApplyType.AGILE);
}
if (codes.contains(ProjectCategory.MODULE_WATERFALL)) {
applyTypes.add(SchemeApplyType.WATERFALL);
}
return applyTypes;
}
use of io.choerodon.agile.api.vo.ProjectVO in project agile-service by open-hand.
the class ProjectCategory method getProjectIssueTypeList.
public static String getProjectIssueTypeList(Long projectId) {
ProjectVO projectVO = ConvertUtil.queryProject(projectId);
if (CollectionUtils.isEmpty(projectVO.getCategories())) {
throw new CommonException(ERROR_CATEGORIES_IS_NULL);
}
String issueTypeList = "agileIssueType";
Set<String> codes = projectVO.getCategories().stream().map(ProjectCategoryDTO::getCode).collect(Collectors.toSet());
if (codes.contains(ProjectCategory.MODULE_WATERFALL_AGILE)) {
return "waterfallAgileIssueType";
}
if (codes.contains(ProjectCategory.MODULE_WATERFALL)) {
return "waterfallIssueType";
}
return issueTypeList;
}
use of io.choerodon.agile.api.vo.ProjectVO in project agile-service by open-hand.
the class FixDataServiceImpl method fixCreateProject.
@Override
public void fixCreateProject() {
// 查询有问题的项目id列表
List<Long> configProjectIds = projectConfigMapper.selectAll().stream().map(ProjectConfigDTO::getProjectId).collect(Collectors.toList());
List<Long> projectIds = projectInfoMapper.selectAll().stream().map(ProjectInfoDTO::getProjectId).collect(Collectors.toList());
projectIds.removeAll(configProjectIds);
Collections.sort(projectIds, Comparator.reverseOrder());
LOGGER.info("查询出有问题的项目共有{}个,开始修复数据", projectIds.size());
int count = 0;
for (Long projectId : projectIds) {
ProjectVO project = baseFeignClient.queryProject(projectId).getBody();
LOGGER.info("项目id:{},项目信息:{}", projectId, project);
if (!project.getCode().equals("def-ops-proj") || !project.getCategory().equals(ProjectCategory.GENERAL) || !project.getCreatedBy().equals(0L)) {
LOGGER.info("项目id:{},该项目不符合规定,跳过", projectId);
continue;
}
singleFix(projectId, project);
count++;
}
LOGGER.info("完成修复数据,共计修复项目{}个", count);
}
use of io.choerodon.agile.api.vo.ProjectVO in project agile-service by open-hand.
the class FixDataServiceImpl method fixCreateProjectSingle.
@Override
public void fixCreateProjectSingle(Long projectId) {
ProjectInfoDTO projectInfo = new ProjectInfoDTO();
projectInfo.setProjectId(projectId);
if (projectInfoMapper.select(projectInfo).isEmpty()) {
LOGGER.info("项目id:{},该项目不符合规定,跳过", projectId);
return;
}
ProjectConfigDTO projectConfig = new ProjectConfigDTO();
projectConfig.setProjectId(projectId);
if (!projectConfigMapper.select(projectConfig).isEmpty()) {
LOGGER.info("项目id:{},该项目不符合规定,跳过", projectId);
return;
}
ProjectVO project = baseFeignClient.queryProject(projectId).getBody();
LOGGER.info("项目id:{},项目信息:{}", projectId, project);
if (!project.getCode().equals("def-ops-proj") || !project.getCategory().equals(ProjectCategory.GENERAL) || !project.getCreatedBy().equals(0L)) {
LOGGER.info("项目id:{},该项目不符合规定,跳过", projectId);
return;
}
singleFix(projectId, project);
}
Aggregations