自动化立体仓库 - WMS系统
*
lsh
7 小时以前 57bc50d2b95f2a2fef0d70f3e84bdd3ef2b3bc7f
*
1个文件已修改
37 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -245,7 +245,42 @@
        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;
    }