| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | public boolean shuttleOutExecuteStep1(WrkMast wrkMast) { |
| | | //21.生成出库任务 => 22.小车搬运中 |
| | | if (wrkMast.getWrkSts() == 21) { |
| | | //获取目标站对应的输送站点 |
| | | BasDevp targetBasDevp = basDevpService.selectByLevAndLiftNo(Utils.getLev(wrkMast.getSourceLocNo()), wrkMast.getLiftNo()); |
| | | if (targetBasDevp == null) { |
| | | return false;//缺少站点信息 |
| | | EntityWrapper<StaDesc> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("type_no", wrkMast.getIoType());//路径类型 |
| | | wrapper.eq("stn_no", wrkMast.getStaNo());//出库站点编号 |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (staDesc == null) { |
| | | return false;//出库路径不存在 |
| | | } |
| | | |
| | | if (targetBasDevp.getOutEnable().equals("N")) { |
| | | return false;//站点不可出 |
| | | //获取出库站点 |
| | | BasDevp basDevp = basDevpService.selectById(wrkMast.getStaNo()); |
| | | if (basDevp == null) { |
| | | return false;//出库站点不存在 |
| | | } |
| | | |
| | | if (!basDevp.getOutEnable().equals("Y")) { |
| | | return false;//出库站点不可出 |
| | | } |
| | | |
| | | //判断各楼层内部输送站点是否空闲无物 |
| | | LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, basDevp.getLiftNo()); |
| | | if (liftThread == null) { |
| | | return false; |
| | | } |
| | | //获取提升机站点list |
| | | List<LiftStaProtocol> liftStaProtocols = liftThread.getLiftStaProtocols(); |
| | | if (liftStaProtocols.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | for (LiftStaProtocol liftStaProtocol : liftStaProtocols) { |
| | | //判断当前出库任务对应楼层的提升机站点状态 |
| | | if (liftStaProtocol.getLev() == Utils.getLev(wrkMast.getSourceLocNo())) { |
| | | if (liftStaProtocol.getModel() && !liftStaProtocol.getBusy() && !liftStaProtocol.getHasTray()) { |
| | | return false;//站点必须自动、空闲、没有托盘 |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (wrkMast.getShuttleNo() == null) {//没有绑定小车,进行调度 |
| | | shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), wrkMast.getSourceLocNo());//调度小车到货物所在库位进行取货 |
| | |
| | | } |
| | | |
| | | //小车已抵达货物位置,进行搬运货物 |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getShuttleTransportCommands(wrkMast.getShuttleNo(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), wrkMast.getSourceLocNo(), targetBasDevp.getLocNo()); |
| | | NyShuttleOperaResult result = NyShuttleOperaUtils.getShuttleTransportCommands(wrkMast.getShuttleNo(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), wrkMast.getSourceLocNo(), null); |
| | | if (result == null) {//出库路径计算失败 |
| | | return false; |
| | | } |