| | |
| | | */ |
| | | public synchronized void stackingCompletionDriveTray() { |
| | | try { |
| | | int[] staNos=new int[]{216,220}; |
| | | int[] staNos=new int[]{216,220,123};//(3个入库站点,1楼1个退货码垛站,2楼两个入库码垛站) |
| | | for (int staNo : staNos){ |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | if (basDevp.getWrkNo()!=9992 || Cools.isEmpty(basDevp.getBarcode())){ |
| | |
| | | // } |
| | | |
| | | if (!staProtocol.isLoading()){ |
| | | log.info("站点无物,正在自动调出空板!"); |
| | | log.info("{}站点无物,正在自动调出空板!",staNo); |
| | | continue; |
| | | } |
| | | // 判断是否满足入库条件 |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | /** |
| | | * 其他 ===>> 码垛完成驱动托盘进入下一步 |
| | | */ |
| | | public synchronized void stackingCompletionDriveTray2() { |
| | | try { |
| | | int[] staNos=new int[]{133,135};//(2个入库站点,1楼2个出库码垛站,根据现场修改) |
| | | for (int staNo : staNos){ |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | if (basDevp.getWrkNo()<9990){ |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastMapper.selectWrkMastUnstackingOne202(staNo); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | // 获取站点信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // 入出库模式判断 |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | // if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // continue; |
| | | // } |
| | | |
| | | if (!staProtocol.isLoading()){ |
| | | log.info("{}站点无物,异常!",staNo); |
| | | continue; |
| | | } |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.getWorkNo() >= 9990 |
| | | ) {//&& staProtocol.isPakMk() && !Cools.isEmpty(barcode)) { |
| | | |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败==>驱动码垛位托盘前进失败!"); |
| | | } |
| | | wrkMast.setWrkSts(52L); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | /** |
| | | * 其他 ===>> 贴标完成驱动托盘进入下一步 |
| | | */ |
| | | public synchronized void stackingCompletionDriveTray3() { |
| | | try { |
| | | int[] staNos=new int[]{144};//(1楼1个贴标位,根据现场修改) |
| | | for (int staNo : staNos){ |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | if (basDevp.getWrkNo()<9990){ |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastMapper.selectWrkMastUnstackingOne202(staNo); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | // 获取站点信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // 入出库模式判断 |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | // if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // continue; |
| | | // } |
| | | |
| | | if (!staProtocol.isLoading()){ |
| | | log.info("{}站点无物,异常!",staNo); |
| | | continue; |
| | | } |
| | | if (!staProtocol.getWorkNo().equals(wrkMast.getWrkNo().shortValue())){ |
| | | log.info("站点工作号={} 与贴标工作号={} 不一致,异常!",staProtocol.getWorkNo(),wrkMast.getWrkNo().shortValue()); |
| | | } |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | ) {//&& staProtocol.isPakMk() && !Cools.isEmpty(barcode)) { |
| | | |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败==>驱动码垛位托盘前进失败!"); |
| | | } |
| | | wrkMast.setWrkSts(55L); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | } |