打印了JENKINS节点日志
This commit is contained in:
parent
66efeb6058
commit
ccc8bc591e
@ -35,6 +35,9 @@ public class TeamApplicationDTO extends BaseDTO {
|
|||||||
@Schema(description = "工作流定义ID")
|
@Schema(description = "工作流定义ID")
|
||||||
private Long workflowDefinitionId;
|
private Long workflowDefinitionId;
|
||||||
|
|
||||||
|
@Schema(description = "工作流名称")
|
||||||
|
private String workflowDefinitionName;
|
||||||
|
|
||||||
@Schema(description = "团队名称")
|
@Schema(description = "团队名称")
|
||||||
private String teamName;
|
private String teamName;
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import com.qqchen.deploy.backend.deploy.service.ITeamApplicationService;
|
|||||||
import com.qqchen.deploy.backend.framework.enums.ResponseCode;
|
import com.qqchen.deploy.backend.framework.enums.ResponseCode;
|
||||||
import com.qqchen.deploy.backend.framework.exception.BusinessException;
|
import com.qqchen.deploy.backend.framework.exception.BusinessException;
|
||||||
import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
||||||
|
import com.qqchen.deploy.backend.workflow.entity.WorkflowDefinition;
|
||||||
|
import com.qqchen.deploy.backend.workflow.repository.IWorkflowDefinitionRepository;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@ -46,6 +48,9 @@ public class TeamApplicationServiceImpl extends BaseServiceImpl<TeamApplication,
|
|||||||
@Resource
|
@Resource
|
||||||
private IEnvironmentRepository environmentRepository;
|
private IEnvironmentRepository environmentRepository;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IWorkflowDefinitionRepository workflowDefinitionRepository;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TeamApplicationConverter teamApplicationConverter;
|
private TeamApplicationConverter teamApplicationConverter;
|
||||||
|
|
||||||
@ -100,6 +105,11 @@ public class TeamApplicationServiceImpl extends BaseServiceImpl<TeamApplication,
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
Set<Long> workflowDefinitionIds = teamApps.stream()
|
||||||
|
.map(TeamApplicationDTO::getWorkflowDefinitionId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
// 2. 批量查询团队信息
|
// 2. 批量查询团队信息
|
||||||
Map<Long, Team> teamMap = new HashMap<>();
|
Map<Long, Team> teamMap = new HashMap<>();
|
||||||
if (!teamIds.isEmpty()) {
|
if (!teamIds.isEmpty()) {
|
||||||
@ -124,7 +134,15 @@ public class TeamApplicationServiceImpl extends BaseServiceImpl<TeamApplication,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. 填充扩展字段
|
// 5. 批量查询工作流定义信息
|
||||||
|
Map<Long, WorkflowDefinition> workflowMap = new HashMap<>();
|
||||||
|
if (!workflowDefinitionIds.isEmpty()) {
|
||||||
|
workflowDefinitionRepository.findAllById(workflowDefinitionIds).forEach(workflow ->
|
||||||
|
workflowMap.put(workflow.getId(), workflow)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. 填充扩展字段
|
||||||
teamApps.forEach(teamApp -> {
|
teamApps.forEach(teamApp -> {
|
||||||
// 填充团队名称
|
// 填充团队名称
|
||||||
if (teamApp.getTeamId() != null) {
|
if (teamApp.getTeamId() != null) {
|
||||||
@ -150,6 +168,14 @@ public class TeamApplicationServiceImpl extends BaseServiceImpl<TeamApplication,
|
|||||||
teamApp.setEnvironmentName(env.getEnvName());
|
teamApp.setEnvironmentName(env.getEnvName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 填充工作流定义名称
|
||||||
|
if (teamApp.getWorkflowDefinitionId() != null) {
|
||||||
|
WorkflowDefinition workflow = workflowMap.get(teamApp.getWorkflowDefinitionId());
|
||||||
|
if (workflow != null) {
|
||||||
|
teamApp.setWorkflowDefinitionName(workflow.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user