zc
2025-10-17 b5dca159bc10a5f26fc06f8f139d4976d45407ae
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java
@@ -7,10 +7,7 @@
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;
import com.zy.acs.manager.manager.enums.TaskStsType;
import com.zy.acs.manager.manager.enums.TaskTypeType;
import com.zy.acs.manager.manager.enums.*;
import com.zy.acs.manager.manager.mapper.FuncStaMapper;
import com.zy.acs.manager.manager.service.*;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,7 +53,7 @@
    @Override
    public List<FuncSta> findInIdleStatus(FuncStaType type, Long agvId) {
        LambdaQueryWrapper<FuncSta> wrapper = new LambdaQueryWrapper<FuncSta>()
                .eq(FuncSta::getType, type).eq(FuncSta::getStatus, StatusType.ENABLE.val);
                .eq(FuncSta::getType, type).eq(FuncSta::getStatus, StatusType.ENABLE.val).eq(FuncSta::getState, FuncStaStateType.IDLE.toString());
        List<FuncSta> funcStaList = this.list(wrapper);
        if (Cools.isEmpty(funcStaList)) {
@@ -64,16 +61,16 @@
        }
        // 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());
            });
        }
//        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);