| | |
| | | package com.zy.asrs.wcs.core.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.wcs.core.domain.dto.BasLiftLevOffsetDto; |
| | | import com.zy.asrs.wcs.core.entity.BasLift; |
| | | import com.zy.asrs.wcs.core.entity.ShuttleStandby; |
| | | import com.zy.asrs.wcs.core.model.NavigateNode; |
| | |
| | | return liftLocNo; |
| | | } |
| | | |
| | | /** |
| | | * 获取换层需要锁定的路径 |
| | | */ |
| | | public List<String> getLockPathByLocNo(LiftThread liftThread, Integer lev) { |
| | | Device device = liftThread.getDevice(); |
| | | ShuttleStandby standby = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>() |
| | | .eq(ShuttleStandby::getDeviceId, device.getId()) |
| | | .eq(ShuttleStandby::getDeviceLev, lev) |
| | | .eq(ShuttleStandby::getStatus, 1)); |
| | | if (standby == null) { |
| | | return null; |
| | | } |
| | | |
| | | return standby.getLockPath$(); |
| | | } |
| | | |
| | | public Integer getLiftLevOffset(Integer deviceId,Integer lev) { |
| | | BasLift basLift = basLiftService.getOne(new LambdaQueryWrapper<BasLift>().eq(BasLift::getDeviceId, deviceId)); |
| | | if (basLift != null) { |
| | | if(Cools.isEmpty(basLift.getLevOffset())) { |
| | | return lev; |
| | | } |
| | | List<BasLiftLevOffsetDto> levOffsetDtos = JSON.parseArray(basLift.getLevOffset(), BasLiftLevOffsetDto.class); |
| | | for (BasLiftLevOffsetDto offsetDto : levOffsetDtos) { |
| | | if(lev == offsetDto.getLogicLev()){ |
| | | return offsetDto.getRealLev(); |
| | | } |
| | | } |
| | | } |
| | | return lev; |
| | | } |
| | | |
| | | } |