| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject != null && jsonObject.getInteger("code") != null && jsonObject.getInteger("code") == 200) { |
| | | log.info("入库任务申请成功,等待WMS下发任务。条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | staProtocol.setWorkNo(9998);//设置为9998等待上位机下发任务/9997是空板入库判断,待下发时也写入9998 |
| | | staProtocol.setStaNo((short)0); |
| | | staProtocol.setWorkNo(0);//设置为9998等待上位机下发任务/9997是空板入库判断,待下发时也写入9998 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | Thread.sleep(300); |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol2 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol2 = staProtocol2.clone(); |
| | | } |
| | | staProtocol2.setStaNo(inSta.getStaNo().shortValue()); |
| | | staProtocol2.setWorkNo(9998);//设置为9998等待上位机下发任务/9997是空板入库判断,待下发时也写入9998 |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol2)); |
| | | if (!result2) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | } else { |
| | | // // 获取工作号 |
| | | int workNo = commonService.getWorkNo(3); |