zhang
2025-05-20 1313906bb1eb983d3beece810035e7fc28d6a92f
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java
@@ -5,6 +5,7 @@
import com.zy.acs.common.enums.AgvStatusType;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.manager.common.utils.CommonUtil;
import com.zy.acs.manager.core.constant.AgvAreaDispatcher;
import com.zy.acs.manager.manager.entity.*;
import com.zy.acs.manager.manager.enums.FuncStaType;
import com.zy.acs.manager.manager.enums.StatusType;
@@ -31,6 +32,8 @@
    private AgvModelService agvModelService;
    @Autowired
    private TaskService taskService;
    @Autowired
    private AgvAreaDispatcher agvAreaDispatcher;
    @Override
    public FuncSta getByCodeAndType(Long codeId, String type) {
@@ -60,7 +63,22 @@
            return new ArrayList<>();
        }
        Collections.shuffle(funcStaList);
        // area limit
        List<String> areaCodeList = agvAreaDispatcher.getAreaCodeListByAgvNo(agvService.getAgvNo(agvId));
        if (Cools.isEmpty(areaCodeList)) {
            funcStaList.clear();
        } else {
            funcStaList.removeIf(funcSta -> {
                Code code = codeService.getCacheById(funcSta.getCode());
                if (Cools.isEmpty(code, code.getData())) { return true; }
                return !areaCodeList.contains(code.getData());
            });
        }
        if (!Cools.isEmpty(funcStaList)) {
            Collections.shuffle(funcStaList);
        }
        // filter idle
        funcStaList = funcStaList.stream().filter(funcSta -> {