| | |
| | | private AgvLocMastService agvLocMastService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private LocRuleService locRuleService; |
| | | |
| | | public int getWorkNo(Integer wrkMk) { |
| | | AgvWrkLastno wrkLastno = agvWrkLastnoService.selectById(wrkMk); |
| | |
| | | //库位规则 |
| | | if(!Cools.isEmpty(agvWaitPakinList)){ |
| | | locMast = getLocByLocRule(agvWaitPakinList.get(0),floor); |
| | | if(!Cools.isEmpty(locMast)){ |
| | | return locMast; |
| | | } |
| | | } |
| | | |
| | | //库位编码规则 |
| | | if(!Cools.isEmpty(agvWaitPakinList)){ |
| | | locMast = getLocByLocCodeRule(agvWaitPakinList.get(0),floor); |
| | | if(!Cools.isEmpty(locMast)){ |
| | | return locMast; |
| | | } |
| | |
| | | } |
| | | |
| | | /* |
| | | 库位规则查找 |
| | | */ |
| | | private AgvLocMast getLocByLocCodeRule(AgvWaitPakin agvWaitPakin, int floor) { |
| | | if(Cools.isEmpty(agvWaitPakin.getBrand())){ |
| | | return null; |
| | | } |
| | | |
| | | //库区 |
| | | String other = "agv-" + floor; |
| | | List<LocRule> locRules = locRuleService.findCode(agvWaitPakin.getMatnr(), other); |
| | | if(Cools.isEmpty(locRules)){ |
| | | return null; |
| | | } |
| | | |
| | | for (LocRule agvLocRule : locRules) { |
| | | EntityWrapper<AgvLocMast> wrapper = new EntityWrapper<>(); |
| | | wrapper.between("row1",agvLocRule.getRowBeg(),agvLocRule.getRowEnd()) |
| | | .between("bay1",agvLocRule.getBayBeg(),agvLocRule.getBayEnd()) |
| | | .between("lev1",agvLocRule.getLevBeg(),agvLocRule.getLevEnd()) |
| | | .eq("floor",floor) |
| | | .eq("loc_sts","O"); |
| | | AgvLocMast agvLocMast = agvLocMastService.selectOne(wrapper); |
| | | if(!Cools.isEmpty(agvLocMast)){ |
| | | return agvLocMast; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /* |
| | | 靠近摆放规则 |
| | | */ |
| | | private AgvLocMast getLocByProximityRule(){ |