#
vincentlu
2025-04-08 5831c3e1dabd8d29270c140dc75151b20f65d030
#
1个文件已修改
33 ■■■■■ 已修改文件
zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AgvAreaDispatcher.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AgvAreaDispatcher.java
@@ -1,8 +1,10 @@
package com.zy.acs.manager.core.constant;
import com.zy.acs.manager.manager.entity.Loc;
import com.zy.acs.manager.manager.entity.Sta;
import com.zy.acs.manager.manager.entity.Task;
import com.zy.acs.manager.manager.service.LocService;
import com.zy.acs.manager.manager.service.StaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -23,6 +25,8 @@
    @Autowired
    private LocService locService;
    @Autowired
    private StaService staService;
    @PostConstruct
    public void init() {
@@ -71,14 +75,24 @@
            return null;
        }
        Loc oriLoc = null;
        Sta oriSta = null;
        Loc destLoc = null;
        Sta destSta = null;
        if (null != task.getOriLoc()) {
            oriLoc = locService.getById(task.getOriLoc());
            return this.getAgvNosByRow(oriLoc.getRow());
        }
        if (null != task.getOriSta()) {
            oriSta = staService.getById(task.getOriSta());
            return this.getAgvNosByStaNo(oriSta.getStaNo());
        }
        if (null != task.getDestLoc()) {
            destLoc = locService.getById(task.getDestLoc());
            return this.getAgvNosByRow(destLoc.getRow());
        }
        if (null != task.getDestSta()) {
            destSta = staService.getById(task.getDestSta());
            return this.getAgvNosByStaNo(destSta.getStaNo());
        }
        return null;
    }
@@ -102,6 +116,25 @@
        return null;
    }
    public List<String> getAgvNosByStaNo(String staNo) {
        if (StaGroupConstant.FAR_LEFT_STA_ROW_LIST.contains(staNo)) {
            return AgvGroupConstant.FIRST_AGV_GROUP;
        }
        if (StaGroupConstant.LEFT_STA_ROW_LIST.contains(staNo)) {
            return AgvGroupConstant.SECOND_AGV_GROUP;
        }
        if (StaGroupConstant.MIDDLE_STA_ROW_LIST.contains(staNo)) {
            return AgvGroupConstant.THIRD_AGV_GROUP;
        }
        if (StaGroupConstant.RIGHT_STA_ROW_LIST.contains(staNo)) {
            return AgvGroupConstant.FOURTH_AGV_GROUP;
        }
        if (StaGroupConstant.FAR_RIGHT_STA_ROW_LIST.contains(staNo)) {
            return AgvGroupConstant.FIFTH_AGV_GROUP;
        }
        return null;
    }
    public List<String> getAreaCodeListByAgvNo(String agvNo) {
        List<String> areaCodeList = new ArrayList<>();
        if (null == agvNo) {