Browse Source

Pull request #15208: REPORT-137540 - 远程设计下地图加载卡慢

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/master to fbp/master

* commit '480148d56c5284c8b831d8ec5703010b50630bd0':
  REPORT-137540 - 远程设计下地图加载卡慢
fbp/master
Destiny.Lin-林锦龙 1 month ago
parent
commit
0b17dcdac4
  1. 36
      designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java
  2. 4
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java

36
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);
}
}
}

4
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java vendored

@ -1,11 +1,14 @@
package com.fanruan.boot.env.function; package com.fanruan.boot.env.function;
import com.fanruan.boot.ChartBaseComponent; import com.fanruan.boot.ChartBaseComponent;
import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Stop;
import com.fanruan.carina.annotions.Supplemental; 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 @Supplemental
public void prepare() { public void prepare() {
super.prepare(); super.prepare();
Carina.getApplicationContext().singleton(GEOJSONHelperShell.class).set(DesignGEOJSONHelper.class);
} }
} }

Loading…
Cancel
Save