| | |
| | | @Autowired |
| | | private WaitPakinMapper waitPakinMapper; |
| | | |
| | | private Map<String, Integer> flagData = new HashMap<>(); |
| | | |
| | | /** |
| | | * 组托 |
| | | * 入库站,根据条码扫描生成入库工作档,工作状态 2 |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | Object redata = jsonObject.get("data"); |
| | | if (code.equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | // plc 处理 |
| | |
| | | // } |
| | | // } |
| | | // News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | }else if (code == 800) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = barcode + "没有对应空库位"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | else if (code == 700) { |
| | | } else if (code == 700) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | |
| | | String errorMsg = barcode + "托盘识别异常,请先进行组托!"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 500 || code == 1000) { |
| | | } else if (redata.toString().contains("物料类型和实际种类不一致")) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = barcode + "物料类型和实际种类不一致!"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if ((code == 500 || code == 1000)) { |
| | | if (redata != null && redata.toString().startsWith("800")) { |
| | | Integer num = flagData.get(param.getBarcode()); |
| | | if (num != null) { |
| | | flagData.put(param.getBarcode(), num + 1); |
| | | } else { |
| | | flagData.put(param.getBarcode(), 1); |
| | | } |
| | | } |
| | | if (flagData.get(param.getBarcode()) != null && flagData.get(param.getBarcode()) >= 2) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null && redata != null) { |
| | | String errorMsg = barcode + redata.toString(); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else { |
| | | if (inSta.getStaNo().equals(103)) { |
| | | staProtocol.setWorkNo((short) 9996); |
| | | staProtocol.setStaNo((short) 203); |
| | |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |