#
Junjie
2024-05-05 dad3cd8ed8afa86b651bb1a053421e7aa2b8c7ac
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zy.asrs.framework.common.BaseRes;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.common.SnowflakeIdWorker;
@@ -27,7 +26,6 @@
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.entity.DeviceType;
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.DeviceService;
@@ -142,7 +140,7 @@
        Integer shuttleNo = param.getShuttleNo();
        //获取迁移任务类型
        //获取手动任务类型
        TaskCtg taskCtg = taskCtgService.getOne(new LambdaQueryWrapper<TaskCtg>()
                .eq(TaskCtg::getFlag, "MANUAL")
                .eq(TaskCtg::getStatus, 1));
@@ -160,6 +158,23 @@
            //取放货任务
            targetLoc = param.getTargetLocNo();
            sourceLoc = param.getSourceLocNo();
        } else if (param.getShuttleTaskMode().equals("reset")) {
            //复位
            Device device = deviceService.getOne(new LambdaQueryWrapper<Device>()
                    .eq(Device::getDeviceType, DeviceCtgType.SHUTTLE.val())
                    .eq(Device::getStatus, 1)
                    .eq(Device::getDeviceNo, shuttleNo));
            if (device == null) {
                return R.error("设备不存在");
            }
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getId().intValue());
            if (shuttleThread == null) {
                return R.error("设备离线");
            }
            shuttleThread.reset(null);
            return R.ok();
        }
        Task task = new Task();