log
Junjie
2023-06-19 d4f1965d2dd5c1add73778f42e18d6153890858c
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -10,6 +10,7 @@
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.*;
import com.zy.common.model.enums.NavigationMapType;
import com.zy.common.model.enums.WrkChargeType;
import com.zy.common.service.CommonService;
import com.zy.common.service.erp.ErpService;
@@ -569,7 +570,7 @@
                    //数据库中也不存在地图数据,从地图文件中获取
                    //载入地图
                    NavigateMapData mapData = new NavigateMapData(i);
                    List<List<MapNode>> lists = mapData.getJsonData(-1);//获取完整地图(包括入库出库)
                    List<List<MapNode>> lists = mapData.getJsonData(-1, null);//获取完整地图(包括入库出库)
                    //存入数据库
                    basMap = new BasMap();
@@ -751,7 +752,7 @@
                                    Short distCode = Short.parseShort(basDevp.getQrCodeValue());//提升机口站点二维码
                                    Short runDirection = ShuttleRunDirection.BOTTOM.id;//运行方向
                                    //获取命令
                                    ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, startCode, 1400, 1000);
                                    ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, startCode, 1400, 500);
                                    commands.add(0, moveCommand);//将该指令添加到队头
                                }
                                assignCommand.setCommands(commands);
@@ -771,7 +772,7 @@
                                Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码
                                //增加移动进提升机命令
                                ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, endStartCode, 1400, 1000);
                                ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, endStartCode, 1400, 500);
                                commands.add(moveCommand);
                                //分配目标库位
@@ -796,7 +797,7 @@
    }
    //获取起点-终点指令。mapType:0=>无货物地图,1=》携带货物出入库地图
    //获取起点-终点指令
    public synchronized List<ShuttleCommand> shuttleAssignCommand(String startLocNo, String locNo, Integer mapType, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) {
        //获取小车移动速度
        BasShuttle basShuttle = basShuttleService.selectById(assignCommand.getShuttleNo());
@@ -864,7 +865,7 @@
        List<NavigateNode> allNode = new ArrayList<>();
        //计算小车起点到中点所需命令
        List<NavigateNode> calc = NavigateUtils.calc(startLocNo, middleLocNo, 1);//小车无货,走入库地图
        List<NavigateNode> calc = NavigateUtils.calc(startLocNo, middleLocNo, NavigationMapType.NORMAL.id);//小车无货,走正常库位通道
        List<ShuttleCommand> commands = new ArrayList<>();
        if (calc != null) {
@@ -898,7 +899,7 @@
        commands.add(shuttleThread.getPalletCommand((short) 1));
        //计算小车中点到终点所需命令
        List<NavigateNode> calc2 = NavigateUtils.calc(middleLocNo, locNo, 2);//小车有货,走出库地图(出库地图有专用货道)
        List<NavigateNode> calc2 = NavigateUtils.calc(middleLocNo, locNo, NavigationMapType.DFX.id);//小车有货,走禁用过DFX库位的地图通道
        if (calc2 == null) {
            return null;
        }
@@ -1072,7 +1073,7 @@
                            Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码
                            //增加移动进提升机命令
                            ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, endStartCode, 1400, 1000);
                            ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, endStartCode, 1400, 500);
                            commands.add(moveCommand);
                            //目标库位
@@ -1209,9 +1210,9 @@
                String recentLocNo = recentShuttle.getShuttleProtocol().getCurrentLocNo();
                //当前最近四向穿梭车到目标地点距离
                List<NavigateNode> recentShuttlePath = NavigateUtils.calc(recentLocNo, distLocNo, ShuttleTaskModeType.PAK_IN.id);
                List<NavigateNode> recentShuttlePath = NavigateUtils.calc(recentLocNo, distLocNo, NavigationMapType.NORMAL.id);//搜索空闲穿梭车,使用正常通道地图
                //当前穿梭车线程到目标地点距离
                List<NavigateNode> currentShuttlePath = NavigateUtils.calc(currentLocNo, distLocNo, ShuttleTaskModeType.PAK_IN.id);
                List<NavigateNode> currentShuttlePath = NavigateUtils.calc(currentLocNo, distLocNo, NavigationMapType.NORMAL.id);//搜索空闲穿梭车,使用正常通道地图
                if (recentShuttlePath == null || currentShuttlePath == null) {
                    continue;
                }
@@ -1241,9 +1242,9 @@
                int recentLev = Utils.getLev(recentLocNo);
                //当前最近四向穿梭车到当前车子所在楼层的提升机口距离
                List<NavigateNode> recentShuttlePath = NavigateUtils.calc(recentLocNo, Utils.levToOutInStaLocNo(recentLev), ShuttleTaskModeType.PAK_IN.id);
                List<NavigateNode> recentShuttlePath = NavigateUtils.calc(recentLocNo, Utils.levToOutInStaLocNo(recentLev), NavigationMapType.NORMAL.id);//搜索空闲穿梭车,使用正常通道地图
                //当前穿梭车线程到当前车子所在楼层的提升机口距离
                List<NavigateNode> currentShuttlePath = NavigateUtils.calc(currentLocNo, Utils.levToOutInStaLocNo(currentLev), ShuttleTaskModeType.PAK_IN.id);
                List<NavigateNode> currentShuttlePath = NavigateUtils.calc(currentLocNo, Utils.levToOutInStaLocNo(currentLev), NavigationMapType.NORMAL.id);//搜索空闲穿梭车,使用正常通道地图
                if (recentShuttlePath == null || currentShuttlePath == null) {
                    continue;
                }