|  |  | 
 |  |  |         } | 
 |  |  |         return false; | 
 |  |  |     } | 
 |  |  |     /** | 
 |  |  |      * 其他  ===>> 607分配硫化罐 | 
 |  |  |      */ | 
 |  |  |     public synchronized void stackingCompletionDriveTray() { | 
 |  |  |         Integer staNo1 = jarGetStartStaNo(607); | 
 |  |  |         if (staNo1!=0){ | 
 |  |  |             SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2); | 
 |  |  |             StaProtocol staProtocol607 = devpThread.getStation().get(607); | 
 |  |  |             staProtocol607.setStaNo(staNo1); | 
 |  |  |             boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607)); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     public synchronized Integer jarGetStartStaNo(Integer staNo) { | 
 |  |  |         try { | 
 |  |  |             int[] jarNos=new int[]{1,2,3,4};//(607分配硫化罐) | 
 |  |  |             ArrayList<Integer> staNos = new ArrayList<Integer>() {{ | 
 |  |  |                 add(607);add(608);add(609);add(610);add(611);add(612); | 
 |  |  |                 add(613);add(614);add(615);add(616);add(617);add(618); | 
 |  |  |                 add(619);add(620);add(621);add(622); | 
 |  |  |             }}; | 
 |  |  |             ArrayList<Integer> jarNoList = new ArrayList<>(); | 
 |  |  |             ArrayList<Integer> jarNoListNow = new ArrayList<>(); | 
 |  |  |             for (int jarNo : jarNos) { | 
 |  |  |                 List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{ | 
 |  |  |                     add(0); | 
 |  |  |                     add(1); | 
 |  |  |                     add(2); | 
 |  |  |                     add(3); | 
 |  |  |                     add(4); | 
 |  |  |                 }}); | 
 |  |  |                 if (basJarMastList.isEmpty()){ | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 if (basJarMastList.size()>0 && basJarMastList.size()<7){ | 
 |  |  |                     jarNoList.add(jarNo); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             jarNoList.add(4); | 
 |  |  |             jarNoList.add(2); | 
 |  |  |             jarNoList.add(3); | 
 |  |  |             jarNoList.add(1); | 
 |  |  |             for (int jarNo : jarNoList) { | 
 |  |  |                 if (jarNoListNow.contains(jarNo)){ | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 // 获取硫化罐信息 | 
 |  |  |                 JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarNo); | 
 |  |  |                 JarProtocol jarProtocol = jarThread.getJarProtocol(); | 
 |  |  |                 if (jarProtocol == null) { | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 if (jarProtocol.modeType != JarModeType.AUTO){ | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 if (jarProtocol.getJarTemperature()>50){ | 
 |  |  |                     log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo()); | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); | 
 |  |  |                 if (Cools.isEmpty(basJar)){ | 
 |  |  |                     log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{ | 
 |  |  |                     add(0); | 
 |  |  |                     add(1); | 
 |  |  |                     add(2); | 
 |  |  |                     add(3); | 
 |  |  |                     add(4); | 
 |  |  |                 }}); | 
 |  |  |                 DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2); | 
 |  |  |                 Integer count = basJarMastList.size(); | 
 |  |  |                 Integer staNoEnd = 0; | 
 |  |  |                 ArrayList<Integer> wrkNoList = new ArrayList<>(); | 
 |  |  |  | 
 |  |  |                 for (Integer staNoEnt : staNos){ | 
 |  |  |                     StaProtocol staProtocolEnt = devpThread.getStation().get(staNoEnt); | 
 |  |  |                     if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){ | 
 |  |  |                         if (staProtocolEnt.getStaNo().equals(basJar.getEntStaNo$())){ | 
 |  |  |                             count++; | 
 |  |  |                             staNoEnd = staProtocolEnt.getWorkNo(); | 
 |  |  |                             wrkNoList.add(staProtocolEnt.getWorkNo()); | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 if (count<7){ | 
 |  |  |                     return staNoEnd; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         }catch (Exception e){ | 
 |  |  | //            e.printStackTrace(); | 
 |  |  | //            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); | 
 |  |  |             log.error("其他  ===>> 分配硫化罐进入下一步"+e); | 
 |  |  |         } | 
 |  |  |         return 0; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |