| | |
| | | @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) { |
| | | if (inSta.getStaNo().equals(103)) { |
| | | staProtocol.setWorkNo((short) 9996); |
| | | staProtocol.setStaNo((short) 203); |
| | | } |
| | | if (inSta.getStaNo().equals(203)) { |
| | | staProtocol.setWorkNo((short) 9996); |
| | | staProtocol.setStaNo((short) 103); |
| | | } |
| | | if (inSta.getStaNo().equals(113)) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo((short) 114); |
| | | } else if (inSta.getStaNo().equals(213)) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo((short) 214); |
| | | } |
| | | } 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)); |
| | | String data = jsonObject.getString("data"); |
| | | String msg = jsonObject.getString("msg"); |
| | | if (code == 500) { |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "检索库位失败,请检查库存剩余。===>>" + data + "--" + msg; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 1000) { |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "需要换入库站。"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | |
| | | // 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); |
| | | } |
| | | if (inSta.getStaNo().equals(203)) { |
| | | staProtocol.setWorkNo((short) 9996); |
| | | staProtocol.setStaNo((short) 103); |
| | | } |
| | | if (inSta.getStaNo().equals(113)) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo((short) 114); |
| | | } else if (inSta.getStaNo().equals(213)) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo((short) 214); |
| | | } |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | String data = jsonObject.getString("data"); |
| | | String msg = jsonObject.getString("msg"); |
| | | if (code == 500) { |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "检索库位失败,请检查库存剩余。===>>" + data + "--" + msg; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 1000) { |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "需要换入库站。"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | /** |
| | | * 让小车从 远点 ====>> 待机 |
| | | * 等待堆垛机搬运 |
| | | * 等待堆垛机搬运 |
| | | */ |
| | | public synchronized void letCarBeWaiting(WrkMast wrkMast, Integer steNo, String locNo) { |
| | | // 获取穿梭车信息 |
| | |
| | | |
| | | /** |
| | | * 让小车从 远点 ====>> 移动到近点 |
| | | * 等待堆垛机搬运 |
| | | * 等待堆垛机搬运 |
| | | */ |
| | | public synchronized void letCarBeReady(WrkMast wrkMast, Integer steNo, String locNo) { |
| | | // 获取穿梭车信息 |
| | |
| | | |
| | | /** |
| | | * 让小车从 远点 ====>> 移动到近点 |
| | | * 等待堆垛机搬运 |
| | | * 等待堆垛机搬运 |
| | | */ |
| | | public synchronized void letCarBeReady(WrkCharge wrkCharge, Integer steNo) { |
| | | // 获取穿梭车信息 |