Junjie
2024-08-30 77ab0bff6c81109f2b8f8353d08e625abbcc4b8b
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -500,32 +500,36 @@
            if (!taskService.updateById(task)) {
                News.error("更新工作档失败!!! [工作号:{}]", task.getTaskNo());
            }else {
                if ("0601".equals(task.getMemo().substring(0,4))){
                    String response = "";
                    Map<String, Object> headers = new HashMap<>();
                    headers.put("Content-Type", "application/json;charset=UTF-8");
                    headers.put("X-lr-request-id", task.getWmsTaskNo());
                    headers.put("X-lr-version", 4.1);
                    headers.put("X-lr-trace-id", "{{$guid}}");
                try {
                    if ("0601".equals(task.getMemo().substring(0, 4))) {
                        String response = "";
                        Map<String, Object> headers = new HashMap<>();
                        headers.put("Content-Type", "application/json;charset=UTF-8");
                        headers.put("X-lr-request-id", task.getWmsTaskNo());
                        headers.put("X-lr-version", 4.1);
                        headers.put("X-lr-trace-id", "{{$guid}}");
                    Map<String, Object> map = new HashMap<>();
                    map.put("carrierCode",task.getZpallet());
                    map.put("siteCode","06YZ0001");
                    map.put("extra",null);
                    try {
                        response = new HttpHandler.Builder()
                                .setHeaders(headers)
                                .setUri("172.18.16.248:443")
                                .setHttps(true)
                                .setPath("/rcs/rtas/api/robot/controller/carrier/unbind")
                                .setJson(JSONObject.toJSONString(map))
                                .build()
                                .doPost();
                        JSONObject jsonObject = JSON.parseObject(response);
                        log.info("agv解绑箱号,请求体:"+JSONObject.toJSONString(map)+",返回:"+response);
                    }catch (Exception e){
                        log.info("agv解绑箱号请求报错"+e.getMessage());
                        Map<String, Object> map = new HashMap<>();
                        map.put("carrierCode", task.getZpallet());
                        map.put("siteCode", "06YZ0001");
                        map.put("extra", null);
                        try {
                            response = new HttpHandler.Builder()
                                    .setHeaders(headers)
                                    .setUri("172.18.16.248:443")
                                    .setHttps(true)
                                    .setPath("/rcs/rtas/api/robot/controller/carrier/unbind")
                                    .setJson(JSONObject.toJSONString(map))
                                    .build()
                                    .doPost();
                            JSONObject jsonObject = JSON.parseObject(response);
                            log.info("agv解绑箱号,请求体:" + JSONObject.toJSONString(map) + ",返回:" + response);
                        } catch (Exception e) {
                            log.info("agv解绑箱号请求报错" + e.getMessage());
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }