#
Junjie
2025-05-19 20468100e3b839a3117c6b59ffe2f3202d3c3e2c
#
2个文件已修改
65 ■■■■ 已修改文件
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java 29 ●●●● 补丁 | 查看 | 原始文档 | 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/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;
    /**
     * 组托
@@ -779,10 +778,6 @@
     * 出库 ====>> 同一时间一台穿梭车只能有一个出库任务
     */
    public synchronized void analyzeOutBoundTask() {
        List<Task> moveTask = taskService.selectWaitAnalyzeMoveTask();
        if (!moveTask.isEmpty()) {
            return;
        }
        List<Task> tasks = taskService.selectPakOut();
        if (tasks.isEmpty()) {
            return;
@@ -815,13 +810,11 @@
//                    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.getDestLoc(), task.getHostId());
                if(!checkLocPathIsAvailable) {
                    continue;
                }
                if (Cools.isEmpty(task.getShuttleNo()) || task.getShuttleNo() ==0) {
                    //分配小车
@@ -1312,6 +1305,12 @@
    // 解析小车载货移动工作档
    public synchronized void analyzeLadenMoveTask() {
        for (Task task : taskService.selectWaitAnalyzeLadenMoveTask()) {
            //检测货物是否可出
            boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getDestLoc(), 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);