From 8156f99eafc98745f44db70a910ba89873d2f9d4 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 25 Oct 2024 18:28:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-137540=20-=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E4=B8=8B=E5=9C=B0=E5=9B=BE=E5=8A=A0=E8=BD=BD=E5=8D=A1?= =?UTF-8?q?=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/map/DesignGEOJSONHelper.java | 36 +++++++++++++++++++ .../function/DesignChartBaseComponent.java | 4 +++ 2 files changed, 40 insertions(+) create mode 100644 designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java diff --git a/designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java b/designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java new file mode 100644 index 0000000000..740ccd72b2 --- /dev/null +++ b/designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java @@ -0,0 +1,36 @@ +package com.fanruan.map; + +import com.fr.decision.webservice.v10.map.geojson.MapDataType; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.apache.commons.lang3.time.StopWatch; +import com.fr.workspace.server.repository.map.MapRepository; + +/** + * 设计器地图资源Helper + * + * @author Destiny.Lin + * @since 11.0 + * Created on 2024/9/27 + */ +public class DesignGEOJSONHelper extends GEOJSONHelper { + + @Override + protected void init() { + try { + + StopWatch watch = new StopWatch(); + watch.start(); + URL_JSON_MAP.putAll(MapRepository.getInstance().getMapResource(GEOJSONUtils.getMapDataTypePath(MapDataType.GEOGRAPHIC))); + URL_JSON_MAP.putAll(MapRepository.getInstance().getMapResource(GEOJSONUtils.getMapDataTypePath(MapDataType.IMAGE))); + + FineLoggerFactory.getLogger().info("Load chart map resources spend time {} ms", watch.getTime()); + watch.stop(); + + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + +} diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java index 3a41a04c13..daf742e338 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java @@ -1,11 +1,14 @@ package com.fanruan.boot.env.function; import com.fanruan.boot.ChartBaseComponent; +import com.fanruan.carina.Carina; import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Supplemental; +import com.fanruan.map.DesignGEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelperShell; /** @@ -42,6 +45,7 @@ public class DesignChartBaseComponent extends ChartBaseComponent { @Supplemental public void prepare() { super.prepare(); + Carina.getApplicationContext().singleton(GEOJSONHelperShell.class).set(DesignGEOJSONHelper.class); } }