Merge pull request #11033 from dataease/pr@dev-v2@fix_compress-error

fix: 修复编译错误
This commit is contained in:
王嘉豪 2024-07-19 08:33:29 +08:00 committed by GitHub
commit 6e6dcd919b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,27 @@
package io.dataease.visualization.utils;
import io.dataease.extensions.view.dto.ChartViewDTO;
import io.dataease.utils.JsonUtil;
import java.util.HashMap;
import java.util.Map;
public class VisualizationUtils {
public static Map<Long,String> viewTransToStr(Map<Long, ChartViewDTO> source ){
Map<Long,String> result = new HashMap<>();
source.forEach((key,value) ->{
result.put(key, (String)JsonUtil.toJSONString(value));
});
return result;
}
public static Map<Long,ChartViewDTO> viewTransToObj (Map<Long, String> source ){
Map<Long,ChartViewDTO> result = new HashMap<>();
source.forEach((key,value) ->{
result.put(key, JsonUtil.parseObject(value,ChartViewDTO.class));
});
return result;
}
}