| | |
| | | orderMesXGHYParam.setBarcode(String.valueOf(snowflakeIdWorker.nextId())); |
| | | orderMesXGHYParam.setPalletizingNo(1); |
| | | |
| | | System.out.println(orderMesXGHYParam.toString()); |
| | | |
| | | |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PAKIN_URL) |
| | | .setJson(JSON.toJSONString(orderMesXGHYParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(orderMesXGHYParam), response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "成品库入库上报", |
| | | MesConstant.URL + MesConstant.PAKIN_URL, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(orderMesXGHYParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | // System.out.println(orderMesXGHYParam.toString()); |
| | | return SUCCESS; |
| | | } |
| | | |