| | |
| | | break; |
| | | } |
| | | ReportDataLog reportDataLog = new ReportDataLog(); |
| | | String fail = null; |
| | | if (!doHttpRequest(data.getReportJson(), mesTokenInfo, data.getMemo(), url, mesPath, null, "127.0.0.1")) { |
| | | fail = "fail"; |
| | | } |
| | | String result = doHttpRequest(data.getReportJson(), mesTokenInfo, data.getMemo(), url, mesPath, null, "127.0.0.1"); |
| | | reportDataService.deleteById(data.getId()); |
| | | BeanUtil.copyProperties(data, reportDataLog); |
| | | reportDataLog.setReportTime(new Date()); |
| | | reportDataLog.setReportDataId(data.getId()); |
| | | reportDataLog.setThreeCode(fail); |
| | | reportDataLog.setThreeCode(result); |
| | | reportDataLogService.insert(reportDataLog); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | |
| | | private Boolean doHttpRequest(String requestParam, Map<String, Object> headParam, String namespace, String url, String path, String appkey, String ip) { |
| | | String response = ""; |
| | | private String doHttpRequest(String requestParam, Map<String, Object> headParam, String namespace, String url, String path, String appkey, String ip) { |
| | | String response = "false"; |
| | | boolean success = false; |
| | | |
| | | try { |
| | |
| | | throw new CoolException("mes接口调用失败,返回信息:" + jsonObject); |
| | | } |
| | | success = true; |
| | | return true; |
| | | return "true"; |
| | | |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | |
| | | } finally { |
| | | apiLogService.save(namespace, url + path, appkey, ip, requestParam, response, success); |
| | | } |
| | | return false; |
| | | return response; |
| | | } |
| | | } |