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