diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index e6ef66e00..49ad7d6a3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -218,19 +218,14 @@ public class InformationCollector implements XMLReadable, XMLWriter { if (currentTime - lastTime <= DELTA) { return; } - boolean success; FineLoggerFactory.getLogger().info("Start sent function records to the cloud center..."); - success = queryAndSendOnePageFunctionContent(currentTime, lastTime, 0); + queryAndSendOnePageFunctionContent(currentTime, lastTime, 0); long page = (totalCount/PAGE_SIZE) + 1; for(int i=1; i focusPoints) { + private void sendThisPageFunctionContent(DataList focusPoints) { String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD); try { JSONObject jsonObject = dealWithSendFunctionContent(focusPoints); - return sendFunctionRecord(url, jsonObject); + sendFunctionRecord(url, jsonObject); } catch (JSONException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - return false; } private JSONObject dealWithSendFunctionContent(DataList focusPoints) throws JSONException { @@ -319,7 +312,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { return jsonArray; } - private boolean sendFunctionRecord(String url, JSONObject record) { + private void sendFunctionRecord(String url, JSONObject record) { boolean success = false; try { HashMap para = new HashMap<>(); @@ -327,10 +320,14 @@ public class InformationCollector implements XMLReadable, XMLWriter { para.put("content", record); String res = HttpToolbox.post(url, para); success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); + if (success) { + this.lastTime = dateToString(); + } else { + FineLoggerFactory.getLogger().error("Error occured when sent function records to the cloud center."); + } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - return success; } private FunctionRecord getOneRecord(FocusPoint focusPoint) {