概览、任务管理研发 10%

This commit is contained in:
守護
2024-04-16 21:45:15 +08:00
parent cf8e104c01
commit a585db1902
5 changed files with 109 additions and 23 deletions

View File

@@ -53,7 +53,7 @@ public class AssignmentJobDAO {
assignmentJobMapper.updateById(assignmentJobEntity);
}
public int getCountByStatus(JobStatusEnum status) {
public int getCountByStatus(Integer status) {
QueryWrapper<AssignmentJobEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(AssignmentJobEntity::getStatus, status);
return assignmentJobMapper.selectCount(queryWrapper).intValue();

View File

@@ -60,6 +60,9 @@ public class OverviewStatisticsResponse {
@ApiModelProperty("执行中的Job总数")
private Integer runningCount;
@ApiModelProperty("取消的Job总数")
private Integer cancelCount;
@ApiModelProperty("已经成功的总数")
private Integer successfulCount;

View File

@@ -51,11 +51,11 @@ public class OverviewService {
AssignmentJobStatistics assignmentJobStatistics = new AssignmentJobStatistics();
assignmentJobStatistics.setTotalCount(assignmentJobDAO.getTotalCount());
assignmentJobStatistics
.setRunningCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.RUNNING));
.setRunningCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.RUNNING.getValue()));
assignmentJobStatistics
.setSuccessfulCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.PASS));
assignmentJobStatistics.setFailedCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.FAIL));
.setSuccessfulCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.PASS.getValue()));
assignmentJobStatistics.setFailedCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.FAIL.getValue()));
assignmentJobStatistics.setCancelCount(assignmentJobDAO.getCountByStatus(JobStatusEnum.CANCEL.getValue()));
response.setAssignmentJobStatistics(assignmentJobStatistics);
return response;