| | |
| | | } |
| | | String response; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PACK_DOWN_URL) |
| | | .setJson(JSON.toJSONString(mesCombParam)) |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | log.info("请求接口成功!!!"); |
| | | } else if (jsonObject.getInteger("code").equals(500)) { |
| | | } else if (jsonObject.getInteger("code").equals(500)) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException(jsonObject.getString("msg")); |
| | | } else { |
| | |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | e.printStackTrace(); |
| | | throw new CoolException("上报mes系统失败"); |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | |
| | | } |