Search in sources :

Example 1 with JobsStatusStatisticsPO

use of com.dtstack.taier.dao.domain.po.JobsStatusStatisticsPO in project Taier by DTStack.

the class JobService method queryJobsStatusStatistics.

/**
 * 统计周期实例状态
 *
 * @param dto
 * @return
 */
public List<ReturnJobStatusStatisticsVO> queryJobsStatusStatistics(QueryJobStatusStatisticsDTO dto) {
    // 关联任务
    List<Long> taskIdList = null;
    if (StringUtils.isNotBlank(dto.getTaskName()) || dto.getOperatorId() != null) {
        List<ScheduleTaskShade> scheduleTaskShadeList = taskService.findTaskByTaskName(dto.getTaskName(), null, dto.getOperatorId());
        if (CollectionUtils.isEmpty(scheduleTaskShadeList)) {
            return Lists.newArrayList();
        } else {
            taskIdList = scheduleTaskShadeList.stream().map(ScheduleTaskShade::getTaskId).collect(Collectors.toList());
        }
    }
    // 查询db统计数据
    JobsStatusStatisticsPO jobsStatusStatistics = JobMapstructTransfer.INSTANCE.queryJobStatusStatisticsDTOToJobsStatusStatistics(dto);
    jobsStatusStatistics.setCycStartTime(getCycTime(dto.getCycStartDay()));
    jobsStatusStatistics.setCycEndTime(getCycTime(dto.getCycEndDay()));
    jobsStatusStatistics.setFillTypeList(Lists.newArrayList(FillJobTypeEnum.DEFAULT.getType(), FillJobTypeEnum.RUN_JOB.getType()));
    jobsStatusStatistics.setTaskIdList(taskIdList);
    List<StatusCountPO> statusCountList = this.baseMapper.queryJobsStatusStatistics(jobsStatusStatistics);
    // 封装结果集
    return mergeStatusAndShow(statusCountList);
}
Also used : StatusCountPO(com.dtstack.taier.dao.domain.po.StatusCountPO) JobsStatusStatisticsPO(com.dtstack.taier.dao.domain.po.JobsStatusStatisticsPO) ScheduleTaskShade(com.dtstack.taier.dao.domain.ScheduleTaskShade)

Aggregations

ScheduleTaskShade (com.dtstack.taier.dao.domain.ScheduleTaskShade)1 JobsStatusStatisticsPO (com.dtstack.taier.dao.domain.po.JobsStatusStatisticsPO)1 StatusCountPO (com.dtstack.taier.dao.domain.po.StatusCountPO)1