package com.ruoyi.task.controller.convert; import com.ruoyi.task.api.domain.TaskStatQueryVO; /** * 任务统计Controller转换器 * * @author ruoyi * @date 2026-03-09 */ public class TaskStatControllerConvert { /** * API 查询DTO 转 服务查询DTO */ public static com.ruoyi.task.service.dto.TaskStatQueryServiceDTO toQuery(TaskStatQueryVO apiDTO) { if (apiDTO == null) return null; com.ruoyi.task.service.dto.TaskStatQueryServiceDTO dto = new com.ruoyi.task.service.dto.TaskStatQueryServiceDTO(); dto.setYear(apiDTO.getYear()); dto.setMonth(apiDTO.getMonth()); dto.setTaskCategory(apiDTO.getTaskCategory()); dto.setTaskType(apiDTO.getTaskType()); dto.setStatus(apiDTO.getStatus()); dto.setRouteId(apiDTO.getRouteId()); dto.setUavId(apiDTO.getUavId()); return dto; } /** * 服务按年统计DTO 转 API 按年统计DTO */ public static com.ruoyi.task.api.domain.TaskStatByYearDTO fromYear(com.ruoyi.task.service.dto.TaskStatByYearServiceDTO dto) { if (dto == null) return null; com.ruoyi.task.api.domain.TaskStatByYearDTO apiDTO = new com.ruoyi.task.api.domain.TaskStatByYearDTO(); apiDTO.setTotal(dto.getTotal()); apiDTO.setMonths(dto.getMonths()); return apiDTO; } /** * 服务按月统计DTO 转 API 按月统计DTO */ public static com.ruoyi.task.api.domain.TaskStatByMonthDTO fromMonth(com.ruoyi.task.service.dto.TaskStatByMonthServiceDTO dto) { if (dto == null) return null; com.ruoyi.task.api.domain.TaskStatByMonthDTO apiDTO = new com.ruoyi.task.api.domain.TaskStatByMonthDTO(); apiDTO.setTotal(dto.getTotal()); apiDTO.setDays(dto.getDays()); return apiDTO; } }