| | |
| | | slapLightControlParam.setControllerCode(cacheSite.getMemo()).setTagCode(cacheSite.getSiteNo())
|
| | | .setColor("GREEN").setMode("LIGHT").setDisplay(String.valueOf(sum));
|
| | | // 发起亮灯请求
|
| | | log.info("任务{}到达拣选位,播种墙亮灯下发",task.getTaskNo(), JSONObject.toJSONString(slapLightControlParam));
|
| | | CommonReponse response = HttpEssUtils.post("到达拣选位,播种墙亮灯", HttpEssUtils.PLT_SEND_COMMAND, slapLightControlParam);
|
| | | if (response.getCode().equals(0)) {
|
| | | log.info("任务{}到达拣选位,播种墙{}亮灯成功",task.getTaskNo(),cacheSite.getSiteNo());
|
| | |
| | | tasks.forEach(task -> {
|
| | | try {
|
| | | ConveyorStarParam conveyorStarParam = new ConveyorStarParam();
|
| | | conveyorStarParam.setSlotCode(task.getOriginLoc())
|
| | | conveyorStarParam.setSlotCode(task.getOriginSite())
|
| | | .setContainerCode(task.getBarcode());
|
| | | if (task.getTaskType() == 101) { //任务类型为101全盘出库,直接取下容器,传200
|
| | | conveyorStarParam.setDirection("200");
|
| | |
| | | //调用三方接口,将任务推送至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("下发流动通知失败!!");
|