| | |
| | | if (Cools.isEmpty(basDevp) || basDevp.getReportSign()!=1){ |
| | | continue; |
| | | } |
| | | if (basDevp.getWrkNo()!=0 && (basDevp.getWrkNo()<9900 || basDevp.getWrkNo()>9999)){ |
| | | continue; |
| | | } |
| | | // if (basDevp.getWrkNo()!=0 && (basDevp.getWrkNo()<9900 || basDevp.getWrkNo()>9999)){ |
| | | // continue; |
| | | // } |
| | | WrkMast wrkMast = wrkMastMapper.selectWrkMastUnstackingOne202(staNo); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | |
| | | // if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // continue; |
| | | // } |
| | | |
| | | if (staProtocol.isEmptyMk()){ |
| | | log.info("{}站点无物,异常!",staNo); |
| | | continue; |
| | | } |
| | | if (!staProtocol.isLoading()){ |
| | | log.info("{}站点无物,异常!",staNo); |
| | | continue; |
| | | } |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && (staProtocol.getWorkNo() == 0 || (staProtocol.getWorkNo()>9899 && staProtocol.getWorkNo()<10000)) |
| | | ) {//&& staProtocol.isPakMk() && !Cools.isEmpty(barcode)) { |
| | | |
| | | if (staProtocol.isAutoing() && staProtocol.getWorkNo() == 0) {//&& staProtocol.isPakMk() && !Cools.isEmpty(barcode)) { |
| | | // && staProtocol.isInEnable() |
| | | //任务完成 |
| | | boolean result1 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(3, staProtocol)); |
| | | Thread.sleep(100); |
| | | |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(144); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocol)); |
| | | // boolean result1 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(3, staProtocol)); |
| | | // Thread.sleep(100); |
| | | StaProtocol staProtocolnew = new StaProtocol(); |
| | | staProtocolnew.setSiteId(staProtocol.getSiteId()); |
| | | staProtocolnew.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocolnew.setStaNo(144); |
| | | devpThread.setPakMk(staProtocolnew.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocolnew)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败==>驱动码垛位托盘前进失败!"); |
| | | } |
| | | wrkMast.setWrkSts(52L); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | Thread.sleep(100); |
| | | // Thread.sleep(100); |
| | | |
| | | //任务完成 |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(4, staProtocol)); |
| | | // boolean result2 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(4, staProtocol)); |
| | | |
| | | } |
| | | } |
| | |
| | | for (int staNo : staNos){ |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | BasDevp basDevp135 = basDevpService.selectById(135); |
| | | if (basDevp.getWrkNo()==0 || (basDevp.getWrkNo()<10000 && basDevp.getWrkNo()>9899) ){ |
| | | if (basDevp.getWrkNo()==0){ |
| | | continue; |
| | | } |
| | | if (basDevp135.getReportSign()!=0){ |
| | |
| | | } else { |
| | | staProtocol135 = staProtocol135.clone(); |
| | | } |
| | | if (staProtocol135.getWorkNo()<9900 || staProtocol135.getWorkNo()>9999 || staProtocol135.getWorkNo()==0 |
| | | || !staProtocol135.isLoading() || !staProtocol135.isAutoing()){ |
| | | if ( staProtocol135.getWorkNo()!=0 |
| | | || !staProtocol135.isLoading() || !staProtocol135.isAutoing() || !staProtocol135.isEmptyMk()){ |
| | | continue; |
| | | } |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | |
| | | // } |
| | | |
| | | //任务完成 |
| | | boolean result1 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(3, staProtocol135)); |
| | | try{ |
| | | Thread.sleep(100); |
| | | }catch (Exception e){ } |
| | | // boolean result1 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(3, staProtocol135)); |
| | | // try{ |
| | | // Thread.sleep(100); |
| | | // }catch (Exception e){ } |
| | | basDevp135.setReportSign(2); |
| | | basDevpService.updateById(basDevp135); |
| | | int workNo = commonService.getWorkNo(5); |
| | | staProtocol135.setWorkNo(workNo); |
| | | staProtocol135.setStaNo(144); |
| | | devpThread.setPakMk(staProtocol135.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocol135)); |
| | | |
| | | StaProtocol staProtocolnew = new StaProtocol(); |
| | | staProtocolnew.setSiteId(staProtocol135.getSiteId()); |
| | | staProtocolnew.setWorkNo(workNo); |
| | | staProtocolnew.setStaNo(144); |
| | | |
| | | devpThread.setPakMk(staProtocolnew.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocolnew)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败==>驱动码垛位托盘前进失败!"); |
| | | } |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(4, staProtocol135)); |
| | | // boolean result2 = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(4, staProtocol135)); |
| | | |
| | | } |
| | | } |