forked from github/dataease
fix(仪表板、数据大屏): 修复部分富文本图表多次模板应用出现报错情况 #10384
This commit is contained in:
parent
7a9cc483ce
commit
041fe35920
@ -6,6 +6,7 @@ import io.dataease.exception.DEException;
|
||||
import io.dataease.template.dao.auto.entity.VisualizationTemplateExtendData;
|
||||
import io.dataease.template.dao.auto.mapper.VisualizationTemplateExtendDataMapper;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
import io.dataease.utils.LogUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -28,8 +29,15 @@ public class VisualizationTemplateExtendDataManage {
|
||||
queryWrapper.eq("view_id",viewId);
|
||||
List<VisualizationTemplateExtendData> extendDataList = extendDataMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(extendDataList)) {
|
||||
try{
|
||||
ChartViewDTO chartViewTemplate = JsonUtil.parseObject(extendDataList.get(0).getViewDetails(),ChartViewDTO.class);
|
||||
if(chartViewTemplate != null){
|
||||
view.setData(chartViewTemplate.getData());
|
||||
}
|
||||
}catch (Exception e){
|
||||
LogUtil.error("未获取内置数据:"+viewId);
|
||||
}
|
||||
|
||||
} else {
|
||||
DEException.throwException("模板缓存数据中未获取指定图表数据:" + viewId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user