bug修改:先检查车辆在线情况再修改缓存区状态
This commit is contained in:
parent
8c735058a1
commit
ae816ce7f3
@ -154,18 +154,20 @@ public class RunTaskUtils {
|
||||
Location location = locationServiceBiz.list(new QueryWrapper<Location>()
|
||||
.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<PointInfo>().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<PointInfo>().eq(PointInfo.NOTE, location.getCode()));
|
||||
|
||||
//占用车辆
|
||||
VehicleInfo vehicleInfo = vehicleInfoServiceBiz.getById(vehicleId);
|
||||
vehicleInfo.setStatus(1);
|
||||
|
Loading…
Reference in New Issue
Block a user