自动化立体仓库 - WMS系统
zhangc
2024-12-20 b17fe3091ae104984347622eb9db40765b5d025c
src/main/java/com/zy/asrs/task/handler/ReportDataHandler.java
@@ -76,19 +76,23 @@
                    mesPath = orderReportPath;
                    break;
            }
            doHttpRequest(data.getReportJson(), mesTokenInfo, data.getMemo(), url, mesPath, null, "127.0.0.1");
            reportDataService.deleteById(data.getId());
            ReportDataLog reportDataLog = new ReportDataLog();
            String fail = null;
            if (!doHttpRequest(data.getReportJson(), mesTokenInfo, data.getMemo(), url, mesPath, null, "127.0.0.1")) {
                fail = "fail";
            }
            reportDataService.deleteById(data.getId());
            BeanUtil.copyProperties(data, reportDataLog);
            reportDataLog.setReportTime(new Date());
            reportDataLog.setReportDataId(data.getId());
            reportDataLog.setThreeCode(fail);
            reportDataLogService.insert(reportDataLog);
        }
        return SUCCESS;
    }
    private JSONObject doHttpRequest(String requestParam, Map<String, Object> headParam, String namespace, String url, String path, String appkey, String ip) {
    private Boolean doHttpRequest(String requestParam, Map<String, Object> headParam, String namespace, String url, String path, String appkey, String ip) {
        String response = "";
        boolean success = false;
@@ -102,14 +106,14 @@
                throw new CoolException("mes接口调用失败,返回信息:" + jsonObject);
            }
            success = true;
            return jsonObject;
            return true;
        } catch (Exception e) {
            log.error(e.getMessage());
            throw new CoolException(e.getMessage());
            //throw new CoolException(e.getMessage());
        } finally {
            apiLogService.save(namespace, url + path, appkey, ip, requestParam, response, success);
        }
        return false;
    }
}