添加接口

This commit is contained in:
孙小云 2026-03-13 10:52:55 +08:00
parent d830046c00
commit f31d3fe736
3 changed files with 19 additions and 9 deletions

View File

@ -29,7 +29,7 @@ public class TaskStatControllerConvert {
dto.setTaskType(apiDTO.getTaskType());
dto.setStatusList(apiDTO.getStatusList());
dto.setRouteIdList(apiDTO.getRouteIdList());
dto.setUavId(apiDTO.getUavId());
dto.setUavIdList(apiDTO.getUavIdList());
return dto;
}

View File

@ -32,8 +32,8 @@ public class TaskStatQueryServiceDTO {
/** 航线ID列表 */
private List<Long> routeIdList;
/** 无人机ID */
private String uavId;
/** 无人机ID列表 */
private List<String> uavIdList;
public Integer getYear() {
return year;
@ -83,11 +83,11 @@ public class TaskStatQueryServiceDTO {
this.routeIdList = routeIdList;
}
public String getUavId() {
return uavId;
public List<String> getUavIdList() {
return uavIdList;
}
public void setUavId(String uavId) {
this.uavId = uavId;
public void setUavIdList(List<String> uavIdList) {
this.uavIdList = uavIdList;
}
}

View File

@ -193,7 +193,6 @@ public class TaskServiceImpl implements ITaskService {
@Override
public TaskStatByYearServiceDTO getTaskStatByYear(TaskStatQueryServiceDTO queryDTO) {
Task task = new Task();
task.setUavId(queryDTO.getUavId());
task.setTaskCategory(queryDTO.getTaskCategory());
task.setTaskType(queryDTO.getTaskType());
@ -217,6 +216,12 @@ public class TaskServiceImpl implements ITaskService {
continue;
}
// 如果指定了无人机ID列表则过滤无人机
if (queryDTO.getUavIdList() != null && !queryDTO.getUavIdList().isEmpty()
&& !queryDTO.getUavIdList().contains(t.getUavId())) {
continue;
}
calendar.setTime(t.getStartTime());
int year = calendar.get(Calendar.YEAR);
if (year == queryDTO.getYear()) {
@ -236,7 +241,6 @@ public class TaskServiceImpl implements ITaskService {
@Override
public TaskStatByMonthServiceDTO getTaskStatByMonth(TaskStatQueryServiceDTO queryDTO) {
Task task = new Task();
task.setUavId(queryDTO.getUavId());
task.setTaskCategory(queryDTO.getTaskCategory());
task.setTaskType(queryDTO.getTaskType());
@ -260,6 +264,12 @@ public class TaskServiceImpl implements ITaskService {
continue;
}
// 如果指定了无人机ID列表则过滤无人机
if (queryDTO.getUavIdList() != null && !queryDTO.getUavIdList().isEmpty()
&& !queryDTO.getUavIdList().contains(t.getUavId())) {
continue;
}
calendar.setTime(t.getStartTime());
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;