rev:返回点校验

This commit is contained in:
2025-07-24 17:09:59 +08:00
parent 74c955d4c5
commit 7ea49920bc

View File

@@ -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 = "";