自动化立体仓库 - WMS系统
1
zhang
2 天以前 5ceb1fc9be10e20d1f6e59382b2d14c8034485cf
src/main/java/com/zy/asrs/controller/AgvLocMastController.java
@@ -159,48 +159,48 @@
        if (!agvLockMastService.updateById(locMast)) {
            throw new CoolException("主库位修改失败");
        } else {
            try {
                if (locMast.getLocSts().equals("O")) {
                    HashMap<String, String> data = new HashMap<>();
                    data.put("reqCode", System.currentTimeMillis() + "");
                    data.put("podCode", barcode);
                    data.put("positionCode", locMast.getLocNo());
                    data.put("indBind", "0");
                    String response = "";
                    boolean success = false;
                    int code = 0;
                    try {
                        response = new HttpHandler.Builder()
                                .setUri(url)
                                .setPath(locStsUrl)
                                .setTimeout(30, TimeUnit.SECONDS)
                                .setJson(JSONObject.toJSONString(data))
                                .build()
                                .doPost();
                        JSONObject jsonObject = JSON.parseObject(response);
                        code = Integer.parseInt(jsonObject.get("code").toString());
                        if (code != 0) {
                            log.info("库位解绑AGV接口调用失败,返回信息:" + response);
                        } else {
                            success = true;
                        }
                    } catch (Exception e) {
                        throw new CoolException("调用AGV响应错误");
                    } finally {
                        apiLogService.save(
                                "货架与位置解绑",
                                url + locStsUrl,
                                null,
                                "127.0.0.1",
                                JSON.toJSONString(data),
                                response,
                                success
                        );
                    }
                }
            } catch (Exception e) {
            }
//            try {
//                if (locMast.getLocSts().equals("O")) {
//                    HashMap<String, String> data = new HashMap<>();
//                    data.put("reqCode", System.currentTimeMillis() + "");
//                    data.put("podCode", barcode);
//                    data.put("positionCode", locMast.getLocNo());
//                    data.put("indBind", "0");
//                    String response = "";
//                    boolean success = false;
//                    int code = 0;
//                    try {
//                        response = new HttpHandler.Builder()
//                                .setUri(url)
//                                .setPath(locStsUrl)
//                                .setTimeout(30, TimeUnit.SECONDS)
//                                .setJson(JSONObject.toJSONString(data))
//                                .build()
//                                .doPost();
//                        JSONObject jsonObject = JSON.parseObject(response);
//                        code = Integer.parseInt(jsonObject.get("code").toString());
//                        if (code != 0) {
//                            log.info("库位解绑AGV接口调用失败,返回信息:" + response);
//                        } else {
//                            success = true;
//                        }
//                    } catch (Exception e) {
//                        throw new CoolException("调用AGV响应错误");
//                    } finally {
//                        apiLogService.save(
//                                "货架与位置解绑",
//                                url + locStsUrl,
//                                null,
//                                "127.0.0.1",
//                                JSON.toJSONString(data),
//                                response,
//                                success
//                        );
//                    }
//                }
//            } catch (Exception e) {
//
//            }
        }
        return R.ok();
    }