| | |
| | | public ReturnT<String> start(LocMast locMastStart, LocMast locMastEnd, Integer crnNo) { |
| | | try { |
| | | LocMast locMastEndNew = null; |
| | | Integer row1 = locMastStart.getRow1(); |
| | | Integer row2 = 0; |
| | | Integer bay1 = locMastStart.getBay1(); |
| | | Integer lev1 = locMastStart.getLev1(); |
| | | if (row1==crnNo*4){ |
| | | row1 = crnNo*4-3; |
| | | row2 = row1+1; |
| | | }else { |
| | | row1=crnNo*4; |
| | | row2 = row1-1; |
| | | } |
| | | Integer signInt = 0; |
| | | while (Cools.isEmpty(locMastEndNew) && lev1<9 && signInt<100){ |
| | | signInt++; |
| | | |
| | | bay1 = BAY+1-bay1; |
| | | if ((bay1<BAY && bay1>0) || (bay1.equals(BAY) && lev1>3)){ |
| | | |
| | | }else { |
| | | bay1=1; |
| | | lev1++; |
| | | } |
| | | locMastEndNew = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_sts","O").eq("row1",row1).eq("bay1",bay1).eq("lev1",lev1).ne("modi_user",66)); |
| | | LocMast locMastEndNew2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_sts","O").eq("row1",row2).eq("bay1",bay1).eq("lev1",lev1).ne("modi_user",66)); |
| | | if (!Cools.isEmpty(locMastEndNew) && !Cools.isEmpty(locMastEndNew2)){ |
| | | locMastEnd = locMastEndNew; |
| | | } |
| | | if ((bay1<BAY && bay1>0)){ |
| | | bay1++; |
| | | } |
| | | if (signInt==100){ |
| | | bay1=1; |
| | | lev1++; |
| | | signInt=0; |
| | | } |
| | | } |
| | | workService.locMove(locMastStart.getLocNo(), locMastEnd.getLocNo(), 66L); |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |