浏览代码

缩略图功能

chenw 6 年之前
父节点
当前提交
f85bde6feb

+ 5 - 6
bi-server/src/main/java/com/usoftchina/bi/server/dao/chart/ChartsConfigMapper.java

@@ -15,14 +15,12 @@ import java.util.Map;
 
 @Mapper
 @Repository
-@CacheNamespace(flushInterval = 300000L)
 public interface ChartsConfigMapper {
 
     @Insert("insert into bi_charts(id,CHART_NAME,CHART_TYPE,BD_DATA_ID,CHART_CONFIG,GROUP_BY,ACCESS_AUTHORITY,UPDATE_AUTHORITY,BC_CHARTS_GROUP,CHART_DESCRIBES,BC_CHART_STYLE," +
-            "create_by,create_date, bc_charts_option, create_id, BC_FETCHCONFIG, from_id, from_data_id) " +
+            "create_by,create_date, bc_charts_option, create_id, BC_FETCHCONFIG, from_id, from_data_id,thumbnail) " +
             "VALUES (#{chartId,jdbcType=INTEGER},#{chartName,jdbcType=VARCHAR},#{chartType,jdbcType=VARCHAR}, #{dataId,jdbcType=INTEGER}, #{chartConfig,jdbcType=VARCHAR}, #{groupBy,jdbcType=VARCHAR}, #{accessAuthority,jdbcType=VARCHAR}, #{updateAuthority,jdbcType=VARCHAR}, #{chartsGroup,jdbcType=INTEGER}," +
-            "#{describes,jdbcType=VARCHAR},#{style,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'),  #{chartOption,jdbcType=VARCHAR}, #{createId,jdbcType=INTEGER}, #{fetchConfig,jdbcType=VARCHAR},#{from_id,jdbcType=INTEGER},#{from_data_id,jdbcType=INTEGER})" )
-//    @Options(useGeneratedKeys=false, keyProperty = "chartId",keyColumn = "id")
+            "#{describes,jdbcType=VARCHAR},#{style,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'),  #{chartOption,jdbcType=VARCHAR}, #{createId,jdbcType=INTEGER}, #{fetchConfig,jdbcType=VARCHAR},#{from_id,jdbcType=INTEGER},#{from_data_id,jdbcType=INTEGER},#{thumbnail,jdbcType=CLOB})" )
     @SelectKey(before=true,keyProperty="chartId",resultType=Integer.class,statement="SELECT bi_charts_sequence.nextval from dual",keyColumn = "id")
     void insertCharts(ChartConfig chartConfig);
 
@@ -49,7 +47,7 @@ public interface ChartsConfigMapper {
     查看图表列表
      */
     @Select("select '1' as authority,case when bc.BD_DATA_ID not in(select id from bi_data_connectors) then '1' else '0' end dbStatus, bc.id as chartId, bc.chart_name as chartName, bc.chart_type as chartType, bc.create_by as createBy, bc.create_date as createDate"
-            + ",bc.bc_filters as filters, bc.CHART_DESCRIBES as describes, bc.bc_charts_group as chartsGroup, bc.bc_charts_option as chartOption ,bc.bd_data_id as dataId,bd.data_name as dataName, bc.create_id as createId, bc.demo, bds.BASES_NAME as dataConnectionName, bds.id as dataConnectionId "
+            + ",bc.bc_filters as filters, bc.CHART_DESCRIBES as describes, bc.bc_charts_group as chartsGroup, bc.bc_charts_option as chartOption ,bc.bd_data_id as dataId,bd.data_name as dataName, bc.create_id as createId, bc.demo, bds.BASES_NAME as dataConnectionName, bds.id as dataConnectionId, bc.thumbnail as thumbnail "
             + "from bi_charts bc left join bi_data_connectors bd on bc.bd_data_id=bd.id left join BI_DATABASES bds on bds.id = BD.DB_CONFIG")
     List<ChartConfigList> getListCharts();
 
@@ -97,7 +95,7 @@ public interface ChartsConfigMapper {
             "        ) and bs2.BS_DB_ID = bc.BD_DATA_ID" +
             "    ) = 0 then '0'" +
             "    else null end authority, case when bc.BD_DATA_ID not in(select id from bi_data_connectors) then '1' else '0' end dbStatus, bc.id as chartId, bc.chart_name as chartName, bc.chart_type as chartType, bc.create_by as createBy, bc.create_date as createDate" +
-            "    ,bc.bc_filters as filters, bc.CHART_DESCRIBES as describes, bc.bc_charts_group as chartsGroup, bc.bc_charts_option as chartOption ,bc.bd_data_id as dataId,bd.data_name as dataName, bc.create_id as createId, bc.demo, bds.BASES_NAME as dataConnectionName, bds.id as dataConnectionId " +
+            "    ,bc.bc_filters as filters, bc.CHART_DESCRIBES as describes, bc.bc_charts_group as chartsGroup, bc.bc_charts_option as chartOption ,bc.bd_data_id as dataId,bd.data_name as dataName, bc.create_id as createId, bc.demo, bds.BASES_NAME as dataConnectionName, bds.id as dataConnectionId,bc.thumbnail as thumbnail " +
             "     from bi_charts bc left join bi_data_connectors bd on bc.bd_data_id=bd.id left join BI_DATABASES bds on bds.id = BD.DB_CONFIG where (bc.create_id = #{id} or bc.id in (" +
             "      select bc_chart_id from bi_chart_strategys where BC_ID in (" +
             "        select BO_ST_ID from BI_CHART_OBJECT where (BO_TYPE='1' and BO_OB_ID = #{id})" +
@@ -152,6 +150,7 @@ public interface ChartsConfigMapper {
             "<if test=\"chartOption !=null\">, bc_charts_option = #{chartOption}</if>"+
             "<if test=\"fetchConfig !=null\">, BC_FETCHCONFIG = #{fetchConfig}</if>"+
             "<if test=\"updateDate != null\"> , UPDATE_DATE = to_date(#{updateDate},'YYYY-MM-DD hh24:mi:ss') </if>" +
+            "<if test=\"thumbnail != null\"> , thumbnail = #{thumbnail} </if>" +
             "where id = #{chartId}" +
             "</script>")
     void updateChartConfig(ChartConfig chartConfig);

+ 0 - 1
bi-server/src/main/java/com/usoftchina/bi/server/dao/chart/ShowChartsMapper.java

@@ -15,7 +15,6 @@ import java.util.Map;
 
 @Mapper
 @Repository
-@CacheNamespace(flushInterval = 300000L)
 public interface ShowChartsMapper {
     /*
     查询X轴列数

+ 9 - 0
bi-server/src/main/java/com/usoftchina/bi/server/model/po/ChartConfig.java

@@ -30,6 +30,15 @@ public class ChartConfig implements Serializable{
     private String dataConnectionName;
     private Integer from_id;//复制来源ID
     private Integer from_data_id;//复制数据源ID
+    private String thumbnail;
+
+    public String getThumbnail() {
+        return thumbnail;
+    }
+
+    public void setThumbnail(String thumbnail) {
+        this.thumbnail = thumbnail;
+    }
 
     public Integer getFrom_id() {
         return from_id;

+ 9 - 0
bi-server/src/main/java/com/usoftchina/bi/server/model/po/ChartConfigList.java

@@ -23,6 +23,15 @@ public class ChartConfigList implements Serializable{
     private boolean demo;
     private String dataConnectionId;
     private String dataConnectionName;
+    private String thumbnail;
+
+    public String getThumbnail() {
+        return thumbnail;
+    }
+
+    public void setThumbnail(String thumbnail) {
+        this.thumbnail = thumbnail;
+    }
 
     public String getDataConnectionId() {
         return dataConnectionId;

+ 9 - 0
bi-server/src/main/java/com/usoftchina/bi/server/model/vo/configVo/ChartConfigInfo.java

@@ -24,6 +24,15 @@ public class ChartConfigInfo {
     private String filters;          //筛选
     private String chartOption;      //列表缩略图数据
     private String fetchConfig;         //保存请求数据信息
+    private String thumbnail;
+
+    public String getThumbnail() {
+        return thumbnail;
+    }
+
+    public void setThumbnail(String thumbnail) {
+        this.thumbnail = thumbnail;
+    }
 
     public String getFetchConfig() {
         return fetchConfig;

+ 0 - 1
bi-server/src/main/java/com/usoftchina/bi/server/service/chart/ChartsConfigService.java

@@ -89,7 +89,6 @@ public class ChartsConfigService {
         if (chartConfig.getStyle() == null){
             chartConfig.setStyle("");
         }
-
         chartsConfigMapper.insertCharts(chartConfig);
         int id = chartConfig.getChartId();