| | |
| | | private int doHttpRequest(Object requestParam, String namespace, String url, String path, String appkey, String ip) { |
| | | String response = ""; |
| | | boolean success = false; |
| | | int code =0; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(url) |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | int code = Integer.parseInt(jsonObject.get("code").toString()); |
| | | code = Integer.parseInt(jsonObject.get("code").toString()); |
| | | if (code != 0) { |
| | | if (code == 6) { |
| | | log.info("AGV任务单号已上报:{}", response); |
| | |
| | | throw new CoolException("调用AGV响应错误"); |
| | | //return 1; |
| | | } finally { |
| | | apiLogService.save( |
| | | namespace, |
| | | url + path, |
| | | appkey, |
| | | ip, |
| | | JSON.toJSONString(JSONObject.toJSONString(requestParam)), |
| | | response, |
| | | success |
| | | ); |
| | | if(code !=6){ |
| | | apiLogService.save( |
| | | namespace, |
| | | url + path, |
| | | appkey, |
| | | ip, |
| | | JSON.toJSONString(JSONObject.toJSONString(requestParam)), |
| | | response, |
| | | success |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | if (!b) { |
| | | log.info("更新任务状态失败,{}", agvWrkMast.getWrkNo()); |
| | | throw new CoolException("更新任务状态失败"); |
| | | }else { |
| | | log.info("更新任务状态成功,{}", agvWrkMast.getWrkNo()); |
| | | } |
| | | if (agvWrkMast.getIoType() == 1) { |
| | | //修改AGV入库通知档状态入出状态为Y |