| | |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if (jsonObject.getInteger("code").equals(700)){ |
| | | SearchLocParam param2 = new SearchLocParam(); |
| | | param2.setBarcode(barcode); |
| | | param2.setSourceStaNo(inSta.getStaNo()); |
| | | param2.setLocType1(locTypeDto.getLocType1()); |
| | | String response2 = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/yx/loc/v33") |
| | | .setJson(JSON.toJSONString(param2)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject2 = JSON.parseObject(response2); |
| | | if (jsonObject2.getInteger("code").equals(200)) { |
| | | log.info("大料箱自动组托成功!!"); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | } |
| | | // } else if (jsonObject.getInteger("code").equals(700)){ |
| | | // SearchLocParam param2 = new SearchLocParam(); |
| | | // param2.setBarcode(barcode); |
| | | // param2.setSourceStaNo(inSta.getStaNo()); |
| | | // param2.setLocType1(locTypeDto.getLocType1()); |
| | | // String response2 = new HttpHandler.Builder() |
| | | // .setUri(wmsUrl) |
| | | // .setPath("/rpc/pakin/yx/loc/v33") |
| | | // .setJson(JSON.toJSONString(param2)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject2 = JSON.parseObject(response2); |
| | | // if (jsonObject2.getInteger("code").equals(200)) { |
| | | // log.info("大料箱自动组托成功!!"); |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // |
| | | // if (ledThread != null) { |
| | | // ErrMsg errMsg1 = new ErrMsg(); |
| | | // errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | // errMsg1.setArea("1"); |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | // } |
| | | // } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | |
| | | String msg = jsonObject.getString("msg"); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()+"==》失败原因:"+msg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | |
| | | log.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNoOther()); |
| | | continue; |
| | | } |
| | | boolean signStanOther81 = false; |
| | | if (staProtocolOther.getWorkNo()!=0){ |
| | | WrkMast wrkMastOther = wrkMastMapper.selectPakInStep3(staProtocolOther.getWorkNo()); |
| | | if (Cools.isEmpty(wrkMastOther)){ |
| | |
| | | return; |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | return; |
| | | signStanOther81 = true; |
| | | crnStation=2; |
| | | } |
| | | StaProtocol staProtocolOther1 = devpThread.getStation().get(crnStn.getStaNoOther1()); |
| | | if (staProtocolOther1 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther1 = staProtocolOther1.clone(); |
| | | } |
| | | if (!signStanOther81){ |
| | | StaProtocol staProtocolOther1 = devpThread.getStation().get(crnStn.getStaNoOther1()); |
| | | if (staProtocolOther1 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther1 = staProtocolOther1.clone(); |
| | | } |
| | | |
| | | if (staProtocolOther1.isAutoing() && staProtocolOther1.getWorkNo()!=0){ |
| | | return; |
| | | } |
| | | if (staProtocolOther1.isAutoing() || staProtocolOther1.getWorkNo()!=0){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | StaProtocol staProtocolOther2 = devpThread.getStation().get(crnStn.getStaNoOther2()); |
| | | if (staProtocolOther2 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther2 = staProtocolOther2.clone(); |
| | | } |
| | | if (staProtocolOther2.isAutoing() && staProtocolOther2.getWorkNo()!=0){ |
| | | return; |
| | | StaProtocol staProtocolOther2 = devpThread.getStation().get(crnStn.getStaNoOther2()); |
| | | if (staProtocolOther2 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther2 = staProtocolOther2.clone(); |
| | | } |
| | | if (staProtocolOther2.isAutoing() || staProtocolOther2.getWorkNo()!=0){ |
| | | return; |
| | | } |
| | | } |
| | | crnStation = 2; |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | |
| | | } |
| | | } |
| | | |
| | | try{ |
| | | for (int idi = 1;idi<5;idi++){ |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, idi); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("测试:"+idi); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, idi, new Task(5, errMsg1)); |
| | | } try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | LedThread ledThread3 = (LedThread) SlaveConnection.get(SlaveType.Led, 3); |
| | | |
| | | if (ledThread3 != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("测试测试测试测试测试测试测试测试测试测试测试测试测试:"+3); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, 3, new Task(5, errMsg1)); |
| | | } try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | // try{ |
| | | // for (int idi = 1;idi<5;idi++){ |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, idi); |
| | | // |
| | | // if (ledThread != null) { |
| | | // ErrMsg errMsg1 = new ErrMsg(); |
| | | // errMsg1.setErrMsg("测试:"+idi); |
| | | // errMsg1.setArea("1"); |
| | | // MessageQueue.offer(SlaveType.Led, idi, new Task(5, errMsg1)); |
| | | // } try { |
| | | // Thread.sleep(500); |
| | | // } catch (Exception e){ |
| | | // |
| | | // } |
| | | // } |
| | | // LedThread ledThread3 = (LedThread) SlaveConnection.get(SlaveType.Led, 3); |
| | | // |
| | | // if (ledThread3 != null) { |
| | | // ErrMsg errMsg1 = new ErrMsg(); |
| | | // errMsg1.setErrMsg("测试测试测试测试测试测试测试测试测试测试测试测试测试:"+3); |
| | | // errMsg1.setArea("1"); |
| | | // MessageQueue.offer(SlaveType.Led, 3, new Task(5, errMsg1)); |
| | | // } try { |
| | | // Thread.sleep(500); |
| | | // } catch (Exception e){ |
| | | // |
| | | // } |
| | | // } catch (Exception e){ } |
| | | |
| | | |
| | | } |