#
luxiaotao1123
2024-11-29 ab886689e2c4ef8db2b0767717d69ebbaf10326c
zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/KernelScheduler.java
@@ -160,6 +160,7 @@
        if (null != agvModel) {
            maxCapacity = agvModel.getBackpack() * numOfAgv;
        }
        int numOfStockLocList;
        // STOCK
        List<Loc> stockList = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getLocSts, LocStsType.STOCK.val()));
        if (Cools.isEmpty(stockList)) {
@@ -169,6 +170,7 @@
        if (stockList.size() > maxCapacity) {
            stockList = stockList.subList(0, maxCapacity);
        }
        numOfStockLocList = stockList.size();
        // IDLE
        List<Loc> idleList = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getLocSts, LocStsType.IDLE.val()));
@@ -176,13 +178,13 @@
            return;
        }
        Collections.shuffle(idleList);
        if (idleList.size() > maxCapacity) {
            idleList = idleList.subList(0, maxCapacity);
        if (idleList.size() > numOfStockLocList) {
            idleList = idleList.subList(0, numOfStockLocList);
        }
        OpenBusSubmitParam param = new OpenBusSubmitParam();
        param.setBatch(String.valueOf(snowflakeIdWorker.nextId()).substring(13, 19));
        for (int i = 0; i < maxCapacity; i++) {
        for (int i = 0; i < numOfStockLocList; i++) {
            Loc stockLoc = stockList.get(i);
            Loc idleLoc = idleList.get(i);