|  |  | 
 |  |  |     @Autowired | 
 |  |  |     private BasCrnpService basCrnpService; | 
 |  |  |  | 
 |  |  |     public ReturnT<String> start() { | 
 |  |  |     public static final List<Integer> rows1 = new ArrayList<Integer>() {{ | 
 |  |  |         add(1);add(5);add(9);add(13);add(17);add(21); | 
 |  |  |     }}; | 
 |  |  |  | 
 |  |  |     public static final List<Integer> rows2 = new ArrayList<Integer>() {{ | 
 |  |  |         add(4);add(8);add(12);add(16);add(20);add(24); | 
 |  |  |     }}; | 
 |  |  |  | 
 |  |  |     public ReturnT<String> start(Integer staNo) { | 
 |  |  |         try { | 
 |  |  |             if (!Cools.isEmpty(wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 110).eq("staNo", 213)))){ | 
 |  |  |             if (!Cools.isEmpty(wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 110).eq("sta_no", staNo)))){ | 
 |  |  |                 return null; | 
 |  |  |             } | 
 |  |  |             // 获取工作号 | 
 |  |  | 
 |  |  |             crns.add(6); | 
 |  |  |             boolean sign = true; | 
 |  |  |             for (Integer crnNo : crns){ | 
 |  |  |                 BasCrnp basCrnp = basCrnpService.selectById(crnNo); | 
 |  |  |                 if (basCrnp.getCrnSts()!=3 || !basCrnp.getOutEnable().equals("Y")){ | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 sign = true; | 
 |  |  |                 // 获取库位 | 
 |  |  |                 LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_sts","D").eq("crn_no",crnNo)); | 
 |  |  |  | 
 |  |  |                 if (Cools.isEmpty(locMast)) { | 
 |  |  | //                    throw new CoolException("库中无空板!!!"); | 
 |  |  |                     sign=false; | 
 |  |  |                 } | 
 |  |  |                 if (sign){ | 
 |  |  |                     if (rows1.contains(locMast.getRow1())){ | 
 |  |  |                         LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("row1", locMast.getRow1() + 1) | 
 |  |  |                                 .eq("bay1", locMast.getBay1()).eq("lev1", locMast.getLev1())); | 
 |  |  |                         if (!Cools.isEmpty(locMast1)) { | 
 |  |  |                             locMast = locMast1; | 
 |  |  |                         } | 
 |  |  |                     }else if (rows2.contains(locMast.getRow1())){ | 
 |  |  |                         LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("row1", locMast.getRow1() - 1) | 
 |  |  |                                 .eq("bay1", locMast.getBay1()).eq("lev1", locMast.getLev1())); | 
 |  |  |                         if (!Cools.isEmpty(locMast1)) { | 
 |  |  |                             locMast = locMast1; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 if (sign && Cools.isEmpty(locMast)) { | 
 |  |  | //                    throw new CoolException("库中无空板!!!"); | 
 |  |  |                     sign=false; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (sign && !locMast.getLocSts().equals("D")){ | 
 |  |  | //                    throw new CoolException("所选库位存在状态不为D的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); | 
 |  |  |                     sign=false; | 
 |  |  | 
 |  |  |                     // 获取源站 | 
 |  |  |                     Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() | 
 |  |  |                             .eq("type_no", 110) | 
 |  |  |                             .eq("stn_no", 213) | 
 |  |  |                             .eq("stn_no", staNo) | 
 |  |  |                             .eq("crn_no", locMast.getCrnNo()); | 
 |  |  |                     StaDesc staDesc = staDescService.selectOne(wrapper); | 
 |  |  |                     Integer sourceStaNo = staDesc.getCrnStn(); | 
 |  |  |                     if (!Cools.isEmpty(sourceStaNo)) { | 
 |  |  |                     if (Cools.isEmpty(staDesc)) { | 
 |  |  | //                    throw new CoolException("检索源站失败"); | 
 |  |  |                         sign = false; | 
 |  |  |                     } | 
 |  |  |                     Integer sourceStaNo = null; | 
 |  |  |                     if (sign){ | 
 |  |  |                         sourceStaNo = staDesc.getCrnStn(); | 
 |  |  |                         if (Cools.isEmpty(sourceStaNo)) { | 
 |  |  | //                    throw new CoolException("检索源站失败"); | 
 |  |  |                             sign = false; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     if (sign){ | 
 |  |  |                         Date now = new Date(); | 
 |  |  | 
 |  |  |                         wrkMast.setIoType(110); // 入出库状态: 110.空板出库 | 
 |  |  |                         wrkMast.setIoPri(10D); | 
 |  |  |                         wrkMast.setSourceStaNo(sourceStaNo); // 源站 | 
 |  |  |                         wrkMast.setStaNo(213); // 目标站 | 
 |  |  |                         wrkMast.setStaNo(staNo); // 目标站 | 
 |  |  |                         wrkMast.setCrnNo(locMast.getCrnNo()); | 
 |  |  |                         wrkMast.setSourceLocNo(locMast.getLocNo()); // 源库位 | 
 |  |  |                         wrkMast.setFullPlt("N"); // 满板:Y |