| | |
| | | |
| | | List<OpenOrderPakoutParam> paramList = new ArrayList<>(); |
| | | OpenOrderPakoutParam param = new OpenOrderPakoutParam(); |
| | | paramList.add(param); |
| | | // paramList.add(param); |
| | | |
| | | List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(order.getId()); |
| | | |
| | |
| | | bodyList.add(body); |
| | | } |
| | | |
| | | doHttpRequest(paramList, "上报ERP出库单据", url, orderReportPath, null, "127.0.0.1"); |
| | | doHttpRequest(param, "上报ERP出库单据", url, orderReportPath, null, "127.0.0.1"); |
| | | |
| | | orderService.updateSettle(order.getId(),6L,0L); |
| | | |
| | |
| | | private int doHttpRequest(Object requestParam, String namespace, String url, String path, String appkey, String ip){ |
| | | String response = ""; |
| | | boolean success = false; |
| | | |
| | | log.error(JSONObject.toJSONString(requestParam)); |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(url) |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | if(Cools.isEmpty(jsonObject.get("errCode"))){ |
| | | throw new CoolException(jsonObject.get("Message").toString()); |
| | | if(Cools.isEmpty(jsonObject.get("ErrorCode"))){ |
| | | throw new CoolException(jsonObject.get("ErrorMsg").toString()); |
| | | } |
| | | |
| | | int code = (int) jsonObject.get("errCode"); |
| | | if(code != 0){ |
| | | throw new CoolException(jsonObject.get("errMsg").toString()); |
| | | int code = Integer.parseInt(jsonObject.get("ErrorCode").toString()) ; |
| | | if(code == 0){ |
| | | throw new CoolException(jsonObject.get("ErrorMsg").toString()); |
| | | } |
| | | success = true; |
| | | return code; |