| | |
| | | //调用三方接口,将任务推送至ESS平台
|
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
| | | // 设置请求参数
|
| | | params.add("params", JSONObject.toJSONString(conveyorStarParam));
|
| | | log.info("请求地址:{},请求参数:{}", HttpEssUtils.CONVEYOR_START, JSONObject.toJSONString(conveyorStarParam));
|
| | | HttpHeaders headers = new HttpHeaders();
|
| | | headers.add("Content-Type", "application/json");
|
| | | HttpEntity httpEntity = new HttpEntity<>(params, headers);
|
| | | // 请求
|
| | | ResponseEntity<String> exchange = restTemplate.exchange(HttpEssUtils.CONVEYOR_START, HttpMethod.POST, httpEntity, String.class);
|
| | | headers.add("api-version", "v2.0");
|
| | | HttpEntity httpEntity = new HttpEntity<>(conveyorStarParam, headers);
|
| | | log.info("请求地址:{},请求参数:{}", HttpEssUtils.CONVEYOR_START, JSONObject.toJSONString(conveyorStarParam));
|
| | | ResponseEntity<String> exchange = restTemplate.exchange("http://192.168.2.200:9046/conveyor/moveContainer", HttpMethod.POST, httpEntity, String.class);
|
| | | // HttpHeaders headers = new HttpHeaders();
|
| | | // headers.add("Content-Type", "application/json");
|
| | | // HttpEntity httpEntity = new HttpEntity<>(params, headers);
|
| | | // // 请求
|
| | | // ResponseEntity<String> exchange = restTemplate.exchange(HttpEssUtils.CONVEYOR_START, HttpMethod.POST, httpEntity, String.class);
|
| | | log.info("下发流动通知 返回结果:{}", exchange);
|
| | | if (exchange.getBody() == null) {
|
| | | throw new CoolException("下发流动通知失败!!");
|