自动化立体仓库 - WCS系统
4453cdecbc6e7a925ae76e3223418654f1cf0b18..c1c94f8f45e562bafc4dc4cd17171bae8e7f7b45
4 天以前 Junjie
#
c1c94f 对比 | 目录
4 天以前 Junjie
#
778176 对比 | 目录
4 天以前 Junjie
#
541096 对比 | 目录
4 天以前 Junjie
#
9c0fd1 对比 | 目录
4 天以前 Junjie
#
0b7a31 对比 | 目录
4 天以前 Junjie
#
d571e7 对比 | 目录
4 天以前 Junjie
#
3f0537 对比 | 目录
4 天以前 Junjie
#
e2cbfe 对比 | 目录
4个文件已添加
3个文件已修改
179 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/OpenController.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/param/QueryTaskParam.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/ShuttleOperaUtils.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/docs/四向车货叉式提升机WCS接口V1.3.docx 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/sql/20250423154227.nb3 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/sql/小车避障配置sql 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -8,14 +8,17 @@
import com.zy.asrs.domain.param.*;
import com.zy.asrs.entity.ApiLog;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.utils.NotifyUtils;
import com.zy.common.annotations.OpenApiLog;
import com.zy.common.service.CommonService;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.dispatcher.ShuttleDispatchUtils;
import com.zy.core.enums.SlaveType;
import com.zy.core.enums.WrkIoType;
import com.zy.core.model.ForkLiftSlave;
import com.zy.core.model.ShuttleSlave;
import com.zy.core.model.protocol.ForkLiftProtocol;
@@ -49,6 +52,8 @@
    private ApiLogService apiLogService;
    @Autowired
    private LocMastService locMastService;
    @Autowired
    private WrkMastService wrkMastService;
    @PostMapping("/createMoveTask")
    @OpenApiLog(memo = "小车移动任务")
@@ -337,8 +342,8 @@
        apiLogService.insert(new ApiLog(
                null
                , "获取指定库位信息"
                , "/getLocInformation"
                , "获取全部库位信息"
                , "/getAllLocInformation"
                , null
                , null
                , null
@@ -362,8 +367,8 @@
        apiLogService.insert(new ApiLog(
                null
                , "获取指定库位信息"
                , "/getLocInformation"
                , "小车集合"
                , "/shuttleGather"
                , null
                , null
                , null
@@ -380,6 +385,42 @@
        return R.ok().add(shuttleGather);
    }
    @PostMapping("/queryTask")
    @OpenApiLog(memo = "查询任务")
    public R queryTask(@RequestBody QueryTaskParam param) {
        EntityWrapper<WrkMast> wrapper = new EntityWrapper<>();
        if(param.getTaskNo() != null) {
            wrapper.eq("wms_wrk_no", param.getTaskNo());
        }
        if(param.getTaskType() != null) {
            WrkIoType ioType = WrkIoType.get(param.getTaskType());
            if(ioType == null) {
                return R.error("任务类型不存在");
            }
            wrapper.eq("io_type", ioType.id);
        }
        List<WrkMast> wrkMasts = wrkMastService.selectList(wrapper);
        apiLogService.insert(new ApiLog(
                null
                , "查询任务"
                , "/queryTask"
                , null
                , null
                , null
                , null
                , JSON.toJSONString(wrkMasts)
                , null
                , null
                , 1
                , new Date()
                , null
                , null
        ));
        return R.ok().add(wrkMasts);
    }
    @GetMapping("/test")
    public R test() {
        notifyUtils.notify("task", 1, "9999", "W9999", NotifyMsgType.SHUTTLE_MOVING, "data");
src/main/java/com/zy/asrs/domain/param/QueryTaskParam.java
New file
@@ -0,0 +1,14 @@
package com.zy.asrs.domain.param;
import lombok.Data;
@Data
public class QueryTaskParam {
    //任务类型
    private Integer taskType;
    //任务号
    private String taskNo;
}
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -179,14 +179,14 @@
                return false;
            }
//            //检测障碍物车
//            boolean checkObstacle = shuttleOperaUtils.checkObstacle(wrkMast.getLocNo(), new ArrayList<Integer>() {{
//                add(shuttleProtocol.getShuttleNo());
//            }});
//            if (checkObstacle) {
//                News.info("{}任务,避障范围有小车,等待障碍小车调离中", wrkMast.getWrkNo());
//                return false;
//            }
            //检测障碍物车
            boolean checkObstacle = shuttleOperaUtils.checkObstacle(wrkMast.getLocNo(), new ArrayList<Integer>() {{
                add(shuttleProtocol.getShuttleNo());
            }});
            if (checkObstacle) {
                News.info("{}任务,避障范围有小车,等待障碍小车调离中", wrkMast.getWrkNo());
                return false;
            }
            ShuttleAssignCommand assignCommand = new ShuttleAssignCommand();
            assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // å››å‘穿梭车编号
@@ -344,20 +344,20 @@
            //判断小车是否到达货物库位
            if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) {
                //检测障碍物车
                boolean checkObstacle = shuttleOperaUtils.checkObstacle(wrkMast.getSourceLocNo(), new ArrayList<Integer>() {{
                    add(shuttleProtocol.getShuttleNo());
                }});
                if (checkObstacle) {
                    News.info("{}任务,避障范围有小车,等待障碍小车调离中", wrkMast.getWrkNo());
                    return false;
                }
                //小车不在输送站点位置
                shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getShuttleNo());//调度小车到货物所在库位进行取货
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,未到达输送站点,系统等待中", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo());
                return false;
            }
//            //检测障碍物车
//            boolean checkObstacle = shuttleOperaUtils.checkObstacle(liftSta.getLocNo(), new ArrayList<Integer>() {{
//                add(shuttleProtocol.getShuttleNo());
//            }});
//            if (checkObstacle) {
//                News.info("{}任务,避障范围有小车,等待障碍小车调离中", wrkMast.getWrkNo());
//                return false;
//            }
            ShuttleAssignCommand assignCommand = new ShuttleAssignCommand();
            assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // å››å‘穿梭车编号
@@ -576,8 +576,8 @@
                return false;
            }
//            commands.add(0, liftCommand.get(0));
//            commands.add(liftCommand2.get(0));
            commands.add(0, liftCommand.get(0));
            commands.add(liftCommand2.get(0));
            assignCommand.setCommands(commands);
            wrkMast.setWrkSts(WrkStsType.LOC_MOVE_SHUTTLE_RUN.sts);//小车搬运中  501.生成移库任务 ==> 502.小车搬运中
@@ -1384,14 +1384,14 @@
                return false;
            }
//            //检测障碍物车
//            boolean checkObstacle = shuttleOperaUtils.checkObstacle(basShuttleCharge.getWaitLocNo(), new ArrayList<Integer>() {{
//                add(shuttleProtocol.getShuttleNo());
//            }});
//            if (checkObstacle) {
//                News.info("{}任务,避障范围有小车,等待障碍小车调离中", wrkMast.getWrkNo());
//                return false;
//            }
            //检测障碍物车
            boolean checkObstacle = shuttleOperaUtils.checkObstacle(basShuttleCharge.getWaitLocNo(), new ArrayList<Integer>() {{
                add(shuttleProtocol.getShuttleNo());
            }});
            if (checkObstacle) {
                News.info("{}任务,避障范围有小车,等待障碍小车调离中", wrkMast.getWrkNo());
                return false;
            }
            //调度小车去待机位
            boolean dispatched = shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), basShuttleCharge.getWaitLocNo(), wrkMast.getShuttleNo());
src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
@@ -260,13 +260,15 @@
                continue;
            }
            HashMap<String, Integer> carMap = findCarMap();
            String targetLocNo = null;
            for (NavigateNode node : outerNodes) {
                String dispatchLocNo = NavigatePositionConvert.nodeToLocNo(node);
                if (carMap.containsKey(dispatchLocNo)) {
                    continue;
                //获取内圈节点
                List<NavigateNode> avoidInnerNodes = getInnerNodes(dispatchLocNo, innerCircle, new ArrayList<>());
                //计算内圈是否有小车
                List<Integer> avoidNodesCar = findNodesCar(avoidInnerNodes);
                if(!avoidNodesCar.isEmpty()) {
                   continue;
                }
                targetLocNo = dispatchLocNo;
                break;
@@ -331,7 +333,7 @@
        for (int i = 0; i < outerCircle; i++) {
            int idx = i + 1;
            List<NavigateNode> list = extend_nodes(map, currentNode, idx);
            List<NavigateNode> list = extend_outer_nodes(map, currentNode, idx);
            if (list.isEmpty()) {
                continue;
            }
@@ -372,7 +374,7 @@
        for (int i = 0; i < innerCircle; i++) {
            int idx = i + 1;
            List<NavigateNode> list = extend_nodes(map, currentNode, idx);
            List<NavigateNode> list = extend_inner_nodes(map, currentNode, idx);
            if (list.isEmpty()) {
                continue;
            }
@@ -395,7 +397,7 @@
        return innerNodes;
    }
    private List<NavigateNode> extend_nodes(int[][] map, NavigateNode startNode, int innerCircleIdx) {
    private List<NavigateNode> extend_inner_nodes(int[][] map, NavigateNode startNode, int innerCircleIdx) {
        //默认地图母轨方向x
        String mapDirection = "x";
        ConfigService configService = SpringUtils.getBean(ConfigService.class);
@@ -502,6 +504,50 @@
        return nodes;
    }
    private List<NavigateNode> extend_outer_nodes(int[][] map, NavigateNode startNode, int innerCircleIdx) {
        ArrayList<NavigateNode> nodes = new ArrayList<>();
        int x = startNode.getX();
        int y = startNode.getY();
        int z = startNode.getZ();
        if (is_valid(map, x + innerCircleIdx, y)) {
            NavigateNode node = new NavigateNode(x + innerCircleIdx, y);
            node.setNodeValue(map[x + innerCircleIdx][y]);
            node.setZ(z);
            if (node.getNodeValue().equals(startNode.getNodeValue())) {
                nodes.add(node);
            }
        }
        if (is_valid(map, x - innerCircleIdx, y)) {
            NavigateNode node = new NavigateNode(x - innerCircleIdx, y);
            node.setNodeValue(map[x - innerCircleIdx][y]);
            node.setZ(z);
            if (node.getNodeValue().equals(startNode.getNodeValue())) {
                nodes.add(node);
            }
        }
        if (is_valid(map, x, y + innerCircleIdx)) {
            NavigateNode node = new NavigateNode(x, y + innerCircleIdx);
            node.setNodeValue(map[x][y + innerCircleIdx]);
            node.setZ(z);
            if (node.getNodeValue().equals(startNode.getNodeValue())) {
                nodes.add(node);
            }
        }
        if (is_valid(map, x, y - innerCircleIdx)) {
            NavigateNode node = new NavigateNode(x, y - innerCircleIdx);
            node.setNodeValue(map[x][y - innerCircleIdx]);
            node.setZ(z);
            if (node.getNodeValue().equals(startNode.getNodeValue())) {
                nodes.add(node);
            }
        }
        return nodes;
    }
    private boolean is_valid(int[][] map, int x, int y) {
        if (x < 0 || x >= map.length
                || y < 0 || y >= map[0].length) {
src/main/resources/docs/ËÄÏò³µ»õ²æÊ½ÌáÉý»úWCS½Ó¿ÚV1.3.docx
Binary files differ
src/main/resources/sql/20250423154227.nb3
Binary files differ
src/main/resources/sql/С³µ±ÜÕÏÅäÖÃsql
New file
@@ -0,0 +1,2 @@
INSERT INTO `sys_config` (`name`, `code`, `value`, `type`, `status`) VALUES ('避障内圈半径', 'avoidInnerCircle', '1', 1, 1);
INSERT INTO `sys_config` (`name`, `code`, `value`, `type`, `status`) VALUES ('避障外圈半径', 'avoidOuterCircle', '3', 1, 1);