| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | if(targetLocMast == null) { |
| | | //相近物料匹配失败,搜索可用空库位组 |
| | | |
| | | //获取设备楼层 |
| | | List<Integer> levList = basCrnpService.getLevList(); |
| | | Collections.shuffle(levList); |
| | | |
| | | for (Integer lev : levList) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .orderBy("lev1", true) |
| | | .eq("lev1", lev) |
| | | .orderBy("bay1", true)); |
| | | for (LocMast locMast : locMasts) { |
| | | String locNo = locMast.getLocNo(); |
| | |
| | | String deepLocNo = Utils.getLocNo(firstRow, Utils.getBay(locNo), Utils.getLev(locNo)); |
| | | LocMast deepLoc = locMastService.selectById(deepLocNo); |
| | | targetLocMast = deepLoc; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (targetLocMast != null) { |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | if(targetLocMast == null) { |
| | | |
| | | //获取设备楼层 |
| | | List<Integer> levList = basCrnpService.getLevList(); |
| | | Collections.shuffle(levList); |
| | | |
| | | for (Integer lev : levList) { |
| | | //相近物料匹配失败,搜索可用空库位组 |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .orderBy("lev1", true) |
| | | .eq("lev1", lev) |
| | | .orderBy("bay1", true)); |
| | | for (LocMast locMast : locMasts) { |
| | | String locNo = locMast.getLocNo(); |
| | |
| | | } |
| | | } |
| | | |
| | | if (targetLocMast != null) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return targetLocMast; |
| | | } |