| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 货架核心功能 |
| | |
| | | private LocMast getLocNoStep2(LocTypeDto locTypeDto, List<String> matNos, List<Integer> rows, List<Integer> crnNos) { |
| | | LocMast locMast = null; |
| | | //先找工作档 |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectSameWrkMast(matNos.get(0)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | List<String> groupLoc = Utils.getGroupLoc(wrkMast.getLocNo()); |
| | |
| | | //未找到巷道,找一条新的空巷道 |
| | | if (locMast == null) { |
| | | //随机可用堆垛机号 |
| | | Boolean flag = false; |
| | | Integer randomCrnNo = Utils.getRandomCrnNo(crnNos, locTypeDto.getLocType1()); |
| | | Collections.shuffle(crnNos); |
| | | System.out.println(crnNos); |
| | | for (Integer crnNo : crnNos) { |
| | | List<LocMast> locMasts = locMastService.findInEmptyLocMast(locTypeDto.getLocType1(), rows, crnNo);//找一条新的空巷道 |
| | | for (LocMast locMast0 : locMasts) { |
| | |
| | | // 因库位移转、需预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast0, 10)) { |
| | | locMast = locMast0; |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (flag) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |