#
zjj
2024-06-20 5a2ec88cf71194456a371efda15f3cab5f6225ae
#
1个文件已添加
24个文件已修改
732 ■■■■ 已修改文件
zy-asrs-flow/src/pages/deviceConfig/shuttleStandby/index.jsx 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/deviceManage/basLift/components/edit.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/deviceManage/basLift/index.jsx 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/LiftAction.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/OpenController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/domain/dto/BasLiftLevOffsetDto.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasLift.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/LiftCommandService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/MotionCtgType.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/ShuttleCommandModeType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/ShuttleTaskModeType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/LiftDispatcher.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/LiftThread.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayLiftThread.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/deviceConfig/shuttleStandby/index.jsx
@@ -172,60 +172,60 @@
                ]}
            />,
        },
        {
            title: '添加时间',
            dataIndex: 'createTime$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <DatetimeRangeFilter
                name='createTime'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '添加人员',
            dataIndex: 'createBy$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <LinkFilter
                name='createBy'
                major='user'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '修改时间',
            dataIndex: 'updateTime$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <DatetimeRangeFilter
                name='updateTime'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '修改人员',
            dataIndex: 'updateBy$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <LinkFilter
                name='updateBy'
                major='user'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        // {
        //     title: '添加时间',
        //     dataIndex: 'createTime$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <DatetimeRangeFilter
        //         name='createTime'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        // {
        //     title: '添加人员',
        //     dataIndex: 'createBy$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <LinkFilter
        //         name='createBy'
        //         major='user'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        // {
        //     title: '修改时间',
        //     dataIndex: 'updateTime$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <DatetimeRangeFilter
        //         name='updateTime'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        // {
        //     title: '修改人员',
        //     dataIndex: 'updateBy$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <LinkFilter
        //         name='updateBy'
        //         major='user'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        {
            title: '备注',
            dataIndex: 'memo',
@@ -241,7 +241,7 @@
        },
        {
            title: '设备号',
            dataIndex: 'deviceId$',
            dataIndex: 'deviceId',
            valueType: 'text',
            hidden: false,
            width: 140,
zy-asrs-flow/src/pages/deviceManage/basLift/components/edit.jsx
@@ -166,6 +166,13 @@
                            ]}
                        />
                    </ProForm.Group>
                    <ProForm.Group>
                        <ProFormText
                            name="code"
                            label="提升机条码"
                            colProps={{ md: 12, xl: 12 }}
                        />
                    </ProForm.Group>
                </ProForm>
            </Modal>
zy-asrs-flow/src/pages/deviceManage/basLift/index.jsx
@@ -169,60 +169,60 @@
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '修改人员',
            dataIndex: 'updateBy$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <LinkFilter
                name='updateBy'
                major='user'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '创建人员',
            dataIndex: 'createBy$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <LinkFilter
                name='createBy'
                major='user'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '创建时间',
            dataIndex: 'createTime$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <DatetimeRangeFilter
                name='createTime'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '修改时间',
            dataIndex: 'updateTime$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <DatetimeRangeFilter
                name='updateTime'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        // {
        //     title: '修改人员',
        //     dataIndex: 'updateBy$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <LinkFilter
        //         name='updateBy'
        //         major='user'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        // {
        //     title: '创建人员',
        //     dataIndex: 'createBy$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <LinkFilter
        //         name='createBy'
        //         major='user'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        // {
        //     title: '创建时间',
        //     dataIndex: 'createTime$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <DatetimeRangeFilter
        //         name='createTime'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        // {
        //     title: '修改时间',
        //     dataIndex: 'updateTime$',
        //     valueType: 'text',
        //     hidden: false,
        //     width: 140,
        //     filterDropdown: (props) => <DatetimeRangeFilter
        //         name='updateTime'
        //         {...props}
        //         actionRef={actionRef}
        //         setSearchParam={setSearchParam}
        //     />,
        // },
        {
            title: '备注',
            dataIndex: 'memo',
@@ -255,6 +255,7 @@
            valueType: 'text',
            hidden: false,
            width: 140,
            ellipsis: true,
            filterDropdown: (props) => <TextFilter
                name='protocol'
                {...props}
@@ -279,6 +280,19 @@
                ]}
            />,
        },
        {
            title: '提升机条码',
            dataIndex: 'code',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='code'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '操作',
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/LiftAction.java
@@ -101,6 +101,12 @@
            } else if (command.getMode() == LiftCommandModeType.RESET.id) {
                //复位
                command.setComplete(true);
            } else if (command.getMode() == LiftCommandModeType.LOCK.id) {
                //复位
                command.setComplete(true);
            } else if (command.getMode() == LiftCommandModeType.UNLOCK.id) {
                //复位
                command.setComplete(true);
            }
            // 更新redis数据
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java
@@ -641,6 +641,8 @@
            result = shuttleThread.charge(command);
        } else if (command.getMode() == ShuttleCommandModeType.RESET.id) {//复位
            result = shuttleThread.reset(command);
        } else if (command.getMode() == ShuttleCommandModeType.UPDATE_LOCATION.id) {//更新坐标
            result = shuttleThread.updateLocation(command);
        }
        return result;
    }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/OpenController.java
@@ -321,9 +321,9 @@
        if (shuttleProtocol == null) {
            return R.error("穿梭车不在线");
        }
        if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) != Utils.getLev(param.getDestLoc())) {
            return R.error("穿梭车和目标位置不在同一楼层");
        }
//        if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) != Utils.getLev(param.getDestLoc())) {
//            return R.error("穿梭车和目标位置不在同一楼层");
//        }
        Task one = taskService.getOne(new LambdaQueryWrapper<Task>()
                .eq(Task::getTaskCtg, taskCtg.getId())
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/domain/dto/BasLiftLevOffsetDto.java
New file
@@ -0,0 +1,14 @@
package com.zy.asrs.wcs.core.domain.dto;
import lombok.Data;
@Data
public class BasLiftLevOffsetDto {
    //逻辑层
    private Integer logicLev;
    //实际层
    private Integer realLev;
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasLift.java
@@ -142,6 +142,18 @@
    @ApiModelProperty(value= "站点列表")
    private String sta;
    /**
     * 站点列表
     */
    @ApiModelProperty(value= "提升机楼层偏移量")
    private String levOffset;
    /**
     * 提升机条码
     */
    @ApiModelProperty(value= "提升机条码")
    private String code;
    public BasLift() {}
    public BasLift(Long deviceId, Integer liftNo, Integer status, Integer taskNo, Long updateBy, Long createBy, Date createTime, Date updateTime, String memo, Integer pakMk, Integer deleted, Long hostId, String protocol, Integer transfer, Integer row, Integer bay, String sta) {
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
@@ -899,7 +899,15 @@
                    }))
            ));
            // 穿梭车提升机待机位至提升机库位
            // 锁定提升机
            motionList.addAll(kernelService.liftLock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(transferLiftDevice.getId().intValue());
                    }))
            ));
            // 穿梭车提升机待机位至提升机
            motionList.addAll(kernelService.shuttleMove(
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -913,6 +921,14 @@
                    MotionCtgType.SHUTTLE_MOVE_TO_LIFT
            ));
            // 解锁提升机
            motionList.addAll(kernelService.liftUnlock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(transferLiftDevice.getId().intValue());
                    }))
            ));
            // 提升机搬车 至 充电层
            motionList.addAll(kernelService.liftMoveShuttle(
                    MotionDto.build((dto -> {
@@ -922,6 +938,23 @@
                    MotionDto.build((dto -> {
                        dto.setLiftNo(transferLiftDevice.getId().intValue());
                        dto.setLev(Utils.getLev(chargeLocNo));
                    }))
            ));
            // 锁定提升机
            motionList.addAll(kernelService.liftLock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(transferLiftDevice.getId().intValue());
                    }))
            ));
            // 更新小车坐标
            motionList.addAll(kernelService.shuttleUpdateLocation(
                    null
                    , MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setLocNo(liftLocNoFrom);
                    }))
            ));
@@ -937,6 +970,14 @@
                        dto.setLocNo(standbyLocNoFrom);
                    })),
                    MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
            ));
            // 解锁提升机
            motionList.addAll(kernelService.liftUnlock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(transferLiftDevice.getId().intValue());
                    }))
            ));
            // 穿梭车提升机待机位至充电位
@@ -1113,7 +1154,15 @@
                    }))
            ));
            // 穿梭车待机位至提升机库位
            // 锁定提升机
            motionList.addAll(kernelService.liftLock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(liftDevice.getId().intValue());
                    }))
            ));
            // 穿梭车待机位至提升机
            motionList.addAll(kernelService.shuttleMove(
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -1127,6 +1176,14 @@
                    MotionCtgType.SHUTTLE_MOVE_TO_LIFT
            ));
            // 解锁提升机
            motionList.addAll(kernelService.liftUnlock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(liftDevice.getId().intValue());
                    }))
            ));
            // 提升机搬车 至 目标位置层
            motionList.addAll(kernelService.liftMoveShuttle(
                    MotionDto.build((dto -> {
@@ -1136,6 +1193,23 @@
                    MotionDto.build((dto -> {
                        dto.setLiftNo(liftDevice.getId().intValue());
                        dto.setLev(Utils.getLev(locNo));
                    }))
            ));
            // 锁定提升机
            motionList.addAll(kernelService.liftLock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(liftDevice.getId().intValue());
                    }))
            ));
            // 更新小车坐标
            motionList.addAll(kernelService.shuttleUpdateLocation(
                    null
                    , MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setLocNo(liftLocNoFrom);
                    }))
            ));
@@ -1153,6 +1227,14 @@
                    MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
            ));
            // 解锁提升机
            motionList.addAll(kernelService.liftUnlock(
                    null
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(liftDevice.getId().intValue());
                    }))
            ));
            // 穿梭车提升机待机位至目标位置
            motionList.addAll(kernelService.shuttleMove(
                    MotionDto.build((dto -> {
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
@@ -5,6 +5,7 @@
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.entity.Motion;
import com.zy.asrs.wcs.core.service.MotionService;
import com.zy.asrs.wcs.core.utils.LiftDispatcher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -19,7 +20,8 @@
    @Autowired
    private MotionService motionService;
    @Autowired
    private LiftDispatcher liftDispatcher;
    // agv -----------------------------------------------------------------------------
    @Deprecated
@@ -50,9 +52,9 @@
            motion.setMotionCtg(MotionCtgType.LIFT_MOVE.val());
            if (null != origin) {
                motion.setOrigin(String.valueOf(origin.getLev()));
                motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
            }
            motion.setTarget(String.valueOf(target.getLev()));
            motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
        }));
//        if (target.getUpdateLiftNo() != null && target.getWrkNo() != null) {
@@ -77,10 +79,10 @@
            motion.setMotionCtg(MotionCtgType.LIFT_WITH_GOODS.val());
            if (null != origin) {
                motion.setOrigin(String.valueOf(origin.getLev()));
                motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
                motion.setOriDrt(origin.getStaNo());//源站
            }
            motion.setTarget(String.valueOf(target.getLev()));
            motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
            motion.setTarDrt(target.getStaNo());//目标站
        }));
@@ -100,9 +102,9 @@
            motion.setMotionCtg(MotionCtgType.LIFT_WITH_SHUTTLE.val());
            if (null != origin) {
                motion.setOrigin(String.valueOf(origin.getLev()));
                motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
            }
            motion.setTarget(String.valueOf(target.getLev()));
            motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
        }));
        return motionList;
@@ -121,9 +123,9 @@
            motion.setMotionCtg(MotionCtgType.LIFT_WITH_GOODS_AND_SHUTTLE.val());
            if (null != origin) {
                motion.setOrigin(String.valueOf(origin.getLev()));
                motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
            }
            motion.setTarget(String.valueOf(target.getLev()));
            motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
        }));
        return motionList;
@@ -141,7 +143,7 @@
            motion.setMotionCtg(MotionCtgType.LIFT_TRANSPORT_TO_CONVEYOR.val());
            motion.setOrigin(String.valueOf(origin.getLev()));
            motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(origin.getLiftNo(), origin.getLev())));
            motion.setDockNo(String.valueOf(target.getDevpNo()));
            motion.setTarget(String.valueOf(target.getStaNo()));
@@ -150,10 +152,56 @@
        return motionList;
    }
    /**
     * 提升机锁定
     */
    public List<Motion> liftLock(MotionDto origin, MotionDto target) {
        List<Motion> motionList = new ArrayList<>();
        motionList.add(Motion.build(motion -> {
            motion.setDeviceCtg(DeviceCtgType.LIFT.val());
            motion.setDevice(String.valueOf(target.getLiftNo()));
            motion.setMotionCtg(MotionCtgType.LIFT_LOCK.val());
        }));
        return motionList;
    }
    /**
     * 提升机解锁
     */
    public List<Motion> liftUnlock(MotionDto origin, MotionDto target) {
        List<Motion> motionList = new ArrayList<>();
        motionList.add(Motion.build(motion -> {
            motion.setDeviceCtg(DeviceCtgType.LIFT.val());
            motion.setDevice(String.valueOf(target.getLiftNo()));
            motion.setMotionCtg(MotionCtgType.LIFT_UNLOCK.val());
        }));
        return motionList;
    }
    // shuttle -----------------------------------------------------------------------------
    /**
     * 小车坐标更新
     */
    public List<Motion> shuttleUpdateLocation(MotionDto origin, MotionDto target) {
        List<Motion> motionList = new ArrayList<>();
        motionList.add(Motion.build(motion -> {
            motion.setDeviceCtg(DeviceCtgType.SHUTTLE.val());
            motion.setDevice(String.valueOf(target.getShuttleNo()));
            motion.setMotionCtg(MotionCtgType.SHUTTLE_UPDATE_LOCATION.val());
            motion.setTarget(target.getLocNo());
        }));
        return motionList;
    }
    /**
     * 穿梭车空载移动
     */
    public List<Motion> shuttleMove(MotionDto origin, MotionDto target, MotionCtgType motionCtgType) {
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/LiftCommandService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.wcs.core.action.LiftAction;
import com.zy.asrs.wcs.core.entity.Motion;
import com.zy.asrs.wcs.core.entity.Task;
import com.zy.asrs.wcs.core.model.command.LiftAssignCommand;
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
@@ -21,6 +22,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -59,6 +61,16 @@
                .eq(Motion::getDeviceCtg, DeviceCtgType.LIFT.val())
                .eq(Motion::getDevice, motion.getDevice())
                .eq(Motion::getMotionSts, MotionStsType.EXECUTING.val())) > 0) {
            return false;
        }
        Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskNo, motion.getTaskNo()));
        if (task == null) {
            return false;
        }
        task.setLiftNo(liftProtocol.getLiftNo());
        task.setUpdateTime(new Date());
        if (!taskService.updateById(task)) {
            return false;
        }
@@ -108,6 +120,16 @@
//                return liftThread.assignWork(command);
            case LIFT_TRANSPORT_TO_CONVEYOR:
                return false;
            case LIFT_LOCK:
                //锁定提升机
                command = liftThread.getLockCommand(motion.getTaskNo(), true);//获取提升机锁定命令
                list.addAll(command);
                return liftAction.assignWork(liftThread.getDevice(), assignCommand);
            case LIFT_UNLOCK:
                //锁定提升机
                command = liftThread.getLockCommand(motion.getTaskNo(), false);//获取提升机解定命令
                list.addAll(command);
                return liftAction.assignWork(liftThread.getDevice(), assignCommand);
            default:
                break;
@@ -191,6 +213,16 @@
            case LIFT_TRANSPORT_TO_CONVEYOR:
                break;
            case LIFT_LOCK:
                if (!liftThread.isLock(null)) {
                    return false;
                }
                break;
            case LIFT_UNLOCK:
                if (liftThread.isLock(null)) {
                    return false;
                }
                break;
            default:
                return false;
        }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -61,6 +61,8 @@
    private ShuttleAction shuttleAction;
    @Autowired
    private LiftAction liftAction;
    @Autowired
    private LiftDispatcher liftDispatcher;
    // 计算
    public Boolean accept(Motion motion) {
@@ -141,11 +143,11 @@
                }
                // 判断提升机是否空闲
                if (!liftThread.isIdle()) {
                if (!liftThread.isIdle(MotionCtgType.SHUTTLE_MOVE_FROM_LIFT)) {
                    return false;
                }
                if (liftProtocol.getLev() != Utils.getLev(motion.getTarget())) {//判断提升机是否达到目标层
                if (liftProtocol.getLev() != liftDispatcher.getLiftLevOffset(liftThread.getDevice().getId().intValue(), Utils.getLev(motion.getTarget()))) {//判断提升机是否达到目标层
                    return false;
                }
@@ -156,24 +158,13 @@
                        return true;
                    }
                })) {
                    //锁定提升机
                    List<LiftCommand> lockCommand = liftThread.getLockCommand(motion.getTaskNo(), true);//获取提升机锁定命令
                    LiftAssignCommand liftAssignCommand = new LiftAssignCommand();
                    liftAssignCommand.setLiftNo(liftThread.getStatus().getLiftNo());
                    liftAssignCommand.setTaskNo(motion.getTaskNo());
                    ArrayList<LiftCommand> list = new ArrayList<>();
                    list.addAll(lockCommand);
                    liftAssignCommand.setCommands(list);
                    liftAction.assignWork(liftThread.getDevice(), liftAssignCommand);
                    return false;//等待下一次轮询
                }
                //判断提升机工作号是否和当前任务相同
                if (liftProtocol.getTaskNo().intValue() != motion.getTaskNo()) {
                    return false;
                }
//                //判断提升机工作号是否和当前任务相同
//                if (liftProtocol.getTaskNo().intValue() != motion.getTaskNo()) {
//                    return false;
//                }
                shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
                shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
@@ -189,11 +180,11 @@
                    return false;
                }
                // 判断提升机是否空闲
                if (!liftThread.isIdle()) {
                if (!liftThread.isIdle(MotionCtgType.SHUTTLE_MOVE_TO_LIFT)) {
                    return false;
                }
                if (liftProtocol.getLev() != Utils.getLev(motion.getTarget())) {//判断提升机是否达到目标层
                if (liftProtocol.getLev() != liftDispatcher.getLiftLevOffset(liftThread.getDevice().getId().intValue(), Utils.getLev(motion.getTarget()))) {//判断提升机是否达到目标层
                    return false;
                }
@@ -204,27 +195,13 @@
                        return true;
                    }
                })) {
                    //锁定提升机
                    List<LiftCommand> lockCommand = liftThread.getLockCommand(motion.getTaskNo(), true);//获取提升机锁定命令
                    if (lockCommand == null) {
                        return false;
                    }
                    LiftAssignCommand liftAssignCommand = new LiftAssignCommand();
                    liftAssignCommand.setLiftNo(liftThread.getStatus().getLiftNo());
                    liftAssignCommand.setTaskNo(motion.getTaskNo());
                    ArrayList<LiftCommand> list = new ArrayList<>();
                    list.addAll(lockCommand);
                    liftAssignCommand.setCommands(list);
                    liftAction.assignWork(liftThread.getDevice(), liftAssignCommand);
                    return false;//等待下一次轮询
                }
                //判断提升机工作号是否和当前任务相同
                if (liftProtocol.getTaskNo().intValue() != motion.getTaskNo()) {
                    return false;
                }
//                //判断提升机工作号是否和当前任务相同
//                if (liftProtocol.getTaskNo().intValue() != motion.getTaskNo()) {
//                    return false;
//                }
                shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
                shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
@@ -246,6 +223,10 @@
            case SHUTTLE_PALLET_DOWN://托盘下降
                shuttleTaskModeType = ShuttleTaskModeType.PALLET_DOWN;
                shuttleCommands.add(shuttleThread.getLiftCommand(motion.getTaskNo(), false));
                break;
            case SHUTTLE_UPDATE_LOCATION://小车坐标更新
                shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_UPDATE_LOCATION;
                shuttleCommands.add(shuttleThread.getUpdateLocationCommand(motion.getTaskNo(), motion.getTarget()));
                break;
            default:
                throw new CoolException(motion.getMotionCtgEl() + "没有指定任务作业流程!!!");
@@ -363,6 +344,7 @@
                            list.addAll(signalCommand);
                            liftAssignCommand.setCommands(list);
                            liftAction.assignWork(liftThread.getDevice(), liftAssignCommand);
                            redisUtil.set(DeviceRedisConstant.COMMAND_TMP + motion.getTaskNo(), true, 120);
                            return false;
                        }
                    }
@@ -483,6 +465,8 @@
                    liftThread.setSyncTaskNo(0);
                }
                break;
            case SHUTTLE_UPDATE_LOCATION://小车坐标更新
                break;
            default:
                break;
        }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/MotionCtgType.java
@@ -22,14 +22,13 @@
    // 提升机 --------------------------------------------
    LIFT_MOVE(LIFT),
    LIFT_WITH_GOODS(LIFT),
    LIFT_WITH_SHUTTLE(LIFT),
    LIFT_WITH_GOODS_AND_SHUTTLE(LIFT),
    LIFT_TRANSPORT_TO_CONVEYOR(LIFT),
    LIFT_MISSION_COMPLETE(LIFT),
    LIFT_LOCK(LIFT),
    LIFT_UNLOCK(LIFT),
    // 穿梭车 --------------------------------------------
    SHUTTLE_MOVE(SHUTTLE),
@@ -54,6 +53,8 @@
    SHUTTLE_PALLET_LIFT(SHUTTLE),//托盘顶升
    SHUTTLE_PALLET_DOWN(SHUTTLE),//托盘下降
    SHUTTLE_UPDATE_LOCATION(SHUTTLE),//小车坐标更新
    // AGV ----------------------------------------------
    AGV_TRANSPORT(AGV),
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/ShuttleCommandModeType.java
@@ -14,6 +14,7 @@
    PALLET_LIFT(6, "托盘顶升"),
    PALLET_DOWN(7, "托盘下降"),
    RESET(8, "复位"),
    UPDATE_LOCATION(9, "更新坐标"),
    ;
    public Integer id;
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/ShuttleTaskModeType.java
@@ -26,6 +26,7 @@
    SHUTTLE_CONTROL(21, "小车管制"),
    SHUTTLE_CANCEL_CONTROL(22, "小车取消管制"),
    MOVE_LOC_NO_WRK_MAST(23, "移动到目标库位(生成移动任务)"),
    SHUTTLE_UPDATE_LOCATION(24, "小车坐标更新"),
    ;
    public Integer id;
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -443,7 +443,7 @@
            if (motionList.isEmpty()) {
                continue;
            }
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()));
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), task.getHostId());
            // 更新工作主档
            task.setTaskSts(TaskStsType.ANALYZE_INBOUND.sts); // 工作状态
@@ -516,7 +516,7 @@
                    log.error("出库 ===>> 暂时没有空闲小车, 任务号={}", task.getTaskNo());
                    continue;
                }
                motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()));
                motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), task.getHostId());
                // 更新工作主档
                task.setTaskSts(TaskStsType.ANALYZE_OUTBOUND.sts); // 工作状态
@@ -550,11 +550,11 @@
            }
            // generate motion list
            List<Motion> motionList = analyzeService.generateMotion(task);
            List<Motion> motionList = analyzeService.generateShuttleMoveMotion(task);
            if (motionList.isEmpty()) {
                continue;
            }
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()));
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), task.getHostId());
            // 更新工作主档
            task.setTaskSts(TaskStsType.ANALYZE_MOVE.sts); // 工作状态
@@ -697,7 +697,7 @@
                News.error("保存{}号四向穿梭车充电任务失败!!!", device.getDeviceNo());
                continue;
            }
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()));
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), task.getHostId());
            task.setTaskSts(TaskStsType.ANALYZE_CHARGE.sts);
            if (!taskService.save(task)) {
@@ -792,7 +792,7 @@
                News.error("保存{}号四向穿梭车迁移任务失败!!!", device.getDeviceNo());
                continue;
            }
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()));
            motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), task.getHostId());
            task.setTaskSts(TaskStsType.ANALYZE_MOVE.sts);
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/LiftDispatcher.java
@@ -1,6 +1,9 @@
package com.zy.asrs.wcs.core.utils;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.wcs.core.domain.dto.BasLiftLevOffsetDto;
import com.zy.asrs.wcs.core.entity.BasLift;
import com.zy.asrs.wcs.core.entity.ShuttleStandby;
import com.zy.asrs.wcs.core.model.NavigateNode;
@@ -122,4 +125,20 @@
        return liftLocNo;
    }
    public Integer getLiftLevOffset(Integer deviceId,Integer lev) {
        BasLift basLift = basLiftService.getOne(new LambdaQueryWrapper<BasLift>().eq(BasLift::getDeviceId, deviceId));
        if (basLift != null) {
            if(Cools.isEmpty(basLift.getLevOffset())) {
                return lev;
            }
            List<BasLiftLevOffsetDto> levOffsetDtos = JSON.parseArray(basLift.getLevOffset(), BasLiftLevOffsetDto.class);
            for (BasLiftLevOffsetDto offsetDto : levOffsetDtos) {
                if(lev == offsetDto.getLogicLev()){
                    return offsetDto.getRealLev();
                }
            }
        }
        return lev;
    }
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java
@@ -152,8 +152,8 @@
                }
            }
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
                //子轨和母轨、输送线、充电桩才能进行左右移动
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5 || map[x][y] == 67) {
                //子轨和母轨、输送线、充电桩、提升机才能进行左右移动
                if (is_valid(x, y + 1))
                {
                    NavigateNode node = new NavigateNode(x, y + 1);
@@ -180,8 +180,8 @@
                }
            }
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
                //子轨和母轨、输送线、充电桩才能进行上下移动
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5 || map[x][y] == 67) {
                //子轨和母轨、输送线、充电桩、提升机才能进行上下移动
                if (is_valid(x + 1, y))
                {
                    NavigateNode node = new NavigateNode(x + 1, y);
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java
@@ -3,16 +3,22 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wcs.core.entity.BasLift;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.service.BasLiftService;
import com.zy.asrs.wcs.core.service.LocService;
import com.zy.asrs.wcs.core.utils.RedisUtil;
import com.zy.asrs.wcs.core.utils.Utils;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
import com.zy.asrs.wcs.rcs.entity.BasShuttleErr;
import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.entity.ShuttleDeviceStatus;
import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
import com.zy.asrs.wcs.rcs.service.BasShuttleErrService;
import com.zy.asrs.wcs.rcs.service.ShuttleDeviceStatusService;
import com.zy.asrs.wcs.rcs.thread.LiftThread;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -257,7 +263,8 @@
    //通过当前二维码获取当前库位号
    public String getCurrentLocNo() {
        LocService locService = SpringUtils.getBean(LocService.class);
        if (locService == null) {
        BasLiftService basLiftService = SpringUtils.getBean(BasLiftService.class);
        if (locService == null || basLiftService == null) {
            return null;
        }
        if (this.currentCode == null) {
@@ -270,9 +277,17 @@
                .eq(Loc::getHostId, this.device.getHostId());
        Loc currentLoc = locService.getOne(wrapper);
        if (currentLoc == null) {
            //可能是提升机条码
            BasLift basLift = basLiftService.getOne(new LambdaQueryWrapper<BasLift>().eq(BasLift::getCode, this.currentCode).eq(BasLift::getStatus, 1));
            if(basLift != null) {
                LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, basLift.getDeviceId().intValue());
                if (liftThread != null) {
                    LiftProtocol liftProtocol = liftThread.getStatus();
                    return Utils.getLocNo(basLift.getRow(), basLift.getBay(), liftProtocol.getLev());
                }
            }
            return null;
        }
        return currentLoc.getLocNo();
    }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/LiftThread.java
@@ -4,6 +4,7 @@
import com.zy.asrs.wcs.core.entity.Motion;
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.LiftCommandModeType;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.model.enums.LiftProtocolStatusType;
import com.zy.asrs.wcs.rcs.model.protocol.LiftProtocol;
@@ -28,7 +29,7 @@
    boolean isIdle();//是否空闲
    boolean isIdle(ExecuteSupport support);//是否空闲
    boolean isIdle(MotionCtgType flag);//是否空闲
    boolean isDeviceIdle();//设备是否空闲
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
@@ -29,6 +29,8 @@
    boolean reset(ShuttleCommand command);//复位开关
    boolean updateLocation(ShuttleCommand param);//更新坐标
    boolean isIdle();
    boolean isIdle(ExecuteSupport support);//是否空闲
@@ -63,4 +65,6 @@
    ShuttleCommand getChargeCommand(Integer taskNo, Boolean charge);//充电开关命令 true=>开 false=>关
    ShuttleCommand getUpdateLocationCommand(Integer taskNo, String locNo);//获取更新坐标命令
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
@@ -14,6 +14,7 @@
import com.zy.asrs.wcs.core.entity.BasLift;
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.LiftCommandModeType;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.service.BasLiftService;
import com.zy.asrs.wcs.core.utils.RedisUtil;
import com.zy.asrs.wcs.core.utils.Utils;
@@ -306,14 +307,7 @@
    }
    @Override
    public boolean isIdle(ExecuteSupport support) {
        if (null != support) {
            Boolean judgement = support.judgement();
            if (judgement != null && !judgement) {
                return true;
            }
        }
    public boolean isIdle(MotionCtgType flag) {
        // 判断提升机是否自动、就绪、空闲
        if (this.liftProtocol.getModel()
                && !this.liftProtocol.getRun()
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -451,6 +451,11 @@
    }
    @Override
    public boolean updateLocation(ShuttleCommand param) {
        return true;//还没移植过来
    }
    @Override
    public boolean isIdle() {
        return this.isIdle(null);
    }
@@ -790,6 +795,11 @@
        return command;
    }
    @Override
    public ShuttleCommand getUpdateLocationCommand(Integer taskNo, String locNo) {
        return null;//还没移植过来
    }
    //获取小车复位响应命令
    public ShuttleCommand getInitCommand(Integer taskNo, Integer code) {
        LocService locService = SpringUtils.getBean(LocService.class);
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayLiftThread.java
@@ -12,6 +12,7 @@
import com.zy.asrs.wcs.core.entity.BasLift;
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.LiftCommandModeType;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.service.BasLiftService;
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.OutputQueue;
@@ -27,10 +28,7 @@
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.*;
@Slf4j
@SuppressWarnings("all")
@@ -101,7 +99,7 @@
                //有托盘
                liftProtocol.setHasTray(data.getString("haveCargo").equals("Y"));
                //有小车
                liftProtocol.setHasCar(data.getString("haveCar").equals("Y"));
                liftProtocol.setHasCar(data.getInteger("haveCar") == 1);
                //故障码
                liftProtocol.setErrorCode("0");
                //层
@@ -362,23 +360,50 @@
    }
    @Override
    public boolean isIdle(ExecuteSupport support) {
        if (null != support) {
            if (!support.judgement()) {
                return false;
    public boolean isIdle(MotionCtgType flag) {
        if (flag == null) {
            InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend();//获取扩展字段
            // 判断提升机是否自动、就绪、空闲、未锁定
            if (this.liftProtocol.getModel()
                    && !this.liftProtocol.getRun()
                    && this.liftProtocol.getPakMk()
                    && this.liftProtocol.getReady()
                    && this.liftProtocol.getErrorCode().equals("0")
                    && (this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.IDLE)
                    || this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.WAITING))
                    && !extend.getLock()
            ) {
                return true;
            }
            return false;
        }
        switch (Objects.requireNonNull(MotionCtgType.get(String.valueOf(flag)))){
            case SHUTTLE_MOVE_FROM_LIFT://穿梭车出提升机
            case SHUTTLE_MOVE_TO_LIFT://穿梭车进提升机
                return isIdleShuttleMoveToLift();
        }
        return false;
    }
    //穿梭车进提升机时-提升机状态判断
    private boolean isIdleShuttleMoveToLift() {
        InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend();//获取扩展字段
        // 判断提升机是否自动、就绪、空闲、未锁定
        // 判断提升机是否自动、就绪、空闲
        if (this.liftProtocol.getModel()
                && !this.liftProtocol.getRun()
                && this.liftProtocol.getPakMk()
                && this.liftProtocol.getReady()
                && this.liftProtocol.getErrorCode().equals("0")
                && (this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.IDLE)
                || this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.WAITING))
                && !extend.getLock()
        ) {
            if (!extend.getLock()) {
                //提升机未锁定,需要判断是否就绪
                if (!this.liftProtocol.getReady()) {
                    return false;
                }
            }
            return true;
        }
        return false;
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -11,14 +11,17 @@
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wcs.common.ExecuteSupport;
import com.zy.asrs.wcs.core.domain.param.ShuttleMoveLocParam;
import com.zy.asrs.wcs.core.entity.BasLift;
import com.zy.asrs.wcs.core.entity.BasShuttle;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.model.NavigateNode;
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.*;
import com.zy.asrs.wcs.core.service.BasLiftService;
import com.zy.asrs.wcs.core.service.BasShuttleService;
import com.zy.asrs.wcs.core.service.LocService;
import com.zy.asrs.wcs.core.utils.LiftDispatcher;
import com.zy.asrs.wcs.core.utils.NavigateUtils;
import com.zy.asrs.wcs.core.utils.Utils;
import com.zy.asrs.wcs.rcs.News;
@@ -433,6 +436,37 @@
    }
    @Override
    public boolean updateLocation(ShuttleCommand command) {
        try {
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
            }
            HashMap<String, Object> headers = new HashMap<>();
            headers.put("Authorization", "Bearer " + loginToken);
            String response = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/changeLocation")
                    .setHeaders(headers)
                    .setJson(command.getBody())
                    .setTimeout(60, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            Integer code = jsonObject.getInteger("code");
            if (code.equals(200)) {
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                return true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
    @Override
    public boolean isIdle() {
        return this.isIdle(null);
    }
@@ -674,6 +708,17 @@
        body.put("nodeY", loc.getBay());
        body.put("nodeZ", loc.getLev());
        //检测目标点是否为提升机
        BasLiftService basLiftService = SpringUtils.getBean(BasLiftService.class);
        BasLift basLift = basLiftService.getOne(new LambdaQueryWrapper<BasLift>().eq(BasLift::getRow, loc.getRow())
                .eq(BasLift::getBay, loc.getBay())
                .eq(BasLift::getHostId, this.device.getHostId()));
        if (basLift != null) {
            LiftDispatcher liftDispatcher = SpringUtils.getBean(LiftDispatcher.class);
            Integer realLev = liftDispatcher.getLiftLevOffset(basLift.getDeviceId().intValue(), loc.getLev());
            body.put("nodeZ", realLev);
        }
        ShuttleCommand command = new ShuttleCommand();
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(body));
@@ -714,6 +759,23 @@
        return command;
    }
    @Override
    public ShuttleCommand getUpdateLocationCommand(Integer taskNo, String locNo) {
        HashMap<String, Object> body = new HashMap<>();
        body.put("messageName", "runOrder");
        body.put("msgTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        body.put("deviceNo", Integer.parseInt(this.device.getDeviceNo()));
        String coord = "(" + Utils.getRow(locNo) + "," + Utils.getBay(locNo) + "," + Utils.getLev(locNo) + ")";
        body.put("coord", coord);
        ShuttleCommand command = new ShuttleCommand();
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(body));
        command.setMode(ShuttleCommandModeType.UPDATE_LOCATION.id);
        return command;
    }
    //***************设备层通讯-不同厂商设备通讯方案不一致***************
    //请求登录