更新了api-extensions_view模块
This commit is contained in:
parent
81e9d6f4ca
commit
54f6f6cdea
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>io.gisbi</groupId>
|
<groupId>io.gisbi</groupId>
|
||||||
<artifactId>extensions</artifactId>
|
<artifactId>extensions</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>2.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>extensions-view</artifactId>
|
<artifactId>extensions-view</artifactId>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.gisbi</groupId>
|
<groupId>io.gisbi</groupId>
|
||||||
<artifactId>extensions-datasource</artifactId>
|
<artifactId>extensions-datasource</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>2.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -11,6 +11,8 @@ public class ChartCalcDataResult {
|
|||||||
private List<String[]> originData;
|
private List<String[]> originData;
|
||||||
private List<String[]> assistData;
|
private List<String[]> assistData;
|
||||||
private List<ChartSeniorAssistDTO> dynamicAssistFields;
|
private List<ChartSeniorAssistDTO> dynamicAssistFields;
|
||||||
|
private List<String[]> assistDataOriginList;
|
||||||
|
private List<ChartSeniorAssistDTO> dynamicAssistFieldsOriginList;
|
||||||
private Map<String, Object> context;
|
private Map<String, Object> context;
|
||||||
// TODO 数据源插件化之后换成整个请求对象
|
// TODO 数据源插件化之后换成整个请求对象
|
||||||
private String querySql;
|
private String querySql;
|
||||||
|
@ -4,9 +4,11 @@ package io.gisbi.extensions.view.dto;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import io.gisbi.extensions.datasource.dto.DatasetTableFieldDTO;
|
import io.gisbi.extensions.datasource.dto.DatasetTableFieldDTO;
|
||||||
|
import io.gisbi.extensions.view.filter.FilterTreeObj;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -24,6 +26,6 @@ public class ChartExtFilterDTO {
|
|||||||
private String datePattern;
|
private String datePattern;
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private List<String> originValue;
|
private List<String> originValue;
|
||||||
private int filterType;// 0-过滤组件,1-下钻,2-联动,外部参数
|
private int filterType;// 0-过滤组件,1-下钻,2-联动,外部参数 3-联动 自定义参数
|
||||||
|
private FilterTreeObj customFilter;
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,21 @@ public class ChartViewFieldBaseDTO extends DatasetTableFieldDTO implements Seria
|
|||||||
|
|
||||||
private String sort;
|
private String sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期解析格式,后端参与聚合运算
|
||||||
|
*/
|
||||||
private String dateStyle;
|
private String dateStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期分隔符
|
||||||
|
*/
|
||||||
private String datePattern;
|
private String datePattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期显示格式,仅前端图表格式化
|
||||||
|
*/
|
||||||
|
private String dateShowFormat;
|
||||||
|
|
||||||
private Integer extField;
|
private Integer extField;
|
||||||
|
|
||||||
private String chartType;
|
private String chartType;
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
package io.gisbi.extensions.view.dto;
|
package io.gisbi.extensions.view.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author Junjun
|
* @Author Junjun
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class FormatterCfgDTO {
|
public class FormatterCfgDTO {
|
||||||
private String type = "auto"; // auto,value,percent
|
private String type = "auto"; // auto,value,percent
|
||||||
|
private String unitLanguage = "ch";
|
||||||
private Integer unit = 1; // 换算单位
|
private Integer unit = 1; // 换算单位
|
||||||
private String suffix = ""; // 单位后缀
|
private String suffix = ""; // 单位后缀
|
||||||
private Integer decimalCount = 0; // 小数位数
|
private Integer decimalCount = 0; // 小数位数
|
||||||
|
@ -4,7 +4,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TableCalcTotalCfg {
|
public class TableCalcTotalCfg {
|
||||||
private String dataeaseName;
|
private String gisbiName;
|
||||||
private String aggregation;
|
private String aggregation;
|
||||||
private String originName;
|
private String originName;
|
||||||
private int extField;
|
private int extField;
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package io.gisbi.extensions.view.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TableHeader {
|
||||||
|
private HeaderGroupConfig headerGroupConfig;
|
||||||
|
private boolean headerGroup;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
static
|
||||||
|
public class HeaderGroupConfig {
|
||||||
|
private List<MetaInfo> meta = new ArrayList<>();
|
||||||
|
private List<ColumnInfo> columns = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
static
|
||||||
|
public class ColumnInfo {
|
||||||
|
@Getter
|
||||||
|
private String key;
|
||||||
|
private List<ColumnInfo> children = new ArrayList<>();
|
||||||
|
private Integer width;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Data
|
||||||
|
static
|
||||||
|
public class MetaInfo {
|
||||||
|
private String field;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -127,16 +127,16 @@ public class ChartDataUtil {
|
|||||||
data.forEach(ele -> {
|
data.forEach(ele -> {
|
||||||
Map<String, Object> d = new HashMap<>();
|
Map<String, Object> d = new HashMap<>();
|
||||||
for (int i = 0; i < fields.size(); i++) {
|
for (int i = 0; i < fields.size(); i++) {
|
||||||
if (ObjectUtils.isNotEmpty(desensitizationList.keySet()) && desensitizationList.keySet().contains(fields.get(i).getDataeaseName())) {
|
if (ObjectUtils.isNotEmpty(desensitizationList.keySet()) && desensitizationList.keySet().contains(fields.get(i).getGisbiName())) {
|
||||||
d.put(fields.get(i).getDataeaseName(), desensitizationValue(desensitizationList.get(fields.get(i).getDataeaseName()), String.valueOf(ele[i])));
|
d.put(fields.get(i).getGisbiName(), desensitizationValue(desensitizationList.get(fields.get(i).getGisbiName()), String.valueOf(ele[i])));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i == ele.length) break;
|
if (i == ele.length) break;
|
||||||
ChartViewFieldDTO chartViewFieldDTO = fields.get(i);
|
ChartViewFieldDTO chartViewFieldDTO = fields.get(i);
|
||||||
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
|
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
|
||||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
|
d.put(fields.get(i).getGisbiName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
|
||||||
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3 || chartViewFieldDTO.getDeType() == 4) {
|
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3 || chartViewFieldDTO.getDeType() == 4) {
|
||||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP));
|
d.put(fields.get(i).getGisbiName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tableRow.add(d);
|
tableRow.add(d);
|
||||||
|
Loading…
Reference in New Issue
Block a user