添加接口
This commit is contained in:
parent
d830046c00
commit
f31d3fe736
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue