From ae816ce7f3f9b26a94b2a585280ecade6a1e2daf Mon Sep 17 00:00:00 2001 From: lgh Date: Sun, 17 Jul 2022 17:55:19 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=85=88?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E8=BD=A6=E8=BE=86=E5=9C=A8=E7=BA=BF=E6=83=85?= =?UTF-8?q?=E5=86=B5=E5=86=8D=E4=BF=AE=E6=94=B9=E7=BC=93=E5=AD=98=E5=8C=BA?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mt/wms/empty/task/RunTaskUtils.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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);