| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.*; |
| | | |
| | | import com.zy.asrs.utils.Utils; |
| | |
| | | }else { |
| | | //已执行完成 |
| | | |
| | | // if (redisCommand.getLiftSecurityMk()) { |
| | | // //曾锁定过提升机,需要进行解锁 |
| | | // if (liftProtocol != null) { |
| | | // liftProtocol.setSecurityMk(false); |
| | | // } |
| | | // } |
| | | |
| | | // String locNo = shuttleProtocol.getLocNo() == null ? shuttleProtocol.getSourceLocNo() : shuttleProtocol.getLocNo(); |
| | | // if (locNo != null) { |
| | | // //解除锁定的库位路径 |
| | | // NavigateMapData navigateMapData = new NavigateMapData(Utils.getLev(locNo)); |
| | | // navigateMapData.writeNavigateNodeToRedisMap(redisCommand.getAssignCommand().getNodes(), false); |
| | | // } |
| | | |
| | | //删除redis |
| | | redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo()); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class); |
| | | //当前步序 |
| | | int commandStep = redisCommand.getCommandStep(); |
| | | |
| | | //检测是否存在提升机口的指令 |
| | | List<NyShuttleHttpCommand> commands = redisCommand.getAssignCommand().getCommands(); |
| | | if (commands.isEmpty()) { |
| | | return false; |
| | | } |
| | | NyShuttleHttpCommand command = commands.get(commandStep);//当前命令 |
| | | if (!command.getMsgType().equals("intoLift")) { |
| | | return true;//不是入提升机命令,直接放行 |
| | | } |
| | | |
| | | //获取起点(输送站点) |
| | | NyShuttleProtocol.NyShuttlePointClass start = JSON.parseObject(command.getRequest().getBody().get("start").toString(), NyShuttleProtocol.NyShuttlePointClass.class); |
| | | //将牛眼坐标转换成WCS库位号 |
| | | String startLocNo = NavigatePositionConvert.nyXyzToLocNo(start.getX(), start.getY(), start.getZ()); |
| | | |
| | | BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); |
| | | BasDevp basDevp = basDevpService.queryByLocNo(startLocNo); |
| | | if (basDevp == null) { |
| | | return false;//查不到站点,禁止下发 |
| | | } |
| | | |
| | | //拿到提升机线程 |
| | | LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, 1); |
| | | LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, basDevp.getLiftNo()); |
| | | if (liftThread == null) { |
| | | return false; |
| | | } |
| | |
| | | if (liftProtocol == null) { |
| | | return false; |
| | | } |
| | | |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class); |
| | | //当前步序 |
| | | int commandStep = redisCommand.getCommandStep(); |
| | | |
| | | //检测是否存在提升机口的指令 |
| | | List<NyShuttleHttpCommand> commands = redisCommand.getAssignCommand().getCommands(); |
| | | if (commands.size() == 0) { |
| | | if (!liftProtocol.isIdle()) { |
| | | return false; |
| | | } |
| | | |
| | | if (!commands.get(commandStep).getMsgType().equals("move")) { |
| | | return true;//不是行走命令,直接放行 |
| | | if (liftProtocol.getLev().intValue() == Utils.getLev(shuttleProtocol.getCurrentLocNo())) { |
| | | return true;//提升机达到小车楼层,放行 |
| | | } |
| | | |
| | | |
| | | return false;//默认不放行 |
| | | } |