添加接口
This commit is contained in:
parent
d830046c00
commit
f31d3fe736
|
|
@ -29,7 +29,7 @@ public class TaskStatControllerConvert {
|
||||||
dto.setTaskType(apiDTO.getTaskType());
|
dto.setTaskType(apiDTO.getTaskType());
|
||||||
dto.setStatusList(apiDTO.getStatusList());
|
dto.setStatusList(apiDTO.getStatusList());
|
||||||
dto.setRouteIdList(apiDTO.getRouteIdList());
|
dto.setRouteIdList(apiDTO.getRouteIdList());
|
||||||
dto.setUavId(apiDTO.getUavId());
|
dto.setUavIdList(apiDTO.getUavIdList());
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ public class TaskStatQueryServiceDTO {
|
||||||
/** 航线ID列表 */
|
/** 航线ID列表 */
|
||||||
private List<Long> routeIdList;
|
private List<Long> routeIdList;
|
||||||
|
|
||||||
/** 无人机ID */
|
/** 无人机ID列表 */
|
||||||
private String uavId;
|
private List<String> uavIdList;
|
||||||
|
|
||||||
public Integer getYear() {
|
public Integer getYear() {
|
||||||
return year;
|
return year;
|
||||||
|
|
@ -83,11 +83,11 @@ public class TaskStatQueryServiceDTO {
|
||||||
this.routeIdList = routeIdList;
|
this.routeIdList = routeIdList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUavId() {
|
public List<String> getUavIdList() {
|
||||||
return uavId;
|
return uavIdList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUavId(String uavId) {
|
public void setUavIdList(List<String> uavIdList) {
|
||||||
this.uavId = uavId;
|
this.uavIdList = uavIdList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,6 @@ public class TaskServiceImpl implements ITaskService {
|
||||||
@Override
|
@Override
|
||||||
public TaskStatByYearServiceDTO getTaskStatByYear(TaskStatQueryServiceDTO queryDTO) {
|
public TaskStatByYearServiceDTO getTaskStatByYear(TaskStatQueryServiceDTO queryDTO) {
|
||||||
Task task = new Task();
|
Task task = new Task();
|
||||||
task.setUavId(queryDTO.getUavId());
|
|
||||||
task.setTaskCategory(queryDTO.getTaskCategory());
|
task.setTaskCategory(queryDTO.getTaskCategory());
|
||||||
task.setTaskType(queryDTO.getTaskType());
|
task.setTaskType(queryDTO.getTaskType());
|
||||||
|
|
||||||
|
|
@ -217,6 +216,12 @@ public class TaskServiceImpl implements ITaskService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果指定了无人机ID列表,则过滤无人机
|
||||||
|
if (queryDTO.getUavIdList() != null && !queryDTO.getUavIdList().isEmpty()
|
||||||
|
&& !queryDTO.getUavIdList().contains(t.getUavId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
calendar.setTime(t.getStartTime());
|
calendar.setTime(t.getStartTime());
|
||||||
int year = calendar.get(Calendar.YEAR);
|
int year = calendar.get(Calendar.YEAR);
|
||||||
if (year == queryDTO.getYear()) {
|
if (year == queryDTO.getYear()) {
|
||||||
|
|
@ -236,7 +241,6 @@ public class TaskServiceImpl implements ITaskService {
|
||||||
@Override
|
@Override
|
||||||
public TaskStatByMonthServiceDTO getTaskStatByMonth(TaskStatQueryServiceDTO queryDTO) {
|
public TaskStatByMonthServiceDTO getTaskStatByMonth(TaskStatQueryServiceDTO queryDTO) {
|
||||||
Task task = new Task();
|
Task task = new Task();
|
||||||
task.setUavId(queryDTO.getUavId());
|
|
||||||
task.setTaskCategory(queryDTO.getTaskCategory());
|
task.setTaskCategory(queryDTO.getTaskCategory());
|
||||||
task.setTaskType(queryDTO.getTaskType());
|
task.setTaskType(queryDTO.getTaskType());
|
||||||
|
|
||||||
|
|
@ -260,6 +264,12 @@ public class TaskServiceImpl implements ITaskService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果指定了无人机ID列表,则过滤无人机
|
||||||
|
if (queryDTO.getUavIdList() != null && !queryDTO.getUavIdList().isEmpty()
|
||||||
|
&& !queryDTO.getUavIdList().contains(t.getUavId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
calendar.setTime(t.getStartTime());
|
calendar.setTime(t.getStartTime());
|
||||||
int year = calendar.get(Calendar.YEAR);
|
int year = calendar.get(Calendar.YEAR);
|
||||||
int month = calendar.get(Calendar.MONTH) + 1;
|
int month = calendar.get(Calendar.MONTH) + 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue