| | |
| | | * 检索库位号 |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | public AgvLocMast getLocNo(List<AgvWaitPakin> agvWaitPakinList, int floor) { |
| | | public AgvLocMast getLocNo(int type, int floor) { |
| | | // 目标库位 |
| | | AgvLocMast locMast = null; |
| | | if(Cools.isEmpty(agvWaitPakinList)){ |
| | | return getLocNoRule(floor); // 1. 随机库位 |
| | | } |
| | | // if(Cools.isEmpty(agvWaitPakinList)){ |
| | | // return getLocNoRule(type); // 1. 随机库位 |
| | | // } |
| | | |
| | | //库位规则 |
| | | locMast = getLocByLocRule(agvWaitPakinList.get(0),floor); // 2. 按库位规则搜索 |
| | | if(!Cools.isEmpty(locMast)){ |
| | | return locMast; |
| | | } |
| | | |
| | | |
| | | //库位编码规则 |
| | | locMast = getLocByLocCodeRule(agvWaitPakinList.get(0),floor); |
| | | if(!Cools.isEmpty(locMast)){ |
| | | return locMast; |
| | | } |
| | | |
| | | // 靠近摆放规则 --- 相同订单号, 同天同规格物料 |
| | | locMast = getLocByProximityRule(); |
| | | if (locMast != null) { |
| | | //找到库位,返回dto |
| | | //return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | | } |
| | | |
| | | //根据物料频率搜索库位,频率高则搜索离缓存货架最近库位,频率低则搜索最远库位 |
| | | Mat mat = matService.selectByMatnr(agvWaitPakinList.get(0).getMatnr()); |
| | | if(Cools.isEmpty(mat.getBeBatch())){ |
| | | mat.setBeBatch(0); |
| | | } |
| | | locMast = getLocByFre(mat.getBeBatch(), floor); |
| | | if (locMast != null) { |
| | | return locMast; |
| | | } |
| | | // //库位规则 |
| | | // locMast = getLocByLocRule(agvWaitPakinList.get(0),floor); // 2. 按库位规则搜索 |
| | | // if(!Cools.isEmpty(locMast)){ |
| | | // return locMast; |
| | | // } |
| | | // |
| | | // |
| | | // //库位编码规则 |
| | | // locMast = getLocByLocCodeRule(agvWaitPakinList.get(0),floor); |
| | | // if(!Cools.isEmpty(locMast)){ |
| | | // return locMast; |
| | | // } |
| | | // |
| | | // // 靠近摆放规则 --- 相同订单号, 同天同规格物料 |
| | | // locMast = getLocByProximityRule(); |
| | | // if (locMast != null) { |
| | | // //找到库位,返回dto |
| | | // //return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto |
| | | // } |
| | | // |
| | | // //根据物料频率搜索库位,频率高则搜索离缓存货架最近库位,频率低则搜索最远库位 |
| | | // Mat mat = matService.selectByMatnr(agvWaitPakinList.get(0).getMatnr()); |
| | | // if(Cools.isEmpty(mat.getBeBatch())){ |
| | | // mat.setBeBatch(0); |
| | | // } |
| | | // locMast = getLocByFre(mat.getBeBatch(), floor); |
| | | // if (locMast != null) { |
| | | // return locMast; |
| | | // } |
| | | |
| | | |
| | | // 开始查找库位 ==============================>> |
| | | locMast = getLocNoRule(floor); |
| | | locMast = getLocNoRule(type,floor); |
| | | if (locMast != null) { |
| | | return locMast; |
| | | } |
| | |
| | | } |
| | | |
| | | //随机取一个货位 |
| | | private AgvLocMast getLocNoRule(int floor){ |
| | | private AgvLocMast getLocNoRule(int type,int floor){ |
| | | return agvLocMastService.selectOne(new EntityWrapper<AgvLocMast>() |
| | | .eq("floor",floor) |
| | | .eq("loc_sts","O") |
| | | .eq(false,"loc_type2",1)); |
| | | .eq("floor",floor) |
| | | .eq("loc_type1",type)); |
| | | } |
| | | |
| | | |