| | |
| | | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | staProtocol.setWorkNo((short) 9998); |
| | | staProtocol.setStaNo((short)14); |
| | | staProtocol.setStaNo((short) 14); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // led 异常显示 |
| | |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, successMsg)); |
| | | } else { |
| | | staProtocol.setWorkNo((short) 9998); |
| | | staProtocol.setStaNo((short)14); |
| | | staProtocol.setStaNo((short) 14); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (ledThread != null) { |
| | |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | if(!Cools.isEmpty(barcode) && (staProtocol.getWorkNo() != 9998 || staProtocol.getWorkNo() != 9996 )) { |
| | | if (!Cools.isEmpty(barcode) && (staProtocol.getWorkNo() != 9998 || staProtocol.getWorkNo() != 9996)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | staProtocol.setWorkNo((short) 9998); |
| | | staProtocol.setStaNo((short)14); |
| | | staProtocol.setStaNo((short) 14); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // led 异常显示 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // // 入出库模式判断 |
| | | // if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; } |
| | | |
| | |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() |
| | | && ( staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9997 || staProtocol.getWorkNo() == 9995) |
| | | && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9997 || staProtocol.getWorkNo() == 9995) |
| | | && staProtocol.isPakMk()) { |
| | | |
| | | WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); |
| | |
| | | // 获取LED线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId()); |
| | | // 相同工作号集合则过滤 |
| | | if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) { |
| | | continue; |
| | | } |
| | | // if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) { |
| | | // continue; |
| | | // } |
| | | // 命令下发 ------------------------------------------------------------------------------- |
| | | if (!commands.isEmpty()) { |
| | | if (led.getId() == 7) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) { |
| | | log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } else { |
| | | ledThread.setLedMk(false); |
| | | } |
| | | String errMsg = ""; |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) { |
| | | log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } else { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } else { |
| | | ledThread.setLedMk(false); |
| | | } |
| | | ledThread.setLedMk(false); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | JSONObject data = (JSONObject) jsonObject.get("data"); |
| | | log.info((String) data.get("msg")); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1","", response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1", "", response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |