| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wcs.core.action.ShuttleAction; |
| | | import com.zy.asrs.wcs.core.entity.Loc; |
| | | import com.zy.asrs.wcs.core.model.NavigateNode; |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleAssignCommand; |
| | |
| | | import com.zy.asrs.wcs.core.utils.*; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.cache.SlaveConnection; |
| | | import com.zy.asrs.wcs.rcs.entity.Motion; |
| | | import com.zy.asrs.wcs.core.entity.Motion; |
| | | import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType; |
| | | import com.zy.asrs.wcs.rcs.model.enums.SlaveType; |
| | | import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol; |
| | | import com.zy.asrs.wcs.rcs.service.MotionService; |
| | | import com.zy.asrs.wcs.core.service.MotionService; |
| | | import com.zy.asrs.wcs.rcs.thread.ShuttleThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private LocService locService; |
| | | @Autowired |
| | | private NavigateMapUtils navigateMapUtils; |
| | | @Autowired |
| | | private ShuttleAction shuttleAction; |
| | | |
| | | // 计算 |
| | | public Boolean accept(Motion motion) { |
| | |
| | | } |
| | | |
| | | ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); |
| | | assignCommand.setShuttleNo(deviceNo.shortValue()); |
| | | assignCommand.setTaskNo(motion.getWrkNo().shortValue()); |
| | | assignCommand.setShuttleNo(deviceNo); |
| | | assignCommand.setTaskNo(motion.getWrkNo()); |
| | | assignCommand.setSourceLocNo(motion.getOrigin()); |
| | | assignCommand.setLocNo(motion.getTarget()); |
| | | |
| | |
| | | } |
| | | |
| | | assert null != shuttleTaskModeType; |
| | | assignCommand.setTaskMode(shuttleTaskModeType.id.shortValue());//入出库模式 |
| | | assignCommand.setTaskMode(shuttleTaskModeType.id);//入出库模式 |
| | | assignCommand.setCommands(shuttleCommands); |
| | | |
| | | if (motion.getOrigin() != null && motion.getTarget() != null) { |
| | | //所使用的路径进行锁定禁用 |
| | | boolean lockResult = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(motion.getTarget()), Integer.parseInt(shuttleProtocol.getShuttleNo()), assignCommand.getNodes(), true);//所使用的路径进行锁定禁用 |
| | | boolean lockResult = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(motion.getTarget()), shuttleProtocol.getShuttleNo(), assignCommand.getNodes(), true);//所使用的路径进行锁定禁用 |
| | | if (!lockResult) { |
| | | return false;//锁定失败 |
| | | } |
| | | // shuttleThread.assignWork(assignCommand); |
| | | }else { |
| | | // shuttleThread.assignWork(assignCommand); |
| | | } |
| | | |
| | | return Boolean.TRUE; |
| | | boolean result = shuttleAction.assignWork(shuttleThread.getDevice(), assignCommand); |
| | | return result; |
| | | } |
| | | |
| | | public Boolean finish(Motion motion) { |