|
|
|
@ -19,6 +19,8 @@ import com.fr.stable.xml.XMLPrintWriter;
|
|
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
|
import com.fr.third.joda.time.DateTime; |
|
|
|
|
|
|
|
|
|
import java.text.DateFormat; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@ -27,7 +29,7 @@ import java.util.Map;
|
|
|
|
|
* @version 10.0 |
|
|
|
|
* Created by Bjorn on 2020-02-17 |
|
|
|
|
*/ |
|
|
|
|
public class ChartInfo extends AbstractPointInfo { |
|
|
|
|
public class ChartInfo extends AbstractPointInfo implements Comparable<ChartInfo> { |
|
|
|
|
public static final String XML_TAG = "ChartInfo"; |
|
|
|
|
private static final String CHART_CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("chartinfo.consuming") + "/single"; |
|
|
|
|
private static final String CHART_FUNCTION_URL = CloudCenter.getInstance().acquireUrlByKind("chart.info.function") + "/single"; |
|
|
|
@ -338,4 +340,19 @@ public class ChartInfo extends AbstractPointInfo {
|
|
|
|
|
chartInfo.chartConfigInfo = chartConfigInfo.clone(); |
|
|
|
|
return chartInfo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int compareTo(ChartInfo chartInfo) { |
|
|
|
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
try { |
|
|
|
|
return format.parse(this.getCompareDate()).compareTo(format.parse(chartInfo.getCompareDate())); |
|
|
|
|
} catch (Exception ex) { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getCompareDate() { |
|
|
|
|
return StringUtils.isNotEmpty(chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME)) ? |
|
|
|
|
chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME) : chartConsumingMap.get(ATTR_CHART_TYPE_TIME); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|