| | |
| | | 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)) { |
| | |
| | | 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())); |
| | |
| | | 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); |
| | | |