zjj
2025-06-09 80d97d40c44165674ee0168be5f08c8ca52d3c06
Merge remote-tracking branch 'origin/jxgtwcs' into jxgtwcs
3个文件已修改
76 ■■■■ 已修改文件
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
@@ -984,6 +984,9 @@
        //穿梭车出提升机库位号
        String liftLocNoFrom = shuttleStandbyFrom.getDeviceLoc();
        //穿梭车换层时待机位置 使用表列 memo数据
        String standbyLocNoMemo = shuttleStandbyTo.getMemo();
        //穿梭车进提升机待机位库位号
        String standbyLocNoTo = shuttleStandbyTo.getDeviceStandbyLoc();
@@ -1018,7 +1021,7 @@
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(standbyLocNoTo);
                        dto.setLocNo(standbyLocNoMemo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
            ));
@@ -1044,7 +1047,7 @@
            motionList.addAll(kernelService.shuttleMove(
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setLocNo(standbyLocNoTo);
                        dto.setLocNo(standbyLocNoMemo);
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -23,10 +23,7 @@
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.*;
import com.zy.asrs.wcs.core.service.*;
import com.zy.asrs.wcs.core.utils.OpenUtils;
import com.zy.asrs.wcs.core.utils.RedisUtil;
import com.zy.asrs.wcs.core.utils.ShuttleDispatcher;
import com.zy.asrs.wcs.core.utils.Utils;
import com.zy.asrs.wcs.core.utils.*;
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
@@ -95,6 +92,8 @@
    private OpenUtils openUtils;
    @Autowired
    private LiftAction liftAction;
    @Autowired
    private NavigateUtils navigateUtils;
    /**
     * 组托
@@ -780,10 +779,6 @@
     * 出库 ====>> 同一时间一台穿梭车只能有一个出库任务
     */
    public synchronized void analyzeOutBoundTask() {
        List<Task> moveTask = taskService.selectWaitAnalyzeMoveTask();
        if (!moveTask.isEmpty()) {
            return;
        }
        List<Task> tasks = taskService.selectPakOut();
        if (tasks.isEmpty()) {
            return;
@@ -816,15 +811,13 @@
//                    continue;
//                }
//                //同库位组校验
//                List<String> outerLoc = Utils.getGroupOuterLoc(wrkMast.getSourceLocNo());
//                List<LocMast> outerLocMasts = locMastService.selectNotEmptyLocNos(outerLoc);
//                if (!outerLocMasts.isEmpty()) {
//                    News.info("{}任务,浅库位存在货物,系统等待中", wrkMast.getWrkNo());
//                    continue;//浅库位存在未执行任务
//                }
                //检测货物是否可出
                boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getOriginLoc(), task.getHostId());
                if(!checkLocPathIsAvailable) {
                    continue;
                }
                if (Cools.isEmpty(task.getShuttleNo())) {
                if (Cools.isEmpty(task.getShuttleNo()) || task.getShuttleNo() ==0) {
                    //分配小车
                    //搜索空闲车
                    ShuttleThread shuttleThread = shuttleDispatcher.searchIdleShuttle(task);
@@ -844,7 +837,7 @@
                // generate motion list
                List<Motion> motionList = analyzeService.generateMotion(task);
                if (Cools.isEmpty(motionList)) {
                    task.setShuttleNo(null);//保存穿梭车号
                    task.setShuttleNo(0);//保存穿梭车号
                    task.setUpdateTime(new Date());
                    if (!taskService.updateById(task)) {
                        News.info("{}任务更新穿梭车号失败", task.getTaskNo());
@@ -1313,6 +1306,12 @@
    // 解析小车载货移动工作档
    public synchronized void analyzeLadenMoveTask() {
        for (Task task : taskService.selectWaitAnalyzeLadenMoveTask()) {
            //检测货物是否可出
            boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getOriginLoc(), task.getHostId());
            if(!checkLocPathIsAvailable) {
                continue;
            }
            if (Cools.isEmpty(task.getShuttleNo())) {
                //分配小车
                //搜索空闲车
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
@@ -2,13 +2,19 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wcs.core.entity.ShuttleStandby;
import com.zy.asrs.wcs.core.model.MapNode;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.PythonSimilarityResult;
import com.zy.asrs.wcs.core.model.enums.MapNodeType;
import com.zy.asrs.wcs.core.model.enums.NavigationMapType;
import com.zy.asrs.wcs.core.service.ShuttleStandbyService;
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.thread.LiftThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -26,9 +32,12 @@
    @Value("${pythonCalcPath}")
    private String pythonCalcPath;
    @Value("${pythonCalcSimilarity}")
    private String pythonCalcSimilarity;
    @Autowired
    private LiftDispatcher liftDispatcher;
    @Autowired
    private ShuttleStandbyService shuttleStandbyService;
    public List<NavigateNode> calcWhiteList(String startPoint, String endPoint, Integer mapType, List<int[]> shuttlePoints) {
        //通过开始编号和结束编号获取对应的xy轴坐标
@@ -418,6 +427,31 @@
        return 0D;
    }
    //检测库位路径是否可用(用于库位是否可移动检测)
    public boolean checkLocPathIsAvailable(String startLocNo, Long hostId) {
        //获取距离目标位置最近的可换层提升机(可能不空闲)
        LiftThread liftThread = liftDispatcher.searchLift(startLocNo, hostId, true);
        if (liftThread == null) {
            return false;
        }
        Device transferLiftDevice = liftThread.getDevice();
        ShuttleStandby shuttleStandbyTo = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>()
                .eq(ShuttleStandby::getDeviceId, transferLiftDevice.getId())
                .eq(ShuttleStandby::getDeviceLev, Utils.getLev(startLocNo))
                .eq(ShuttleStandby::getStatus, 1));
        //提升机库位号
        String liftLocNo = shuttleStandbyTo.getDeviceLoc();
        //计算库位到提升机库位,路径是否可用
        List<NavigateNode> nodeList = this.calc(startLocNo, liftLocNo, NavigationMapType.DFX.id, null);
        if (nodeList == null) {
            return false;
        }
        return true;
    }
    public static void main(String[] args) {
//        //计算路径
//        List<NavigateNode> calc = calc("1000901", "1800201", NavigationMapType.NONE.id, null);