rev:返回点校验
This commit is contained in:
@@ -72,15 +72,22 @@ public class TaskManageServiceImpl implements TaskManageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Station> staList = whereJson.getJSONArray("data").toJavaList(Station.class);
|
List<Station> staList = whereJson.getJSONArray("data").toJavaList(Station.class);
|
||||||
// 取返回点
|
|
||||||
Station breakPoint = stationService.getOne(
|
// 判断前端参数是否有返回点
|
||||||
new QueryWrapper<Station>().lambda()
|
boolean move = staList.stream()
|
||||||
.eq(Station::getStation_type, "Breaks")
|
.anyMatch(row -> row.getAction_type().equals("Move"));
|
||||||
);
|
if (!move) {
|
||||||
if (ObjectUtil.isEmpty(breakPoint)) {
|
|
||||||
throw new BadRequestException("请先设置返回点!");
|
// 取返回点
|
||||||
|
Station breakPoint = stationService.getOne(
|
||||||
|
new QueryWrapper<Station>().lambda()
|
||||||
|
.eq(Station::getStation_type, "Breaks")
|
||||||
|
);
|
||||||
|
if (ObjectUtil.isEmpty(breakPoint)) {
|
||||||
|
throw new BadRequestException("请先设置返回点!");
|
||||||
|
}
|
||||||
|
staList.add(breakPoint);
|
||||||
}
|
}
|
||||||
staList.add(breakPoint);
|
|
||||||
|
|
||||||
// 任务id
|
// 任务id
|
||||||
String task_id = "";
|
String task_id = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user