#
Junjie
2024-03-27 9eccc25e5f8e764b18a84ad2d08171dd6fabb452
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
@@ -3,7 +3,6 @@
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.wcs.core.domain.dto.MotionDto;
import com.zy.asrs.wcs.core.entity.Task;
import com.zy.asrs.wcs.core.model.enums.LiftCodeType;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.model.enums.TaskStsType;
import com.zy.asrs.wcs.core.model.enums.WorkZoneType;
@@ -11,11 +10,11 @@
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.entity.Motion;
import com.zy.asrs.wcs.rcs.model.protocol.LiftProtocol;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.core.entity.Motion;
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.rcs.thread.LiftThread;
import com.zy.asrs.wcs.core.service.MotionService;
import com.zy.asrs.wcs.rcs.thread.ShuttleThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -70,18 +69,21 @@
         * 5.穿梭车入库至目标库位
         */
        if (task.getTaskSts() == TaskStsType.NEW_INBOUND.sts) {
            // lift
            LiftThread liftThread = liftDispatcher.queryLiftForTransport(task.getOriginSite());
            LiftProtocol liftProtocol = liftThread.getStatus();
            if (liftProtocol == null) {
                return motionList;
            }
//            // lift
//            LiftThread liftThread = liftDispatcher.queryLiftForTransport(task.getOriginSite());
//            LiftProtocol liftProtocol = liftThread.getStatus();
//            if (liftProtocol == null) {
//                return motionList;
//            }
            // shuttle
            ShuttleThread shuttleThread = shuttleDispatcher.queryShuttleWhichConvenient(task, Integer.parseInt(liftThread.getStatus().getLiftNo()));
//            ShuttleThread shuttleThread = shuttleDispatcher.queryShuttleWhichConvenient(task, Integer.parseInt(liftThread.getStatus().getLiftNo()));
//            ShuttleThread shuttleThread = shuttleDispatcher.queryShuttleWhichConvenient(task, 1);
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, 6);
            if (Cools.isEmpty(shuttleThread)) { return motionList; }
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            String shuttleLocNo = shuttleProtocol.getCurrentLocNo();
//            String shuttleLocNo = shuttleProtocol.getCurrentLocNo();
            String shuttleLocNo = "0100201";
//            // conveyor
//            DevpSlave devpSlave = conveyorDispatcher.queryByInBound(task.getSourceStaNo());
@@ -101,20 +103,20 @@
//                return motionList;
//            }
            //穿梭车到提升机库位号
            String liftLocNoTo = LiftCodeType.getLocNo(Integer.parseInt(liftNo), Utils.getLev(shuttleLocNo), task.getHostId());
            //穿梭车出提升机库位号
            String liftLocNoFrom = LiftCodeType.getLocNo(Integer.parseInt(liftNo), Utils.getLev(task.getDestLoc()), task.getHostId());
            //穿梭车到提升机待机位库位号
            String standbyLocNoTo = LiftCodeType.getStandbyLocNo(Integer.parseInt(liftNo), Utils.getLev(shuttleLocNo));
            //穿梭车出提升机待机位库位号
            String standbyLocNoFrom = LiftCodeType.getStandbyLocNo(Integer.parseInt(liftNo), Utils.getLev(task.getDestLoc()));
//            //穿梭车到提升机库位号
//            String liftLocNoTo = LiftCodeType.getLocNo(Integer.parseInt(liftNo), Utils.getLev(shuttleLocNo), task.getHostId());
//
//            //穿梭车出提升机库位号
//            String liftLocNoFrom = LiftCodeType.getLocNo(Integer.parseInt(liftNo), Utils.getLev(task.getDestLoc()), task.getHostId());
//
//            //穿梭车到提升机待机位库位号
//            String standbyLocNoTo = LiftCodeType.getStandbyLocNo(Integer.parseInt(liftNo), Utils.getLev(shuttleLocNo));
//
//            //穿梭车出提升机待机位库位号
//            String standbyLocNoFrom = LiftCodeType.getStandbyLocNo(Integer.parseInt(liftNo), Utils.getLev(task.getDestLoc()));
            // 入库目标层有穿梭车
            if (Utils.getLev(shuttleLocNo) == Utils.getLev(task.getOriginLoc())) {
            if (Utils.getLev(shuttleLocNo) == Utils.getLev(task.getDestLoc())) {
                // 穿梭车走行至库位
                motionList.addAll(kernelService.shuttleMove(
@@ -353,7 +355,7 @@
            }
            shuttleNo = String.valueOf(shuttleProtocol.getShuttleNo());
            liftNo = String.valueOf(liftProtocol.getLiftNo());
//            liftNo = String.valueOf(liftProtocol.getLiftNo());
        }
        /**