|  |  | 
 |  |  |         for (DevpSlave devp : slaveProperties.getDevp()) { | 
 |  |  |             // 遍历入库口 | 
 |  |  |             for (DevpSlave.Sta inSta : devp.getInSta()) { | 
 |  |  |                 // 获取条码扫描仪信息 | 
 |  |  |                 BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); | 
 |  |  |                 BarcodeThread barcodeThreadMat = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcodeMat()); | 
 |  |  |  | 
 |  |  |                 LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
 |  |  |                 SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); | 
 |  |  |                 StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); | 
 |  |  | 
 |  |  |                 } else { | 
 |  |  |                     staProtocol = staProtocol.clone(); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (barcodeThread == null) { | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (barcodeThreadMat == null) { | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 // 判断是否满足入库条件 | 
 |  |  |                 if (staProtocol.stateType == DevpStateType.AUTO //自动 | 
 |  |  |                         && staProtocol.workType == DevpWorkType.BUSY //忙碌 | 
 |  |  | 
 |  |  |                             } | 
 |  |  |                             continue; | 
 |  |  |                         } | 
 |  |  |                         barcodeThread.setBarcode(""); | 
 |  |  |                         staProtocol.setWorkNo(wrkMast.getWrkNo()); | 
 |  |  |                         staProtocol.setStaNo(RouteUtils.SouStaEnd(null,wrkMast.getSourceStaNo())); | 
 |  |  |                         devpThread.setPakMk(staProtocol.getSiteId(), false); | 
 |  |  | 
 |  |  |                         JSONObject jsonObject = JSON.parseObject(response); | 
 |  |  |                         if (jsonObject.getInteger("code").equals(200)) { | 
 |  |  |                             StartupDto dto = jsonObject.getObject("data", StartupDto.class); | 
 |  |  |                             barcodeThread.setBarcode(""); | 
 |  |  |                             staProtocol.setWorkNo(dto.getWorkNo()); | 
 |  |  |                             staProtocol.setStaNo(RouteUtils.SouStaEnd(dto.getStaNo(),dto.getSourceStaNo())); | 
 |  |  |                             devpThread.setPakMk(staProtocol.getSiteId(), false); | 
 |  |  | 
 |  |  |                                 throw new CoolException("更新plc站点信息失败"); | 
 |  |  |                             } | 
 |  |  |                         }else { | 
 |  |  |                             staProtocol.setWorkNo(wrkNo); | 
 |  |  |                             wrkNo++; | 
 |  |  |                             staProtocol.setStaNo(inSta.getBackSta().shortValue()); | 
 |  |  |                             devpThread.setPakMk(staProtocol.getSiteId(), false); | 
 |  |  |                             MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
 |  |  | // | 
 |  |  | //                            if (ledThread != null) { | 
 |  |  |                                 String errorMsg = jsonObject.getString("msg"); | 
 |  |  |                                 if (!Cools.isEmpty(errorMsg)) { |