| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wcs.core.domain.dto.MotionDto; |
| | | import com.zy.asrs.wcs.core.entity.ShuttleStandby; |
| | | import com.zy.asrs.wcs.core.entity.Task; |
| | |
| | | import com.zy.asrs.wcs.core.model.enums.WorkZoneType; |
| | | import com.zy.asrs.wcs.core.service.ShuttleStandbyService; |
| | | import com.zy.asrs.wcs.core.service.TaskService; |
| | | import com.zy.asrs.wcs.core.utils.ConveyorDispatcher; |
| | | import com.zy.asrs.wcs.core.utils.LiftDispatcher; |
| | | import com.zy.asrs.wcs.core.utils.ShuttleDispatcher; |
| | | import com.zy.asrs.wcs.core.utils.Utils; |
| | | import com.zy.asrs.wcs.rcs.cache.SlaveConnection; |
| | | import com.zy.asrs.wcs.core.entity.Motion; |
| | | import com.zy.asrs.wcs.rcs.entity.Device; |
| | | import com.zy.asrs.wcs.rcs.model.enums.LiftProtocolStatusType; |
| | | import com.zy.asrs.wcs.rcs.model.enums.SlaveType; |
| | | import com.zy.asrs.wcs.rcs.model.protocol.LiftProtocol; |
| | | import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol; |
| | |
| | | private ShuttleDispatcher shuttleDispatcher; |
| | | @Autowired |
| | | private LiftDispatcher liftDispatcher; |
| | | // @Autowired |
| | | // private ConveyorDispatcher conveyorDispatcher; |
| | | @Autowired |
| | | private ConveyorDispatcher conveyorDispatcher; |
| | | @Autowired |
| | | private DeviceService deviceService; |
| | | @Autowired |
| | |
| | | |
| | | public List<Motion> generateMotion(Task task) { |
| | | List<Motion> motionList = new ArrayList<>(); |
| | | switch (Objects.requireNonNull(WorkZoneType.query(task.getTaskSts() == TaskStsType.NEW_INBOUND.sts ? task.getOriginSite() : task.getDestSite()))) { |
| | | case FIRST_ZONE: |
| | | motionList = this.generateFirstZoneMotion(task); |
| | | break; |
| | | default: |
| | | } |
| | | // switch (Objects.requireNonNull(WorkZoneType.query(task.getTaskSts() == TaskStsType.NEW_INBOUND.sts ? task.getOriginSite() : task.getDestSite()))) { |
| | | // case FIRST_ZONE: |
| | | // motionList = this.generateFirstZoneMotion(task); |
| | | // break; |
| | | // default: |
| | | // } |
| | | motionList = this.generateFirstZoneMotion(task); |
| | | return motionList; |
| | | } |
| | | |
| | |
| | | return motionList; |
| | | } |
| | | |
| | | /** |
| | | * 生成提升机手动动作 |
| | | */ |
| | | public List<Motion> generateLiftManualMotion(Task task) { |
| | | List<Motion> motionList = new ArrayList<>(); |
| | | if (task.getTaskSts() != TaskStsType.NEW_MANUAL.sts) { |
| | | return motionList; |
| | | } |
| | | |
| | | Device device = deviceService.getOne(new LambdaQueryWrapper<Device>() |
| | | .eq(Device::getDeviceNo, task.getLiftNo()) |
| | | .eq(Device::getDeviceType, DeviceCtgType.LIFT.val()) |
| | | .eq(Device::getHostId, task.getHostId()) |
| | | .eq(Device::getStatus, 1)); |
| | | if (device == null) { |
| | | return motionList; |
| | | } |
| | | |
| | | if (task.getDestSite().equals("move")) { |
| | | //提升机升降楼层 |
| | | |
| | | // 提升机空载移动到穿梭车层 |
| | | motionList.addAll(kernelService.liftMove( |
| | | null |
| | | , MotionDto.build((dto -> { |
| | | dto.setLiftNo(device.getId().intValue()); |
| | | dto.setLev(Integer.parseInt(task.getDestLoc())); |
| | | })) |
| | | )); |
| | | |
| | | } else if (task.getDestSite().equals("movePallet")) { |
| | | //移动托盘 |
| | | |
| | | // 提升机移动托盘 |
| | | motionList.addAll(kernelService.liftMoveGoods( |
| | | MotionDto.build((dto -> { |
| | | dto.setLiftNo(device.getId().intValue()); |
| | | dto.setLev(Integer.parseInt(task.getOriginLoc())); |
| | | dto.setStaNo(Integer.parseInt(task.getOriginSite())); |
| | | })) |
| | | , MotionDto.build((dto -> { |
| | | dto.setLiftNo(device.getId().intValue()); |
| | | dto.setLev(Integer.parseInt(task.getDestLoc())); |
| | | dto.setStaNo(Integer.parseInt(task.getDestSite())); |
| | | })) |
| | | )); |
| | | |
| | | } |
| | | |
| | | return motionList; |
| | | } |
| | | |
| | | } |