diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java index 7732fce..81ca931 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java @@ -154,18 +154,20 @@ public class RunTaskUtils { Location location = locationServiceBiz.list(new QueryWrapper() .eq(Location.STATUS, 0) .eq(Location.VALID, 1)).get(0); - //更新 location 表对应库位状态为占用 - location.setStatus(1); - location.setUpdateTime(LocalDateTime.now()); - locationServiceBiz.updateById(location); - //通过库位code去point_info表中查出该库位对应的点 - PointInfo pointInfo = pointInfoServiceBiz.getOne(new QueryWrapper().eq(PointInfo.NOTE, location.getCode())); //计算出路径最短的车辆id,起点液压台,终点缓存区库位点 Long vehicleId = taskDistanceUtils.chooseVehicle(currTask.getStartPosition(), location.getCode()); if (vehicleId==0){ logger.info("两辆车都不在线,请检查后重试!"); return R.failed("两辆车都不在线,请检查后重试!"); } + + //更新 location 表对应库位状态为占用 + location.setStatus(1); + location.setUpdateTime(LocalDateTime.now()); + locationServiceBiz.updateById(location); + //通过库位code去point_info表中查出该库位对应的点 + PointInfo pointInfo = pointInfoServiceBiz.getOne(new QueryWrapper().eq(PointInfo.NOTE, location.getCode())); + //占用车辆 VehicleInfo vehicleInfo = vehicleInfoServiceBiz.getById(vehicleId); vehicleInfo.setStatus(1);