| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.wcs.common.ExecuteSupport; |
| | | import com.zy.asrs.wcs.core.entity.BasShuttle; |
| | | import com.zy.asrs.wcs.core.entity.Loc; |
| | | import com.zy.asrs.wcs.core.entity.Task; |
| | |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleCommand; |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleRedisCommand; |
| | | import com.zy.asrs.wcs.core.model.enums.ShuttleCommandModeType; |
| | | import com.zy.asrs.wcs.core.model.enums.ShuttleTaskModeType; |
| | | import com.zy.asrs.wcs.core.service.BasShuttleService; |
| | | import com.zy.asrs.wcs.core.service.LocService; |
| | | import com.zy.asrs.wcs.core.utils.NavigateMapUtils; |
| | |
| | | redisCommand.setAssignCommand(assignCommand);//命令 |
| | | //任务数据保存到redis |
| | | if (redisUtil.set(DeviceRedisConstant.SHUTTLE_WORK_FLAG + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand))) { |
| | | //下发行驶路径 |
| | | boolean result = shuttleThread.movePath(assignCommand.getNodes(), assignCommand.getTaskNo().intValue()); |
| | | if (!result) { |
| | | return false; |
| | | if (assignCommand.getTaskMode() == ShuttleTaskModeType.PAK_IN.id |
| | | || assignCommand.getTaskMode() == ShuttleTaskModeType.PAK_OUT.id |
| | | || assignCommand.getTaskMode() == ShuttleTaskModeType.MOVE_LOC_NO.id |
| | | || assignCommand.getTaskMode() == ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO.id) { |
| | | //下发行驶路径 |
| | | boolean result = shuttleThread.movePath(assignCommand.getNodes(), assignCommand.getTaskNo()); |
| | | if (!result) { |
| | | return false; |
| | | } |
| | | } |
| | | shuttleProtocol.setTaskNo(assignCommand.getTaskNo().intValue()); |
| | | shuttleProtocol.setTaskNo(assignCommand.getTaskNo()); |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | } |
| | | |
| | | //判断设备是否空闲 |
| | | if (!shuttleThread.isIdle()) { |
| | | if (!shuttleThread.isIdle(() -> { |
| | | return shuttleProtocol.getTaskNo().equals(taskNo); |
| | | })) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | //小车空闲且有跑库程序 |
| | | if (!(shuttleThread.isIdle() && shuttleProtocol.getMoveLoc())) { |
| | | //小车开启跑库模式 |
| | | if (!shuttleProtocol.getMoveLoc()) { |
| | | return; |
| | | } |
| | | |
| | | //小车空闲 |
| | | if (!shuttleThread.isIdle()) { |
| | | return; |
| | | } |
| | | |