commit
e4f59f0428
@ -3,8 +3,10 @@ package io.dataease.controller.exportCenter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.dto.ExportTaskDTO;
|
||||
import io.dataease.service.exportCenter.ExportCenterService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@ -16,8 +18,6 @@ public class ExportCenterController {
|
||||
@Resource
|
||||
private ExportCenterService exportCenterService;
|
||||
|
||||
|
||||
|
||||
@PostMapping("/exportTasks/{status}")
|
||||
public List<ExportTaskDTO> exportTasks(@PathVariable String status) {
|
||||
return exportCenterService.exportTasks(status);
|
||||
@ -40,8 +40,8 @@ public class ExportCenterController {
|
||||
}
|
||||
|
||||
@GetMapping("/download/{id}")
|
||||
public void download(@PathVariable String id, HttpServletResponse response) throws Exception {
|
||||
exportCenterService.download(id, response);
|
||||
public ResponseEntity<org.springframework.core.io.Resource> download(@PathVariable String id, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
return exportCenterService.download(id, response, request);
|
||||
}
|
||||
|
||||
@PostMapping("/retry/{id}")
|
||||
|
||||
@ -35,4 +35,4 @@ public class PgConfiguration extends JdbcConfiguration {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,6 +463,7 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
|
||||
} else {
|
||||
if (pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) {
|
||||
System.out.println("SELECT * FROM (" + sqlFix(originalTableInfo("(" + sqlFix(table) + ")", xAxis, OrgFieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, fieldCustomFilter)) + ") DE_RESULT_TMP " + " WHERE DE_ROWNUM > " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize());
|
||||
return "SELECT * FROM (" + sqlFix(originalTableInfo("(" + sqlFix(table) + ")", xAxis, OrgFieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, fieldCustomFilter)) + ") DE_RESULT_TMP " + " WHERE DE_ROWNUM > " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize();
|
||||
} else {
|
||||
return "SELECT * FROM (" + sqlFix(originalTableInfo("(" + sqlFix(table) + ")", xAxis, OrgFieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, fieldCustomFilter)) + ") DE_RESULT_TMP ";
|
||||
@ -476,16 +477,14 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
.tableAlias(String.format(OracleConstants.ALIAS_FIX, String.format(TABLE_ALIAS_PREFIX, 0)))
|
||||
.build();
|
||||
setSchema(tableObj, ds);
|
||||
boolean isPage = false;
|
||||
List<SQLObj> xFields = new ArrayList<>();
|
||||
List<SQLObj> xOrders = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
if (x.getOriginName().equalsIgnoreCase("ROWNUM")) {
|
||||
xFields.add(SQLObj.builder()
|
||||
.fieldName(x.getOriginName())
|
||||
.fieldAlias("DE_ROWNUM")
|
||||
.build());
|
||||
isPage = true;
|
||||
continue;
|
||||
}
|
||||
String originField;
|
||||
@ -540,19 +539,42 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
ST st_sql = stg.getInstanceOf("previewSql");
|
||||
st_sql.add("isGroup", false);
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st_sql.add("groups", xFields);
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
|
||||
if (CollectionUtils.isNotEmpty(orders)) st_sql.add("orders", orders);
|
||||
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
|
||||
String sql = st_sql.render();
|
||||
|
||||
ST st = stg.getInstanceOf("previewSql");
|
||||
st.add("isGroup", false);
|
||||
st.add("notUseAs", true);
|
||||
SQLObj tableSQL = SQLObj.builder()
|
||||
.tableName(String.format(OracleConstants.BRACKETS, sql))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 1))
|
||||
.build();
|
||||
if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders);
|
||||
List<SQLObj> xFields2 = new ArrayList<>();
|
||||
xFields2.add(SQLObj.builder()
|
||||
.fieldName(tableSQL.getTableAlias() + ".*")
|
||||
.build());
|
||||
if (isPage) {
|
||||
xFields2.add(SQLObj.builder()
|
||||
.fieldName("ROWNUM AS DE_ROWNUM")
|
||||
.fieldAlias("DE_ROWNUM")
|
||||
.build());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xFields)) st.add("groups", xFields2);
|
||||
if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL);
|
||||
return st.render();
|
||||
sql = st.render();
|
||||
|
||||
ST st2 = stg.getInstanceOf("previewSql");
|
||||
st2.add("isGroup", false);
|
||||
SQLObj tableSQL2 = SQLObj.builder()
|
||||
.tableName(String.format(OracleConstants.BRACKETS, sql))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 2))
|
||||
.build();
|
||||
if (CollectionUtils.isNotEmpty(wheres)) st2.add("filters", wheres);
|
||||
if (ObjectUtils.isNotEmpty(tableSQL)) st2.add("table", tableSQL2);
|
||||
|
||||
return st2.render();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -341,7 +341,7 @@ public class ChartViewService {
|
||||
String[] dsHeader = null;
|
||||
Integer[] dsTypes = null;
|
||||
//downloadType = dataset 为下载原始名字 这里做数据转换模拟 table-info类型图表导出
|
||||
if("dataset".equals(request.getDownloadType())){
|
||||
if ("dataset".equals(request.getDownloadType())) {
|
||||
view.setType("table-info");
|
||||
List<DatasetTableField> sourceFields = dataSetTableFieldsService.getFieldsByTableId(view.getTableId());
|
||||
dsHeader = sourceFields.stream()
|
||||
@ -353,9 +353,9 @@ public class ChartViewService {
|
||||
view.setXAxis(JSONObject.toJSONString(sourceFields));
|
||||
}
|
||||
ChartViewDTO result = calcData(view, request, request.isCache());
|
||||
if("dataset".equals(request.getDownloadType())){
|
||||
result.getData().put("header",dsHeader);
|
||||
result.getData().put("dsTypes",dsTypes);
|
||||
if ("dataset".equals(request.getDownloadType())) {
|
||||
result.getData().put("header", dsHeader);
|
||||
result.getData().put("dsTypes", dsTypes);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -1037,6 +1037,7 @@ public class ChartViewService {
|
||||
datasourceRequest.setDatasource(ds);
|
||||
Provider datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
List<String[]> data = new ArrayList<>();
|
||||
List<String[]> yoyData = new ArrayList<>();
|
||||
|
||||
// senior dynamic assist
|
||||
DatasourceRequest datasourceAssistRequest = new DatasourceRequest();
|
||||
@ -1082,6 +1083,45 @@ public class ChartViewService {
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// extFilterList,如果参与计算的日期字段有过滤,则多加1年,再请求一次,计算出同环比后,再和正确的过滤结果对比取交集
|
||||
List<ChartViewFieldDTO> tempYAxis = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(xAxis) && StringUtils.equals(xAxis.get(0).getGroupType(), "q") && StringUtils.equalsIgnoreCase(view.getRender(), "antv")) {
|
||||
//针对散点图scatter处理
|
||||
tempYAxis.add(xAxis.get(0));
|
||||
}
|
||||
tempYAxis.addAll(yAxis);
|
||||
boolean isYOY = false;
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(extFilterList);
|
||||
// 复制一个list,这个是最终正确过滤的结果
|
||||
List<ChartExtFilterRequest> yoyFilterList = gson.fromJson(json, new TypeToken<List<ChartExtFilterRequest>>() {
|
||||
}.getType());
|
||||
for (ChartExtFilterRequest filterDTO : extFilterList) {
|
||||
for (ChartViewFieldDTO chartViewFieldDTO : tempYAxis) {
|
||||
ChartFieldCompareDTO compareCalc = chartViewFieldDTO.getCompareCalc();
|
||||
if (ObjectUtils.isEmpty(compareCalc)) {
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(compareCalc.getType())
|
||||
&& !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none")) {
|
||||
if (Arrays.asList(ChartConstants.M_Y).contains(compareCalc.getType())) {
|
||||
if (StringUtils.equalsIgnoreCase(compareCalc.getField() + "", filterDTO.getFieldId())) {
|
||||
// -1 year
|
||||
try {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date(Long.parseLong(filterDTO.getValue().get(0))));
|
||||
calendar.add(Calendar.YEAR, -1);
|
||||
filterDTO.getValue().set(0, String.valueOf(calendar.getTime().getTime()));
|
||||
isYOY = true;
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是插件视图 走插件内部的逻辑
|
||||
if (ObjectUtils.isNotEmpty(view.getIsPlugin()) && view.getIsPlugin()) {
|
||||
Map<String, List<ChartViewFieldDTO>> fieldMap = ObjectUtils.isEmpty(extFieldsMap) ? new LinkedHashMap<>() : extFieldsMap;
|
||||
@ -1106,11 +1146,46 @@ public class ChartViewService {
|
||||
if (StringUtils.isBlank(sql)) {
|
||||
return emptyChartViewDTO(view);
|
||||
}
|
||||
logger.info("plugin_sql:" + sql);
|
||||
datasourceRequest.setQuery(sql);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
data = resultCustomSort(xAxis, data);
|
||||
|
||||
// 插件同环比
|
||||
data = pluginViewYOY(pluginViewParam, view, data);
|
||||
|
||||
// 请求正确的数据,然后取值
|
||||
if (isYOY) {
|
||||
PluginViewParam yoyPluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, yoyFilterList, ds, table, view, rowPermissionsTree, chartExtRequest);
|
||||
String yoySql = pluginViewSql(yoyPluginViewParam, view);
|
||||
if (StringUtils.isBlank(yoySql)) {
|
||||
return emptyChartViewDTO(view);
|
||||
}
|
||||
logger.info("plugin_yoy_sql:" + yoySql);
|
||||
datasourceRequest.setQuery(yoySql);
|
||||
yoyData = datasourceProvider.getData(datasourceRequest);
|
||||
List<String[]> resultData = new ArrayList<>();
|
||||
for (String[] res1 : data) {
|
||||
StringBuilder x1 = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
x1.append(res1[i]);
|
||||
}
|
||||
for (String[] res2 : yoyData) {
|
||||
StringBuilder x2 = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
x2.append(res2[i]);
|
||||
}
|
||||
if (StringUtils.equals(x1, x2)) {
|
||||
resultData.add(res1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
data.clear();
|
||||
data.addAll(resultData);
|
||||
}
|
||||
Map<String, Object> mapChart = pluginViewResult(pluginViewParam, view, data, isDrill);
|
||||
logger.info("plugin_sql:" + sql);
|
||||
|
||||
Map<String, Object> mapTableNormal = ChartDataBuild.transTableNormal(fieldMap, view, data, desensitizationList);
|
||||
|
||||
return uniteViewResult(datasourceRequest.getQuery(), mapChart, mapTableNormal, view, isDrill, drillFilters, dynamicAssistFields, assistData, Collections.emptyList());
|
||||
@ -1118,6 +1193,7 @@ public class ChartViewService {
|
||||
}
|
||||
|
||||
String querySql = null;
|
||||
String yoySql = null;
|
||||
long totalPage = 0l;
|
||||
long totalItems = 0l;
|
||||
String totalPageSql = null;
|
||||
@ -1150,15 +1226,27 @@ public class ChartViewService {
|
||||
datasourceRequest.setTable(dataTableInfoDTO.getTable());
|
||||
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) {
|
||||
querySql = qp.getSQLSummary(dataTableInfoDTO.getTable(), yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view, ds);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLSummary(dataTableInfoDTO.getTable(), yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view, ds);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
querySql = qp.getSQLStack(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, ds, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLStack(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, ds, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "scatter")) {
|
||||
querySql = qp.getSQLScatter(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extBubble, extStack, ds, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLScatter(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extBubble, extStack, ds, view);
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase("table-info", view.getType())) {
|
||||
querySql = qp.getSQLWithPage(true, dataTableInfoDTO.getTable(), xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
totalPageSql = qp.getResultCount(true, dataTableInfoDTO.getTable(), xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
querySql = qp.getSQLRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, ds, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, ds, view);
|
||||
}
|
||||
} else {
|
||||
querySql = qp.getSQL(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
if (containDetailField(view) && CollectionUtils.isNotEmpty(viewFields)) {
|
||||
@ -1169,23 +1257,37 @@ public class ChartViewService {
|
||||
detailFieldSql = qp.getSQLWithPage(true, dataTableInfoDTO.getTable(), detailFieldList, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
view.setResultMode(resultMode);
|
||||
}
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQL(dataTableInfoDTO.getTable(), xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, ds, view);
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase(table.getType(), DatasetType.SQL.name())) {
|
||||
String sql = dataTableInfoDTO.isBase64Encryption() ? new String(java.util.Base64.getDecoder().decode(dataTableInfoDTO.getSql())) : dataTableInfoDTO.getSql();
|
||||
sql = handleVariable(sql, chartExtRequest, qp, table, ds);
|
||||
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) {
|
||||
querySql = qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
querySql = qp.getSQLAsTmpStack(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpStack(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "scatter")) {
|
||||
querySql = qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extBubble, extStack, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extBubble, extStack, view);
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase("table-info", view.getType())) {
|
||||
querySql = qp.getSQLWithPage(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
totalPageSql = qp.getResultCount(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
|
||||
querySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, view);
|
||||
}
|
||||
} else {
|
||||
querySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
if (containDetailField(view) && CollectionUtils.isNotEmpty(viewFields)) {
|
||||
@ -1196,6 +1298,9 @@ public class ChartViewService {
|
||||
detailFieldSql = qp.getSQLWithPage(false, sql, detailFieldList, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
view.setResultMode(resultMode);
|
||||
}
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view);
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase(table.getType(), DatasetType.CUSTOM.name())) {
|
||||
DataTableInfoDTO dt = gson.fromJson(table.getInfo(), DataTableInfoDTO.class);
|
||||
@ -1203,16 +1308,27 @@ public class ChartViewService {
|
||||
String sql = dataSetTableService.getCustomSQLDatasource(dt, list, ds);
|
||||
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) {
|
||||
querySql = qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
querySql = qp.getSQLAsTmpStack(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpStack(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "scatter")) {
|
||||
querySql = qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extBubble, extStack, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extBubble, extStack, view);
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase("table-info", view.getType())) {
|
||||
querySql = qp.getSQLWithPage(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
totalPageSql = qp.getResultCount(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
querySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, view);
|
||||
}
|
||||
} else {
|
||||
querySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
if (containDetailField(view) && CollectionUtils.isNotEmpty(viewFields)) {
|
||||
@ -1223,6 +1339,9 @@ public class ChartViewService {
|
||||
detailFieldSql = qp.getSQLWithPage(false, sql, detailFieldList, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
view.setResultMode(resultMode);
|
||||
}
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view);
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase(table.getType(), DatasetType.UNION.name())) {
|
||||
DataTableInfoDTO dt = gson.fromJson(table.getInfo(), DataTableInfoDTO.class);
|
||||
@ -1230,17 +1349,28 @@ public class ChartViewService {
|
||||
String sql = (String) sqlMap.get("sql");
|
||||
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) {
|
||||
querySql = qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLSummaryAsTmp(sql, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
querySql = qp.getSQLAsTmpStack(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpStack(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "scatter")) {
|
||||
querySql = qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extBubble, extStack, view);
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extBubble, extStack, view);
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase("table-info", view.getType())) {
|
||||
querySql = qp.getSQLWithPage(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
totalPageSql = qp.getResultCount(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
|
||||
querySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, view);
|
||||
}
|
||||
} else {
|
||||
querySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
if (containDetailField(view) && CollectionUtils.isNotEmpty(viewFields)) {
|
||||
@ -1251,6 +1381,9 @@ public class ChartViewService {
|
||||
detailFieldSql = qp.getSQLWithPage(false, sql, detailFieldList, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
view.setResultMode(resultMode);
|
||||
}
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(totalPageSql) && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||
@ -1282,6 +1415,13 @@ public class ChartViewService {
|
||||
datasourceRequest.setQuery(detailFieldSql);
|
||||
detailData = datasourceProvider.getData(datasourceRequest);
|
||||
}
|
||||
|
||||
// 请求正确过滤的data
|
||||
if (isYOY) {
|
||||
datasourceRequest.setQuery(yoySql);
|
||||
logger.info("calcite chart sql real yoy: " + yoySql);
|
||||
yoyData = datasourceProvider.getData(datasourceRequest);
|
||||
}
|
||||
} else if (table.getMode() == 1) {// 抽取
|
||||
// 连接doris,构建doris数据源查询
|
||||
datasourceRequest.setDatasource(ds);
|
||||
@ -1290,16 +1430,28 @@ public class ChartViewService {
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) {
|
||||
datasourceRequest.setQuery(qp.getSQLSummary(tableName, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view, ds));
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLSummary(tableName, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, view, ds);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
datasourceRequest.setQuery(qp.getSQLStack(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, ds, view));
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLStack(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, ds, view);
|
||||
}
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "scatter")) {
|
||||
datasourceRequest.setQuery(qp.getSQLScatter(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extBubble, extStack, ds, view));
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLScatter(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extBubble, extStack, ds, view);
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase("table-info", view.getType())) {
|
||||
querySql = qp.getSQLWithPage(true, tableName, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
totalPageSql = qp.getResultCount(true, tableName, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
datasourceRequest.setQuery(qp.getSQLRangeBar(tableName, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, ds, view));
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQLRangeBar(tableName, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, extStack, ds, view);
|
||||
}
|
||||
} else {
|
||||
datasourceRequest.setQuery(qp.getSQL(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view));
|
||||
if (containDetailField(view) && CollectionUtils.isNotEmpty(viewFields)) {
|
||||
@ -1310,6 +1462,9 @@ public class ChartViewService {
|
||||
detailFieldSql = qp.getSQLTableInfo(tableName, detailFieldList, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
view.setResultMode(resultMode);
|
||||
}
|
||||
if (isYOY) {
|
||||
yoySql = qp.getSQL(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, yoyFilterList, ds, view);
|
||||
}
|
||||
}
|
||||
// 分页
|
||||
if (StringUtils.isNotEmpty(totalPageSql) && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||
@ -1357,6 +1512,13 @@ public class ChartViewService {
|
||||
datasourceRequest.setQuery(detailFieldSql);
|
||||
detailData = datasourceProvider.getData(datasourceRequest);
|
||||
}
|
||||
|
||||
// 请求正确过滤的data
|
||||
if (isYOY) {
|
||||
datasourceRequest.setQuery(yoySql);
|
||||
logger.info("calcite chart sql real yoy: " + yoySql);
|
||||
yoyData = datasourceProvider.getData(datasourceRequest);
|
||||
}
|
||||
}
|
||||
// 自定义排序
|
||||
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
@ -1377,12 +1539,6 @@ public class ChartViewService {
|
||||
// 同比/环比计算,通过对比类型和数据设置,计算出对应指标的结果,然后替换结果data数组中的对应元素
|
||||
// 如果因维度变化(如时间字段缺失,时间字段的展示格式变化)导致无法计算结果的,则结果data数组中的对应元素全置为null
|
||||
// 根据不同图表类型,获得需要替换的指标index array
|
||||
List<ChartViewFieldDTO> tempYAxis = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(xAxis) && StringUtils.equals(xAxis.get(0).getGroupType(), "q") && StringUtils.equalsIgnoreCase(view.getRender(), "antv")) {
|
||||
//针对散点图scatter处理
|
||||
tempYAxis.add(xAxis.get(0));
|
||||
}
|
||||
tempYAxis.addAll(yAxis);
|
||||
|
||||
// forecast
|
||||
List<? extends ForecastDataVO<?, ?>> forecastData = Collections.emptyList();
|
||||
@ -1581,6 +1737,29 @@ public class ChartViewService {
|
||||
}
|
||||
}
|
||||
|
||||
// 如果同环比有横轴日期过滤,过滤掉不要的数据
|
||||
if (isYOY) {
|
||||
List<String[]> resultData = new ArrayList<>();
|
||||
for (String[] res1 : data) {
|
||||
StringBuilder x1 = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
x1.append(res1[i]);
|
||||
}
|
||||
for (String[] res2 : yoyData) {
|
||||
StringBuilder x2 = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
x2.append(res2[i]);
|
||||
}
|
||||
if (StringUtils.equals(x1, x2)) {
|
||||
resultData.add(res1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
data.clear();
|
||||
data.addAll(resultData);
|
||||
}
|
||||
|
||||
// 构建结果
|
||||
Map<String, Object> map = new TreeMap<>();
|
||||
// 图表组件可再扩展
|
||||
@ -1661,7 +1840,7 @@ public class ChartViewService {
|
||||
return chartViewDTO;
|
||||
}
|
||||
|
||||
private List<? extends ForecastDataVO<?,?>> forecastData(ChartSeniorForecastDTO forecastCfg, List<String[]> data, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewDTO view) throws ParseException {
|
||||
private List<? extends ForecastDataVO<?, ?>> forecastData(ChartSeniorForecastDTO forecastCfg, List<String[]> data, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewDTO view) throws ParseException {
|
||||
List<String[]> trainingData = data;
|
||||
if (!forecastCfg.isAllPeriod() && data.size() > forecastCfg.getTrainingPeriod()) {
|
||||
trainingData = data.subList(data.size() - forecastCfg.getTrainingPeriod(), data.size() - 1);
|
||||
@ -1671,7 +1850,7 @@ public class ChartViewService {
|
||||
String lastTime = data.get(data.size() - 1)[0];
|
||||
ChartViewFieldDTO timeAxis = xAxis.get(0);
|
||||
List<String> forecastPeriod = DateUtils.getForecastPeriod(lastTime, forecastCfg.getPeriod(), timeAxis.getDateStyle(), timeAxis.getDatePattern());
|
||||
if(!forecastPeriod.isEmpty()){
|
||||
if (!forecastPeriod.isEmpty()) {
|
||||
ForecastAlgo algo = ForecastAlgoManager.getAlgo(forecastCfg.getAlgorithm());
|
||||
List<ForecastDataDTO> forecastData = algo.forecast(forecastCfg, trainingData, view);
|
||||
if (forecastPeriod.size() == forecastData.size()) {
|
||||
@ -1829,6 +2008,11 @@ public class ChartViewService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String[]> pluginViewYOY(PluginViewParam param, ChartViewDTO view, List<String[]> args) {
|
||||
ViewPluginService viewPluginService = getPluginService(view.getType());
|
||||
return viewPluginService.yoy(param, args);
|
||||
}
|
||||
|
||||
private ChartViewDTO emptyChartViewDTO(ChartViewDTO view) {
|
||||
ChartViewDTO dto = new ChartViewDTO();
|
||||
BeanUtils.copyBean(dto, view);
|
||||
|
||||
@ -54,12 +54,19 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Base64Utils;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.InetAddress;
|
||||
@ -148,22 +155,25 @@ public class ExportCenterService {
|
||||
}
|
||||
}
|
||||
|
||||
public void download(String id, HttpServletResponse response) throws Exception {
|
||||
public ResponseEntity<org.springframework.core.io.Resource> download(String id, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
ExportTask exportTask = exportTaskMapper.selectByPrimaryKey(id);
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
//文件名称
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + exportTask.getFileName());
|
||||
InputStream fileInputStream = new FileInputStream(exportData_path + id + "/" + exportTask.getFileName());
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = fileInputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
try {
|
||||
InputStreamResource resource = new InputStreamResource(new FileInputStream(exportData_path + id + "/" + exportTask.getFileName()));
|
||||
String contentType = "application/octet-stream";
|
||||
long contentLength = new File(exportData_path + id + "/" + exportTask.getFileName()).length(); // 如果有的话
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentDispositionFormData("attachment", exportTask.getFileName());
|
||||
headers.setContentType(MediaType.parseMediaType(contentType));
|
||||
if (contentLength > 0) {
|
||||
headers.setContentLength(contentLength);
|
||||
}
|
||||
return ResponseEntity.ok()
|
||||
.headers(headers)
|
||||
.body(resource);
|
||||
} catch (IOException e) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
|
||||
}
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
fileInputStream.close();
|
||||
response.flushBuffer();
|
||||
}
|
||||
|
||||
public void delete(String id) {
|
||||
@ -557,6 +567,7 @@ public class ExportCenterService {
|
||||
setFileSize(dataPath + "/" + request.getViewName() + ".xlsx", exportTask);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("Failed to export data", e);
|
||||
exportTask.setMsg(e.getMessage());
|
||||
exportTask.setExportStatus("FAILED");
|
||||
} finally {
|
||||
exportTaskMapper.updateByPrimaryKey(exportTask);
|
||||
@ -771,6 +782,7 @@ public class ExportCenterService {
|
||||
setFileSize(dataPath + "/" + request.getFilename() + ".xlsx", exportTask);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("Failed to export data", e);
|
||||
exportTask.setMsg(e.getMessage());
|
||||
exportTask.setExportStatus("FAILED");
|
||||
} finally {
|
||||
exportTaskMapper.updateByPrimaryKey(exportTask);
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
UPDATE `sys_auth_detail`
|
||||
SET `privilege_value` = 1
|
||||
WHERE
|
||||
`id` = 'dbadd69a-064a-11ec-a2b0-0242ac130003';
|
||||
UPDATE `sys_auth_detail`
|
||||
SET `privilege_value` = 0
|
||||
WHERE
|
||||
`id` = 'dbadd8a4-064a-11ec-a2b0-0242ac130003';
|
||||
UPDATE `sys_auth_detail`
|
||||
SET `privilege_value` = 1
|
||||
WHERE
|
||||
`id` = 'dbadd904-064a-11ec-a2b0-0242ac130003';
|
||||
UPDATE `sys_auth_detail`
|
||||
SET `privilege_value` = 1
|
||||
WHERE
|
||||
`id` = 'dbadd951-064a-11ec-a2b0-0242ac130003';
|
||||
@ -0,0 +1 @@
|
||||
ALTER TABLE `export_task` ADD COLUMN `msg` LONGTEXT NULL COMMENT '错误信息' AFTER `params`;
|
||||
@ -159,7 +159,7 @@
|
||||
</span>
|
||||
|
||||
<el-button
|
||||
v-if="showChartInfoType==='details'&& this.showChartInfo.dataFrom !== 'template' && hasDataPermission('export',panelInfo.privileges)"
|
||||
v-if="showChartInfoType==='details'&& showChartInfo.dataFrom !== 'template' && hasDataPermission('export',panelInfo.privileges)"
|
||||
size="mini"
|
||||
:disabled="$store.getters.loadingMap[$store.getters.currentPath]"
|
||||
@click="exportExcel"
|
||||
@ -170,7 +170,7 @@
|
||||
/>{{ $t('chart.export') }}Excel
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showChartInfoType==='details' && this.showChartInfo.dataFrom !== 'template' && !userId && hasDataPermission('export',panelInfo.privileges)"
|
||||
v-if="showChartInfoType==='details' && showChartInfo.dataFrom !== 'template' && !userId && hasDataPermission('export',panelInfo.privileges)"
|
||||
size="mini"
|
||||
:disabled="$store.getters.loadingMap[$store.getters.currentPath] || dialogLoading"
|
||||
@click="exportSourceDetails"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
class="bg"
|
||||
:style="customStyle"
|
||||
>
|
||||
<link-opt-bar/>
|
||||
<link-opt-bar />
|
||||
<Preview />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="line-shape"></div>
|
||||
<div class="line-shape" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@ -20,10 +20,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {imgUrlTrans} from "@/components/canvas/utils/utils";
|
||||
import { imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
methods: {imgUrlTrans},
|
||||
props: {
|
||||
element: {
|
||||
type: Object,
|
||||
@ -53,7 +52,8 @@ export default {
|
||||
}
|
||||
return style
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: { imgUrlTrans }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -520,7 +520,7 @@ export default {
|
||||
}
|
||||
},
|
||||
setTabLayout: _.debounce(function() {
|
||||
this.headClassScroll = !!this.$refs?.deTabsConstom?.$refs?.tabsConstom?.$refs?.nav?.scrollable ? 'head-class-scroll' : ''
|
||||
this.headClassScroll = this.$refs?.deTabsConstom?.$refs?.tabsConstom?.$refs?.nav?.scrollable ? 'head-class-scroll' : ''
|
||||
}, 100),
|
||||
calcTabLength() {
|
||||
this.$nextTick(() => {
|
||||
|
||||
@ -1841,7 +1841,8 @@ export default {
|
||||
linear_regression: 'Linear regression',
|
||||
polynomial_regression: 'Polynomial regression',
|
||||
show_summary: 'Show summary',
|
||||
summary_label: 'Summary label'
|
||||
summary_label: 'Summary label',
|
||||
tip: 'Tip'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: 'Effective only when editing',
|
||||
|
||||
@ -1834,7 +1834,8 @@ export default {
|
||||
linear_regression: '線性回歸',
|
||||
polynomial_regression: '多項式擬合',
|
||||
show_summary: '顯示總計',
|
||||
summary_label: '總計標籤'
|
||||
summary_label: '總計標籤',
|
||||
tip: '提示'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: '僅編輯時生效',
|
||||
|
||||
@ -1831,7 +1831,8 @@ export default {
|
||||
linear_regression: '线性回归',
|
||||
polynomial_regression: '多项式拟合',
|
||||
show_summary: '显示总计',
|
||||
summary_label: '总计标签'
|
||||
summary_label: '总计标签',
|
||||
tip: '提示'
|
||||
},
|
||||
dataset: {
|
||||
goto: ', 前往 ',
|
||||
|
||||
@ -26,10 +26,13 @@ export default {
|
||||
<div class="ai-popper-tips-content">
|
||||
<p class="title">DataEase 智能客服</p>
|
||||
<p class="constant">
|
||||
你好,我是 DataEase 智能客服<br />点击一下,开启高效解答模式~<br />
|
||||
你好,我是 DataEase 智能客服<br>点击一下,开启高效解答模式~<br>
|
||||
</p>
|
||||
<div class="bottom">
|
||||
<el-button size="middle" @click="confirm"> 我知道了 </el-button>
|
||||
<el-button
|
||||
size="middle"
|
||||
@click="confirm"
|
||||
> 我知道了 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="reference">
|
||||
|
||||
@ -125,8 +125,15 @@
|
||||
</div>
|
||||
|
||||
<ExportExcel ref="ExportExcelRef" />
|
||||
<ai-tips @confirm="aiTipsConfirm" v-if="showOverlay" class="ai-icon-tips"></ai-tips>
|
||||
<div v-if="showOverlay" class="overlay"></div>
|
||||
<ai-tips
|
||||
v-if="showOverlay"
|
||||
class="ai-icon-tips"
|
||||
@confirm="aiTipsConfirm"
|
||||
/>
|
||||
<div
|
||||
v-if="showOverlay"
|
||||
class="overlay"
|
||||
/>
|
||||
|
||||
<ai-component
|
||||
v-if="aiBaseUrl"
|
||||
@ -167,7 +174,7 @@ import TemplateMarket from '@/views/panel/templateMarket'
|
||||
import { changeFavicon, inOtherPlatform } from '@/utils/index'
|
||||
import AiComponent from '@/layout/components/AiComponent'
|
||||
import { findBaseParams } from '@/api/ai/aiComponent'
|
||||
import AiTips from "@/layout/components/AiTips.vue";
|
||||
import AiTips from '@/layout/components/AiTips.vue'
|
||||
export default {
|
||||
name: 'Topbar',
|
||||
components: {
|
||||
@ -313,7 +320,7 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
aiTipsConfirm(){
|
||||
aiTipsConfirm() {
|
||||
localStorage.setItem('DE1.0-AI-TIPS-CHECK', 'CHECKED')
|
||||
this.showOverlay = false
|
||||
},
|
||||
|
||||
@ -15,7 +15,8 @@ import {
|
||||
configAxisLabelLengthLimit
|
||||
} from '@/views/chart/chart/common/common_antv'
|
||||
import { antVCustomColor, getColors, handleEmptyDataStrategy, hexColorToRGBA, handleStackSort } from '@/views/chart/chart/util'
|
||||
import { cloneDeep, find } from 'lodash-es'
|
||||
import { cloneDeep, find, groupBy, each } from 'lodash-es'
|
||||
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
|
||||
|
||||
export function baseBarOptionAntV(container, chart, action, isGroup, isStack) {
|
||||
// theme
|
||||
@ -141,6 +142,22 @@ export function baseBarOptionAntV(container, chart, action, isGroup, isStack) {
|
||||
}
|
||||
})
|
||||
}
|
||||
// total label
|
||||
if (chart.type === 'bar-stack' && customAttr.label.showTotal) {
|
||||
const yAxis = JSON.parse(chart.yaxis)
|
||||
const formatterCfg = yAxis?.[0]?.formatterCfg ?? formatterItem
|
||||
each(groupBy(data, 'field'), (values, key) => {
|
||||
const total = values.reduce((a, b) => a + b.value, 0)
|
||||
const value = valueFormatter(total, formatterCfg)
|
||||
analyse.push({
|
||||
type: 'text',
|
||||
position: [key, total],
|
||||
content: `${value}`,
|
||||
style: { textAlign: 'center', fontSize: customAttr.label.totalFontSize, fill: customAttr.label.totalColor },
|
||||
offsetY: -(parseInt(customAttr.label.totalFontSize) / 2)
|
||||
})
|
||||
})
|
||||
}
|
||||
// 目前只有百分比堆叠柱状图需要这个属性,先直接在这边判断而不作为参数传过来
|
||||
options.isPercent = chart.type === 'percentage-bar-stack'
|
||||
// custom color
|
||||
|
||||
@ -222,7 +222,10 @@ export const DEFAULT_LABEL = {
|
||||
reserveDecimalCount: 2,
|
||||
labelContent: ['dimension', 'proportion'],
|
||||
showConversion: false,
|
||||
conversionLabel: '转换率'
|
||||
conversionLabel: '转换率',
|
||||
showTotal: false,
|
||||
totalFontSize: '12',
|
||||
totalColor: '#909399'
|
||||
}
|
||||
export const DEFAULT_TOOLTIP = {
|
||||
show: true,
|
||||
|
||||
@ -8,7 +8,7 @@ let labelFormatter = null
|
||||
export function baseLiquid(container, chart) {
|
||||
let value = 0
|
||||
const colors = []
|
||||
let max, radius, bgColor, shape, labelContent, liquidStyle, originVal = 0
|
||||
let max; let radius; let bgColor; let shape; let labelContent; let liquidStyle; let originVal = 0
|
||||
if (chart.data?.series.length > 0) {
|
||||
value = chart.data.series[0].data[0]
|
||||
}
|
||||
|
||||
@ -836,7 +836,10 @@ export const TYPE_CONFIGS = [
|
||||
'show',
|
||||
'fontSize',
|
||||
'color',
|
||||
'position-v'
|
||||
'position-v',
|
||||
'showTotal',
|
||||
'totalColor',
|
||||
'totalFontSize'
|
||||
],
|
||||
'tooltip-selector-ant-v': [
|
||||
'show',
|
||||
|
||||
@ -50,6 +50,12 @@
|
||||
class="exp-style"
|
||||
>(本期数据 / |上期数据| - 1) * 100%</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('chart.tip')">
|
||||
<span
|
||||
class="exp-style"
|
||||
>当对比日期需要过滤时,请使用过滤组件实现过滤;使用视图过滤器,仪表板下钻和联动等功能,会导致结果不一致</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -150,6 +150,50 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-divider v-show="showProperty('showTotal')"/>
|
||||
<el-form-item
|
||||
v-show="showProperty('showTotal')"
|
||||
:label="$t('chart.show_summary')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="labelForm.showTotal"
|
||||
@change="changeLabelAttr('showTotal')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div v-show="labelForm.showTotal">
|
||||
<el-form-item
|
||||
v-show="showProperty('totalFontSize')"
|
||||
:label="$t('chart.text_fontsize')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="labelForm.totalFontSize"
|
||||
:placeholder="$t('chart.text_fontsize')"
|
||||
size="mini"
|
||||
@change="changeLabelAttr('totalFontSize')"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in fontSize"
|
||||
:key="option.value"
|
||||
:label="option.name"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('totalColor')"
|
||||
:label="$t('chart.text_color')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-color-picker
|
||||
v-model="labelForm.totalColor"
|
||||
class="color-picker-style"
|
||||
:predefine="predefineColors"
|
||||
@change="changeLabelAttr('totalColor')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item
|
||||
v-show="showProperty('conversion')"
|
||||
:label="$t('chart.show_conversion')"
|
||||
@ -404,6 +448,8 @@ export default {
|
||||
if (!this.labelForm.labelContent) {
|
||||
this.labelForm.labelContent = ['quota']
|
||||
}
|
||||
this.labelForm.totalFontSize = this.labelForm.totalFontSize ?? DEFAULT_LABEL.totalFontSize
|
||||
this.labelForm.totalColor = this.labelForm.totalColor ?? DEFAULT_LABEL.totalColor
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -492,4 +538,7 @@ export default {
|
||||
cursor: pointer;
|
||||
z-index: 1003;
|
||||
}
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -45,8 +45,7 @@ export default {
|
||||
this.table.emit(S2Event.RANGE_SORT, [{
|
||||
sortFieldId: this.meta.field,
|
||||
sortMethod: type,
|
||||
sortFunc: this.sortFunc,
|
||||
meta: this.meta
|
||||
sortFunc: this.sortFunc
|
||||
}])
|
||||
},
|
||||
__t(key) {
|
||||
@ -58,22 +57,26 @@ export default {
|
||||
}
|
||||
const data = cloneDeep(sortParams.data)
|
||||
return data.sort((a, b) => {
|
||||
if (a === b) {
|
||||
return 0
|
||||
}
|
||||
// 总计行放最后
|
||||
if (a.SUMMARY) {
|
||||
return 1
|
||||
}
|
||||
const field = sortParams.sortFieldId
|
||||
const aValue = a[field]
|
||||
const bValue = b[field]
|
||||
if (aValue === bValue) {
|
||||
return 0
|
||||
}
|
||||
if (sortParams.sortMethod === 'asc') {
|
||||
if (typeof a === 'number') {
|
||||
return a - b
|
||||
if (typeof aValue === 'number') {
|
||||
return aValue - bValue
|
||||
}
|
||||
return a < b ? 1 : -1
|
||||
return aValue < bValue ? 1 : -1
|
||||
}
|
||||
if (typeof a === 'number') {
|
||||
return b - a
|
||||
if (typeof aValue === 'number') {
|
||||
return bValue - aValue
|
||||
}
|
||||
return a > b ? 1 : -1
|
||||
return aValue > bValue ? 1 : -1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,6 +78,7 @@
|
||||
<div
|
||||
v-if="scope.row.exportStatus==='FAILED'"
|
||||
class="failed"
|
||||
@click="showMsg(scope.row)"
|
||||
>{{ $t("data_export.export_failed") }}</div>
|
||||
<div
|
||||
v-if="scope.row.exportStatus==='SUCCESS'"
|
||||
@ -169,6 +170,14 @@
|
||||
/>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="失败原因"
|
||||
:visible.sync="msgDialogVisible"
|
||||
append-to-body
|
||||
width="30%"
|
||||
>
|
||||
<span>{{ msg }}</span>
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
@ -211,7 +220,9 @@ export default {
|
||||
name: 'ALL'
|
||||
}
|
||||
],
|
||||
loading: false
|
||||
loading: false,
|
||||
msgDialogVisible: false,
|
||||
msg: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -436,6 +447,11 @@ export default {
|
||||
}
|
||||
this.handlerConfirm(options)
|
||||
},
|
||||
showMsg(item) {
|
||||
this.msg = ''
|
||||
this.msg = item.msg
|
||||
this.msgDialogVisible = true
|
||||
},
|
||||
delAll() {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$confirm(this.$t('data_export.sure_del_all'), '', {
|
||||
@ -547,6 +563,7 @@ export default {
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
color: #F54A45;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.success {
|
||||
|
||||
@ -27,7 +27,7 @@ import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJu
|
||||
import { getNowCanvasComponentData, panelInit } from '@/components/canvas/utils/utils'
|
||||
import { getOuterParamsInfo } from '@/api/panel/outerParams'
|
||||
import { mapState } from 'vuex'
|
||||
import {Base64} from "js-base64";
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
export default {
|
||||
name: 'LinkView',
|
||||
|
||||
@ -130,7 +130,10 @@
|
||||
v-show="codeShow"
|
||||
class="code"
|
||||
>
|
||||
<el-row class="code-contaniner" :class="isPad && 'is-pad'">
|
||||
<el-row
|
||||
class="code-contaniner"
|
||||
:class="isPad && 'is-pad'"
|
||||
>
|
||||
<plugin-com
|
||||
v-if="codeShow && loginTypes.includes(4) && codeIndex === 4"
|
||||
ref="WecomQr"
|
||||
|
||||
@ -1003,7 +1003,7 @@ export default {
|
||||
this.sortTypeChange(this.localSortParams)
|
||||
}
|
||||
groupTree(this.groupForm, !userCache).then((res) => {
|
||||
this.rootAuth = res.data ? res.data[0]?.privileges||'':''
|
||||
this.rootAuth = res.data ? res.data[0]?.privileges || '' : ''
|
||||
const resMainData = res.data ? res.data[0]?.children || [] : []
|
||||
localStorage.setItem('panel-main-tree', JSON.stringify(resMainData))
|
||||
if (!userCache) {
|
||||
|
||||
@ -56,6 +56,7 @@ class DeWebsocket {
|
||||
if (!this.isLoginStatus()) {
|
||||
return
|
||||
}
|
||||
console.log(this.ws_url)
|
||||
const socket = new SockJS(this.ws_url + '?userId=' + store.state.user.user.userId)
|
||||
/* const socket = new SockJS('http://localhost:8081' + this.ws_url) */
|
||||
|
||||
|
||||
@ -118,9 +118,8 @@ public class ChartMixService extends ViewPluginService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> formatResult(PluginViewParam pluginViewParam, List<String[]> data, Boolean isDrill) {
|
||||
public List<String[]> yoy(PluginViewParam pluginViewParam, List<String[]> data) {
|
||||
List<PluginViewField> xAxis = new ArrayList<>();
|
||||
List<PluginViewField> yAxis = new ArrayList<>();
|
||||
|
||||
@ -133,17 +132,7 @@ public class ChartMixService extends ViewPluginService {
|
||||
yAxis.add(pluginViewField);
|
||||
}
|
||||
});
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<PluginSeries> series = format(pluginViewParam.getPluginViewLimit().getType(), data, xAxis, yAxis);
|
||||
|
||||
map.put("data", series);
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private List<PluginSeries> format(String type, List<String[]> data, List<PluginViewField> xAxis, List<PluginViewField> yAxis) {
|
||||
// 同比/环比计算
|
||||
// 调整data数据
|
||||
for (int i = 0; i < yAxis.size(); i++) {
|
||||
@ -247,9 +236,35 @@ public class ChartMixService extends ViewPluginService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 同比/环比计算 over
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> formatResult(PluginViewParam pluginViewParam, List<String[]> data, Boolean isDrill) {
|
||||
List<PluginViewField> xAxis = new ArrayList<>();
|
||||
List<PluginViewField> yAxis = new ArrayList<>();
|
||||
|
||||
|
||||
pluginViewParam.getPluginViewFields().forEach(pluginViewField -> {
|
||||
if (StringUtils.equals(pluginViewField.getTypeField(), "xAxis")) {
|
||||
xAxis.add(pluginViewField);
|
||||
}
|
||||
if (StringUtils.equals(pluginViewField.getTypeField(), "yAxis")) {
|
||||
yAxis.add(pluginViewField);
|
||||
}
|
||||
});
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<PluginSeries> series = format(pluginViewParam.getPluginViewLimit().getType(), data, xAxis, yAxis);
|
||||
|
||||
map.put("data", series);
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private List<PluginSeries> format(String type, List<String[]> data, List<PluginViewField> xAxis, List<PluginViewField> yAxis) {
|
||||
List<PluginSeries> series = new ArrayList<>();
|
||||
for (PluginViewField y : yAxis) {
|
||||
PluginSeries series1 = new PluginSeries();
|
||||
|
||||
@ -172,6 +172,19 @@ public class RaceBarService extends ViewPluginService {
|
||||
})
|
||||
);
|
||||
|
||||
Map<String, List<String>> groupXs = data.stream().collect(Collectors.toMap(
|
||||
k -> StringUtils.defaultString(k[(Integer) map.get("extIndex")], StringUtils.EMPTY),
|
||||
v -> {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(v[encode.get("y")]);
|
||||
return list;
|
||||
},
|
||||
(oldList, newList) -> {
|
||||
oldList.addAll(newList);
|
||||
return oldList;
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
map.put("groupData", groupData);
|
||||
|
||||
@ -179,6 +192,7 @@ public class RaceBarService extends ViewPluginService {
|
||||
|
||||
map.put("xs", xs);
|
||||
|
||||
map.put("groupXs", groupXs);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@ -480,6 +480,8 @@ export default {
|
||||
chart_option.graphic.elements[0].style.text = "";
|
||||
}
|
||||
|
||||
chart_option.yAxis.data = chart.data.groupXs[_currentIndex];
|
||||
|
||||
this.currentIndex = _currentIndex;
|
||||
|
||||
_chart.setOption(chart_option);
|
||||
@ -583,7 +585,7 @@ export default {
|
||||
}
|
||||
|
||||
chart_option.yAxis.max = this.sliderMax;
|
||||
chart_option.yAxis.data = chart.data.xs;
|
||||
//chart_option.yAxis.data = chart.data.xs;
|
||||
|
||||
chart_option.animationDurationUpdate = this.sliderTimeout;
|
||||
|
||||
|
||||
@ -27,6 +27,8 @@ public class ExportTask implements Serializable {
|
||||
|
||||
private String exportMachineName;
|
||||
|
||||
private String msg;
|
||||
|
||||
private String params;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -843,6 +843,76 @@ public class ExportTaskExample {
|
||||
addCriterion("export_machine_name not between", value1, value2, "exportMachineName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgIsNull() {
|
||||
addCriterion("msg is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgIsNotNull() {
|
||||
addCriterion("msg is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgEqualTo(String value) {
|
||||
addCriterion("msg =", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgNotEqualTo(String value) {
|
||||
addCriterion("msg <>", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgGreaterThan(String value) {
|
||||
addCriterion("msg >", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("msg >=", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgLessThan(String value) {
|
||||
addCriterion("msg <", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgLessThanOrEqualTo(String value) {
|
||||
addCriterion("msg <=", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgLike(String value) {
|
||||
addCriterion("msg like", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgNotLike(String value) {
|
||||
addCriterion("msg not like", value, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgIn(List<String> values) {
|
||||
addCriterion("msg in", values, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgNotIn(List<String> values) {
|
||||
addCriterion("msg not in", values, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgBetween(String value1, String value2) {
|
||||
addCriterion("msg between", value1, value2, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMsgNotBetween(String value1, String value2) {
|
||||
addCriterion("msg not between", value1, value2, "msg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
<result column="export_time" jdbcType="BIGINT" property="exportTime" />
|
||||
<result column="export_pogress" jdbcType="VARCHAR" property="exportPogress" />
|
||||
<result column="export_machine_name" jdbcType="VARCHAR" property="exportMachineName" />
|
||||
<result column="msg" jdbcType="VARCHAR" property="msg" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.plugins.common.base.domain.ExportTask">
|
||||
<result column="params" jdbcType="LONGVARCHAR" property="params" />
|
||||
@ -77,7 +78,7 @@
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, file_name, file_size, file_size_unit, export_from, export_status, export_from_type,
|
||||
export_time, export_pogress, export_machine_name
|
||||
export_time, export_pogress, export_machine_name, msg
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
params
|
||||
@ -134,13 +135,13 @@
|
||||
insert into export_task (id, user_id, file_name,
|
||||
file_size, file_size_unit, export_from,
|
||||
export_status, export_from_type, export_time,
|
||||
export_pogress, export_machine_name, params
|
||||
)
|
||||
export_pogress, export_machine_name, msg,
|
||||
params)
|
||||
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{fileName,jdbcType=VARCHAR},
|
||||
#{fileSize,jdbcType=DOUBLE}, #{fileSizeUnit,jdbcType=VARCHAR}, #{exportFrom,jdbcType=VARCHAR},
|
||||
#{exportStatus,jdbcType=VARCHAR}, #{exportFromType,jdbcType=VARCHAR}, #{exportTime,jdbcType=BIGINT},
|
||||
#{exportPogress,jdbcType=VARCHAR}, #{exportMachineName,jdbcType=VARCHAR}, #{params,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
#{exportPogress,jdbcType=VARCHAR}, #{exportMachineName,jdbcType=VARCHAR}, #{msg,jdbcType=VARCHAR},
|
||||
#{params,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.dataease.plugins.common.base.domain.ExportTask">
|
||||
insert into export_task
|
||||
@ -178,6 +179,9 @@
|
||||
<if test="exportMachineName != null">
|
||||
export_machine_name,
|
||||
</if>
|
||||
<if test="msg != null">
|
||||
msg,
|
||||
</if>
|
||||
<if test="params != null">
|
||||
params,
|
||||
</if>
|
||||
@ -216,6 +220,9 @@
|
||||
<if test="exportMachineName != null">
|
||||
#{exportMachineName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="msg != null">
|
||||
#{msg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="params != null">
|
||||
#{params,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@ -263,6 +270,9 @@
|
||||
<if test="record.exportMachineName != null">
|
||||
export_machine_name = #{record.exportMachineName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.msg != null">
|
||||
msg = #{record.msg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.params != null">
|
||||
params = #{record.params,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@ -284,6 +294,7 @@
|
||||
export_time = #{record.exportTime,jdbcType=BIGINT},
|
||||
export_pogress = #{record.exportPogress,jdbcType=VARCHAR},
|
||||
export_machine_name = #{record.exportMachineName,jdbcType=VARCHAR},
|
||||
msg = #{record.msg,jdbcType=VARCHAR},
|
||||
params = #{record.params,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
@ -301,7 +312,8 @@
|
||||
export_from_type = #{record.exportFromType,jdbcType=VARCHAR},
|
||||
export_time = #{record.exportTime,jdbcType=BIGINT},
|
||||
export_pogress = #{record.exportPogress,jdbcType=VARCHAR},
|
||||
export_machine_name = #{record.exportMachineName,jdbcType=VARCHAR}
|
||||
export_machine_name = #{record.exportMachineName,jdbcType=VARCHAR},
|
||||
msg = #{record.msg,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
@ -339,6 +351,9 @@
|
||||
<if test="exportMachineName != null">
|
||||
export_machine_name = #{exportMachineName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="msg != null">
|
||||
msg = #{msg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="params != null">
|
||||
params = #{params,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@ -357,6 +372,7 @@
|
||||
export_time = #{exportTime,jdbcType=BIGINT},
|
||||
export_pogress = #{exportPogress,jdbcType=VARCHAR},
|
||||
export_machine_name = #{exportMachineName,jdbcType=VARCHAR},
|
||||
msg = #{msg,jdbcType=VARCHAR},
|
||||
params = #{params,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
@ -371,7 +387,8 @@
|
||||
export_from_type = #{exportFromType,jdbcType=VARCHAR},
|
||||
export_time = #{exportTime,jdbcType=BIGINT},
|
||||
export_pogress = #{exportPogress,jdbcType=VARCHAR},
|
||||
export_machine_name = #{exportMachineName,jdbcType=VARCHAR}
|
||||
export_machine_name = #{exportMachineName,jdbcType=VARCHAR},
|
||||
msg = #{msg,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -63,15 +63,11 @@
|
||||
|
||||
|
||||
|
||||
<table tableName="panel_link_ticket">
|
||||
|
||||
<table tableName="export_task">
|
||||
<columnOverride column="msg" jdbcType="VARCHAR"/>
|
||||
</table>
|
||||
|
||||
<!-- <table tableName="dataset_table_field">-->
|
||||
<!-- <columnOverride column="origin_name" jdbcType="VARCHAR"/>-->
|
||||
<!-- <columnOverride column="name" jdbcType="VARCHAR"/>-->
|
||||
<!-- </table>-->
|
||||
|
||||
|
||||
</context>
|
||||
</generatorConfiguration>
|
||||
|
||||
@ -35,4 +35,6 @@ public class PluginChartViewFieldBase implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private String dateFormat;
|
||||
|
||||
}
|
||||
|
||||
@ -22,4 +22,5 @@ public class PluginDatasetTableField implements Serializable {
|
||||
private Boolean checked;
|
||||
private Integer columnIndex;
|
||||
private Long lastSyncTime;
|
||||
private String dateFormat;
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package io.dataease.plugins.view.handler;
|
||||
|
||||
import io.dataease.plugins.view.entity.PluginViewParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author Junjun
|
||||
*/
|
||||
public interface PluginViewYOYHandler {
|
||||
List<String[]> yoy(PluginViewParam pluginViewParam, List<String[]> data);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package io.dataease.plugins.view.handler.impl;
|
||||
|
||||
import io.dataease.plugins.view.entity.PluginViewParam;
|
||||
import io.dataease.plugins.view.handler.PluginViewYOYHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author Junjun
|
||||
*/
|
||||
public class DefaultViewYOYHandler implements PluginViewYOYHandler {
|
||||
@Override
|
||||
public List<String[]> yoy(PluginViewParam pluginViewParam, List<String[]> data) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -6,8 +6,11 @@ import io.dataease.plugins.view.entity.PluginViewParam;
|
||||
import io.dataease.plugins.view.entity.PluginViewType;
|
||||
import io.dataease.plugins.view.handler.PluginViewRSHandler;
|
||||
import io.dataease.plugins.view.handler.PluginViewStatHandler;
|
||||
import io.dataease.plugins.view.handler.PluginViewYOYHandler;
|
||||
import io.dataease.plugins.view.handler.impl.DefaultViewRSHandler;
|
||||
import io.dataease.plugins.view.handler.impl.DefaultViewStatHandler;
|
||||
import io.dataease.plugins.view.handler.impl.DefaultViewYOYHandler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -20,6 +23,8 @@ public abstract class ViewPluginService extends PluginComponentService {
|
||||
|
||||
private PluginViewRSHandler<Map> rsHandler;
|
||||
|
||||
private PluginViewYOYHandler yoyHandler;
|
||||
|
||||
|
||||
public abstract PluginViewType viewType();
|
||||
|
||||
@ -35,11 +40,16 @@ public abstract class ViewPluginService extends PluginComponentService {
|
||||
return rsHandler.format(param, lists, isDrill);
|
||||
}
|
||||
|
||||
public List<String[]> yoy(PluginViewParam param, List<String[]> lists) {
|
||||
yoyHandler = new DefaultViewYOYHandler();
|
||||
return yoyHandler.yoy(param, lists);
|
||||
}
|
||||
|
||||
public ViewPluginBaseService getBaseService() {
|
||||
return viewPluginBaseService;
|
||||
}
|
||||
|
||||
public ViewPluginService() {
|
||||
this.viewPluginBaseService = (ViewPluginBaseService)PluginSpringContextUtil.getBean("viewPluginBaseServiceImpl");
|
||||
this.viewPluginBaseService = (ViewPluginBaseService) PluginSpringContextUtil.getBean("viewPluginBaseServiceImpl");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user