提交 05003e5f authored 作者: wangjiahao's avatar wangjiahao

Merge branch 'dev' of github.com:dataease/dataease into dev

......@@ -222,11 +222,7 @@
<artifactId>dataease-plugin-view</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.4</version>
</dependency>
<!-- kettle及数据源依赖 -->
<dependency>
<groupId>pentaho-kettle</groupId>
......
......@@ -33,6 +33,7 @@
panel_group.`name` AS label,
panel_group.`source`,
panel_group.`panel_type`,
sourcePanelGroup.`mobile_layout`,
sourcePanelGroup.`name` as source_panel_name,
authInfo.privileges as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
......@@ -105,6 +106,7 @@
panel_group.panel_type,
panel_group.`name` AS label,
panel_group.`node_type`,
panel_group.`mobile_layout`,
(case when ISNULL(defaultPanelGroup.id) then false else true end) is_default,
defaultPanelGroup.id as default_panel_id,
defaultPanelGroup.`name` as default_panel_name,
......
......@@ -4,6 +4,7 @@ public enum DatasourceTypes {
excel("excel", "excel", "", "", "", "", ""),
mysql("mysql", "mysql", "com.mysql.jdbc.Driver", "`", "`", "'", "'"),
hive("hive", "hive", "org.apache.hive.jdbc.HiveDriver", "`", "`", "'", "'"),
impala("impala", "impala", "org.apache.hive.jdbc.HiveDriver", "`", "`", "'", "'"),
mariadb("mariadb", "mariadb", "com.mysql.jdbc.Driver", "`", "`", "'", "'"),
ds_doris("ds_doris", "ds_doris", "com.mysql.jdbc.Driver", "`", "`", "'", "'"),
pg("pg", "pg", "org.postgresql.Driver", "\"", "\"", "\"", "\""),
......
package io.dataease.dto.datasource;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
@Getter
@Setter
public class ImpalaConfiguration extends JdbcConfiguration {
private String driver = "com.cloudera.impala.jdbc.Driver";
private String extraParams = "";
public String getJdbc() {
if(StringUtils.isEmpty(extraParams.trim())){
return "jdbc:impala://HOSTNAME:PORT/DATABASE"
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
}else {
return "jdbc:impala://HOSTNAME:PORT/DATABASE;EXTRA_PARAMS"
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim())
.replace("EXTRA_PARAMS", getExtraParams().trim());
}
}
}
\ No newline at end of file
......@@ -54,6 +54,8 @@ public class ProviderFactory implements ApplicationContextAware {
return context.getBean("redshiftQuery", QueryProvider.class);
case hive:
return context.getBean("hiveQuery", QueryProvider.class);
case impala:
return context.getBean("impalaQuery", QueryProvider.class);
case db2:
return context.getBean("db2Query", QueryProvider.class);
case api:
......
......@@ -9,7 +9,7 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.datasource.JdbcConfiguration;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.provider.query.pg.PgConstants;
import io.dataease.plugins.common.constants.PgConstants;
import java.util.List;
......
package io.dataease.provider;
import java.util.ArrayList;
import java.util.List;
/**
* @Author gin
* @Date 2021/7/8 3:12 下午
*/
public class SQLConstants {
/**
* 维度类型list
*/
public static final List<Integer> DIMENSION_TYPE = new ArrayList<Integer>() {{
add(0);// 文本
add(1);// 时间
add(5);// 地理位置
}};
/**
* 指标类型list
*/
public static final List<Integer> QUOTA_TYPE = new ArrayList<Integer>() {{
add(2);// 整型
add(3);// 浮点
add(4);// 布尔
}};
/**
* sql ST模板
*/
public static final String SQL_TEMPLATE = "sql/sqlTemplate.stg";
public static final String TABLE_ALIAS_PREFIX = "t_a_%s";
public static final String FIELD_ALIAS_X_PREFIX = "f_ax_%s";
public static final String FIELD_ALIAS_Y_PREFIX = "f_ay_%s";
public static final String GROUP_ALIAS_PREFIX = "g_a_%s";
public static final String ORDER_ALIAS_X_PREFIX = "o_ax_%s";
public static final String ORDER_ALIAS_Y_PREFIX = "o_ay_%s";
public static final String WHERE_ALIAS_PREFIX = "w_a_%s";
}
......@@ -154,7 +154,7 @@ public class JdbcProvider extends DatasourceProvider {
while (resultSet.next()) {
String tableName = resultSet.getString("TABLE_NAME");
String database;
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.ck.name())) {
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.ck.name()) || datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.impala.name())) {
database = resultSet.getString("TABLE_SCHEM");
} else {
database = resultSet.getString("TABLE_CAT");
......@@ -485,6 +485,14 @@ public class JdbcProvider extends DatasourceProvider {
driver = hiveConfiguration.getDriver();
jdbcurl = hiveConfiguration.getJdbc();
break;
case impala:
ImpalaConfiguration impalaConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), ImpalaConfiguration.class);
System.out.println(new Gson().toJson(impalaConfiguration));
username = impalaConfiguration.getUsername();
password = impalaConfiguration.getPassword();
driver = impalaConfiguration.getDriver();
jdbcurl = impalaConfiguration.getJdbc();
break;
case db2:
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
username = db2Configuration.getUsername();
......@@ -586,6 +594,13 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setUrl(hiveConfiguration.getJdbc());
jdbcConfiguration = hiveConfiguration;
break;
case impala:
ImpalaConfiguration impalaConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), ImpalaConfiguration.class);
dataSource.setPassword(impalaConfiguration.getPassword());
dataSource.setDriverClassName(impalaConfiguration.getDriver());
dataSource.setUrl(impalaConfiguration.getJdbc());
jdbcConfiguration = impalaConfiguration;
break;
case db2:
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
dataSource.setPassword(db2Configuration.getPassword());
......@@ -614,6 +629,7 @@ public class JdbcProvider extends DatasourceProvider {
case engine_doris:
case ds_doris:
case hive:
case impala:
return "show tables";
case sqlServer:
SqlServerConfiguration sqlServerConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfiguration.class);
......
package io.dataease.provider.engine.doris;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.engine_doris;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class DorisConstants extends SQLConstants {
public static final String KEYWORD_TABLE = engine_doris.getKeywordPrefix() + "%s" + engine_doris.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + engine_doris.getKeywordPrefix() + "%s" + engine_doris.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "UNIX_TIMESTAMP(%s)";
public static final String DATE_FORMAT = "DATE_FORMAT(%s,'%s')";
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String STR_TO_DATE = "STR_TO_DATE(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%i:%S";
public static final String DEFAULT_INT_FORMAT = "BIGINT";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String WHERE_NUMBER_VALUE = "%s";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
public static final String ROUND = "ROUND(%s,%s)";
public static final String VARCHAR = "VARCHAR";
}
......@@ -10,8 +10,9 @@ import io.dataease.dto.chart.ChartCustomFilterItemDTO;
import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.DorisConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -28,7 +29,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.engine.mysql;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.engine_mysql;
......
......@@ -11,7 +11,7 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -28,7 +28,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.query.ck;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.ck;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class CKConstants extends SQLConstants {
public static final String KEYWORD_TABLE = ck.getKeywordPrefix() + "%s" + ck.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + ck.getKeywordPrefix() + "%s" + ck.getKeywordSuffix();
public static final String toInt32 = "toInt32(%s)";
public static final String toDateTime = "toDateTime(%s)";
public static final String toInt64 = "toInt64(%s)";
public static final String toFloat64 = "toFloat64(%s)";
public static final String formatDateTime = "formatDateTime(%s,'%s')";
public static final String toDecimal = "toDecimal64(%s,2)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%M:%S";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -11,8 +11,9 @@ import io.dataease.dto.chart.ChartCustomFilterItemDTO;
import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.CKConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -29,7 +30,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.query.db2;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.db2;
public class Db2Constants extends SQLConstants {
public static final String KEYWORD_TABLE = db2.getKeywordPrefix() + "%s" + db2.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + db2.getKeywordPrefix() + "%s" + db2.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "BIGINT(TIMESTAMPDIFF(2,CHAR(%s -TIMESTAMP('1970-01-01 08:00:00'))))";
public static final String DATE_FORMAT = "TO_CHAR(TIMESTAMP(%s),'%s')";
public static final String FROM_UNIXTIME = "TO_CHAR(TIMESTAMP('1970-01-01 08:00:00') +(%s)SECONDS, '%s')";
public static final String STR_TO_DATE = "timestamp(trim(char(%s)))";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH24:MI:SS";
public static final String DEFAULT_INT_FORMAT = "BIGINT";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -13,8 +13,9 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.datasource.Db2Configuration;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.Db2Constants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -31,7 +32,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
@Service("db2Query")
public class Db2QueryProvider extends QueryProvider {
......
......@@ -11,8 +11,9 @@ import io.dataease.dto.chart.ChartCustomFilterItemDTO;
import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.EsSqlLConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -29,7 +30,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
@Service("esQuery")
public class EsQueryProvider extends QueryProvider {
......
package io.dataease.provider.query.es;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.es;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class EsSqlLConstants extends SQLConstants {
public static final String KEYWORD_TABLE = es.getKeywordPrefix() + "%s" + es.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + es.getKeywordPrefix() + "%s" + es.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "UNIX_TIMESTAMP(%s)";
public static final String DATETIME_FORMAT = "DATETIME_FORMAT(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String ROUND = "ROUND(%s, %s)";
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -11,8 +11,9 @@ import io.dataease.dto.chart.ChartCustomFilterItemDTO;
import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.HiveConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -29,7 +30,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.query.hive;
package io.dataease.provider.query.impala;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.mysql;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class HiveConstants extends SQLConstants {
public class ImpalaConstants extends SQLConstants {
public static final String KEYWORD_TABLE = mysql.getKeywordPrefix() + "%s" + mysql.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + mysql.getKeywordPrefix() + "%s" + mysql.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "unix_timestamp(%s)";
public static final String DATE_FORMAT = "DATE_FORMAT(%s,'%s')";
public static final String DATE_FORMAT = "from_unixtime(UNIX_TIMESTAMP(%s), '%s')";
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
......@@ -25,7 +21,7 @@ public class HiveConstants extends SQLConstants {
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String DEFAULT_INT_FORMAT = "DECIMAL(20,0)";
public static final String DEFAULT_INT_FORMAT = "BIGINT";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
......
package io.dataease.provider.query.mongodb;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.mongo;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class MongoConstants extends SQLConstants {
public static final String KEYWORD_TABLE = "%s";
public static final String KEYWORD_FIX = "%s." + mongo.getKeywordPrefix() + "%s" + mongo.getKeywordSuffix();
public static final String ALIAS_FIX = mongo.getAliasPrefix() + "%s" + mongo.getAliasSuffix();
public static final String toInt32 = "toInt32(%s)";
public static final String toDateTime = "toDateTime(%s)";
public static final String toInt64 = "toInt64(%s)";
public static final String toFloat64 = "toFloat64(%s)";
public static final String formatDateTime = "formatDateTime(%s,'%s')";
public static final String toDecimal = "toDecimal64(%s,2)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%M:%S";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -11,8 +11,9 @@ import io.dataease.dto.chart.ChartCustomFilterItemDTO;
import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.MongoConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -29,7 +30,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.query.mysql;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.mysql;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class MySQLConstants extends SQLConstants {
public static final String KEYWORD_TABLE = mysql.getKeywordPrefix() + "%s" + mysql.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + mysql.getKeywordPrefix() + "%s" + mysql.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "UNIX_TIMESTAMP(%s)";
public static final String DATE_FORMAT = "DATE_FORMAT(%s,'%s')";
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String STR_TO_DATE = "STR_TO_DATE(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%i:%S";
public static final String DEFAULT_INT_FORMAT = "DECIMAL(20,0)";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -10,8 +10,9 @@ import io.dataease.dto.chart.ChartCustomFilterItemDTO;
import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.MySQLConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -28,7 +29,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.query.oracle;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.oracle;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class OracleConstants extends SQLConstants {
public static final String KEYWORD_TABLE = oracle.getKeywordPrefix() + "%s" + oracle.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + oracle.getKeywordPrefix() + "%s" + oracle.getKeywordSuffix();
public static final String ALIAS_FIX = oracle.getAliasPrefix() + "%s" + oracle.getAliasSuffix();
public static final String UNIX_TIMESTAMP = "UNIX_TIMESTAMP(%s)";
public static final String DATE_FORMAT = "to_timestamp(%s,'%s')";
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH24:MI:SS";
public static final String DEFAULT_INT_FORMAT = "DECIMAL(20,0)";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
public static final String TO_NUMBER = "TO_NUMBER(%s)";
public static final String TO_DATE = "TO_DATE(%s,'%s')";
public static final String TO_CHAR = "TO_CHAR(%s,'%s')";
public static final String DEFAULT_START_DATE = "'1970-01-01 8:0:0'";
public static final String TO_MS = " * 24 * 60 * 60 * 100";
public static final String CALC_SUB = "%s - %s";
}
......@@ -13,8 +13,9 @@ import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.datasource.JdbcConfiguration;
import io.dataease.dto.datasource.OracleConfiguration;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.OracleConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -31,7 +32,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
* @Author gin
......
package io.dataease.provider.query.pg;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.pg;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class PgConstants extends SQLConstants {
public static final String KEYWORD_TABLE = pg.getKeywordPrefix() + "%s" + pg.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + pg.getKeywordPrefix() + "%s" + pg.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "floor(extract(epoch from(( %s - timestamp '1970-01-01 00:00:00')*1000))) ";
public static final String DATE_FORMAT = "to_char(%s, '%s')";
public static final String FROM_UNIXTIME = "to_timestamp(%s)";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH24:MI:SS";
public static final String DEFAULT_INT_FORMAT = "numeric(18,0)";
public static final String DEFAULT_FLOAT_FORMAT = "numeric(18,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -13,9 +13,10 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.datasource.JdbcConfiguration;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.PgConstants;
import io.dataease.plugins.common.constants.SqlServerSQLConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.provider.query.sqlserver.SqlServerSQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -32,7 +33,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
@Service("pgQuery")
......
package io.dataease.provider.query.redshift;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.pg;
/**
* Redshift 静态变量
*
* @className: RedshiftConstants
* @description: Redshift 静态变量
* @author: Jiantao Yan
* @date: 2021/10/11 17:12
**/
public class RedshiftConstants extends SQLConstants {
public static final String KEYWORD_TABLE = pg.getKeywordPrefix() + "%s" + pg.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + pg.getKeywordPrefix() + "%s" + pg.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "floor(extract(epoch from(( %s - timestamp '1970-01-01 00:00:00')*1000))) ";
public static final String DATE_FORMAT = "to_char(%s, %s)";
public static final String FROM_UNIXTIME = "to_timestamp(%s)";
public static final String TO_DATE = "to_date(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "'YYYY-MM-DD HH24:MI:SS'";
public static final String DEFAULT_INT_FORMAT = "numeric(18,0)";
public static final String DEFAULT_FLOAT_FORMAT = "numeric(18,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -13,10 +13,11 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.datasource.JdbcConfiguration;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.RedshiftConstants;
import io.dataease.plugins.common.constants.SqlServerSQLConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.provider.query.pg.PgConstants;
import io.dataease.provider.query.sqlserver.SqlServerSQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import io.dataease.plugins.common.constants.PgConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -33,7 +34,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
/**
......
package io.dataease.provider.query.sqlserver;
import io.dataease.provider.SQLConstants;
import static io.dataease.commons.constants.DatasourceTypes.sqlServer;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public class SqlServerSQLConstants extends SQLConstants {
public static final String KEYWORD_TABLE = sqlServer.getKeywordPrefix() + "%s" + sqlServer.getKeywordSuffix();
public static final String KEYWORD_FIX = "%s." + sqlServer.getKeywordPrefix() + "%s" + sqlServer.getKeywordSuffix();
public static final String UNIX_TIMESTAMP = "CAST(DATEDIFF(ss,'1970-01-01 08:00:00', %s) as bigint ) * 1000 ";
public static final String DATE_FORMAT = "CONVERT(varchar(100), %s, %s)";
public static final String FROM_UNIXTIME = "convert(varchar, %s ,120)";
public static final String CONVERT = "CONVERT(%s, %s)";
public static final String LONG_TO_DATE = "DATEADD(second,%s,'1970-01-01 08:00:00')";
public static final String STRING_TO_DATE = "CONVERT(datetime, %s ,120)";
public static final String DEFAULT_INT_FORMAT = "DECIMAL(20,0)";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
public static final String WHERE_VALUE_NULL = "(NULL,'')";
public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)";
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
public static final String BRACKETS = "(%s)";
}
......@@ -13,8 +13,9 @@ import io.dataease.dto.chart.ChartFieldCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.datasource.JdbcConfiguration;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.plugins.common.constants.SqlServerSQLConstants;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.plugins.common.constants.SQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -31,7 +32,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static io.dataease.provider.SQLConstants.TABLE_ALIAS_PREFIX;
import static io.dataease.plugins.common.constants.SQLConstants.TABLE_ALIAS_PREFIX;
@Service("sqlserverQuery")
public class SqlserverQueryProvider extends QueryProvider {
......
......@@ -101,6 +101,7 @@ public class DataSetTableService {
@Resource
private EngineService engineService;
private static boolean isUpdatingDatasetTableStatus = false;
private static final String lastUpdateTime = "${__last_update_time__}";
private static final String currentUpdateTime = "${__current_update_time__}";
......@@ -2182,15 +2183,30 @@ public class DataSetTableService {
private UtilMapper utilMapper;
public void updateDatasetTableStatus() {
if(this.isUpdatingDatasetTableStatus){
return;
}else {
this.isUpdatingDatasetTableStatus = true;
}
try {
doUpdate();
}catch (Exception e){}
finally {
this.isUpdatingDatasetTableStatus = false;
}
}
private void doUpdate(){
List<QrtzSchedulerState> qrtzSchedulerStates = qrtzSchedulerStateMapper.selectByExample(null);
List<String> activeQrtzInstances = qrtzSchedulerStates.stream()
.filter(qrtzSchedulerState -> qrtzSchedulerState.getLastCheckinTime()
+ qrtzSchedulerState.getCheckinInterval() + 1000 > utilMapper.currentTimestamp())
.map(QrtzSchedulerStateKey::getInstanceName).collect(Collectors.toList());
List<DatasetTable> jobStoppeddDatasetTables = new ArrayList<>();
DatasetTableExample example = new DatasetTableExample();
example.createCriteria().andSyncStatusEqualTo(JobStatus.Underway.name());
datasetTableMapper.selectByExample(example).forEach(datasetTable -> {
if (StringUtils.isEmpty(datasetTable.getQrtzInstance()) || !activeQrtzInstances.contains(
datasetTable.getQrtzInstance().substring(0, datasetTable.getQrtzInstance().length() - 13))) {
......@@ -2202,6 +2218,7 @@ public class DataSetTableService {
return;
}
//DatasetTable
DatasetTable record = new DatasetTable();
record.setSyncStatus(JobStatus.Error.name());
example.clear();
......@@ -2209,6 +2226,14 @@ public class DataSetTableService {
.andIdIn(jobStoppeddDatasetTables.stream().map(DatasetTable::getId).collect(Collectors.toList()));
datasetTableMapper.updateByExampleSelective(record, example);
//Task
DatasetTableTaskExample datasetTableTaskExample = new DatasetTableTaskExample();
DatasetTableTaskExample.Criteria criteria = datasetTableTaskExample.createCriteria();
criteria.andTableIdIn(jobStoppeddDatasetTables.stream().map(DatasetTable::getId).collect(Collectors.toList())).andStatusEqualTo(JobStatus.Underway.name());
List<DatasetTableTask> datasetTableTasks = dataSetTableTaskService.list(datasetTableTaskExample);
dataSetTableTaskService.updateTaskStatus(datasetTableTasks, JobStatus.Error);
//TaskLog
DatasetTableTaskLog datasetTableTaskLog = new DatasetTableTaskLog();
datasetTableTaskLog.setStatus(JobStatus.Error.name());
datasetTableTaskLog.setInfo("Job stopped due to system error.");
......@@ -2216,19 +2241,14 @@ public class DataSetTableService {
DatasetTableTaskLogExample datasetTableTaskLogExample = new DatasetTableTaskLogExample();
datasetTableTaskLogExample.createCriteria().andStatusEqualTo(JobStatus.Underway.name())
.andTableIdIn(jobStoppeddDatasetTables.stream().map(DatasetTable::getId).collect(Collectors.toList()));
List<String> taskIds = datasetTableTaskLogMapper.selectByExample(datasetTableTaskLogExample).stream()
.map(DatasetTableTaskLog::getTaskId).collect(Collectors.toList());
datasetTableTaskLogMapper.updateByExampleSelective(datasetTableTaskLog, datasetTableTaskLogExample);
dataSetTableTaskService.updateTaskStatus(taskIds, JobStatus.Error);
for (DatasetTable jobStoppeddDatasetTable : jobStoppeddDatasetTables) {
extractDataService.deleteFile("all_scope", jobStoppeddDatasetTable.getId());
extractDataService.deleteFile("incremental_add", jobStoppeddDatasetTable.getId());
extractDataService.deleteFile("incremental_delete", jobStoppeddDatasetTable.getId());
}
}
/*
* 判断数组中是否有重复的值
*/
......
......@@ -161,13 +161,13 @@ public class DataSetTableTaskService {
return datasetTableTaskMapper.selectByPrimaryKey(id);
}
public void updateTaskStatus(List<String> taskIds, JobStatus lastExecStatus) {
if (CollectionUtils.isEmpty(taskIds)) {
return;
public List<DatasetTableTask> list(DatasetTableTaskExample example) {
return datasetTableTaskMapper.selectByExample(example);
}
DatasetTableTaskExample example = new DatasetTableTaskExample();
example.createCriteria().andIdIn(taskIds);
List<DatasetTableTask> datasetTableTasks = datasetTableTaskMapper.selectByExample(example);
public void updateTaskStatus(List<DatasetTableTask> datasetTableTasks, JobStatus lastExecStatus) {
for (DatasetTableTask tableTask : datasetTableTasks) {
updateTaskStatus(tableTask, lastExecStatus);
}
......@@ -202,7 +202,7 @@ public class DataSetTableTaskService {
if (datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.name())) {
datasetTableTask.setStatus(TaskStatus.Stopped.name());
} else {
datasetTableTask = datasetTableTaskMapper.selectByPrimaryKey(datasetTableTask.getId());
// datasetTableTask = datasetTableTaskMapper.selectByPrimaryKey(datasetTableTask.getId());
datasetTableTask.setLastExecStatus(lastExecStatus.name());
if (StringUtils.isNotEmpty(datasetTableTask.getEnd()) && datasetTableTask.getEnd().equalsIgnoreCase("1")) {
BaseGridRequest request = new BaseGridRequest();
......
......@@ -140,7 +140,7 @@ public class ExtractDataService {
datasetTableTaskLog.setTableId(datasetTable.getId());
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
return !CollectionUtils.isNotEmpty(datasetTableTaskLogs) || !datasetTableTaskLogs.get(0).getTriggerType().equalsIgnoreCase(TriggerType.Custom.name());
return CollectionUtils.isEmpty(datasetTableTaskLogs) || !datasetTableTaskLogs.get(0).getTriggerType().equalsIgnoreCase(TriggerType.Custom.name());
} else {
datasetTableTask.setLastExecTime(startTime);
datasetTableTask.setLastExecStatus(JobStatus.Underway.name());
......@@ -159,7 +159,7 @@ public class ExtractDataService {
return;
}
UpdateType updateType = UpdateType.valueOf(type);
DatasetTableTaskLog datasetTableTaskLog;
if (datasetTableFields == null) {
datasetTableFields = dataSetTableFieldsService.list(DatasetTableField.builder().tableId(datasetTable.getId()).build());
}
......@@ -174,10 +174,10 @@ public class ExtractDataService {
return o1.getColumnIndex().compareTo(o2.getColumnIndex());
});
DatasetTableTaskLog datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableId, ops);
switch (updateType) {
case all_scope: // 全量更新
try {
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableId, ops);
createEngineTable(TableUtils.tableName(datasetTableId), datasetTableFields);
createEngineTable(TableUtils.tmpName(TableUtils.tableName(datasetTableId)), datasetTableFields);
Long execTime = System.currentTimeMillis();
......@@ -222,7 +222,7 @@ public class ExtractDataService {
toDelete.forEach(datasetTableField -> dataSetTableFieldsService.delete(datasetTableField.getId()));
}
} catch (Exception e) {
saveErrorLog(datasetTableId, null, e);
saveErrorLog(datasetTableTaskLog, e);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
dropDorisTable(TableUtils.tmpName(TableUtils.tableName(datasetTableId)));
} finally {
......@@ -233,7 +233,6 @@ public class ExtractDataService {
case add_scope: // 增量更新
try {
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableId, ops);
Long execTime = System.currentTimeMillis();
if (!engineService.isSimpleMode()) {
generateTransFile("incremental_add", datasetTable, datasource, datasetTableFields, null);
......@@ -245,7 +244,7 @@ public class ExtractDataService {
saveSuccessLog(datasetTableTaskLog);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
} catch (Exception e) {
saveErrorLog(datasetTableId, null, e);
saveErrorLog(datasetTableTaskLog, e);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
} finally {
deleteFile("incremental_add", datasetTableId);
......@@ -312,7 +311,7 @@ public class ExtractDataService {
msg = true;
lastExecStatus = JobStatus.Completed;
} catch (Exception e) {
saveErrorLog(datasetTableId, taskId, e);
saveErrorLog(datasetTableTaskLog, e);
msg = false;
lastExecStatus = JobStatus.Error;
execTime = null;
......@@ -372,7 +371,7 @@ public class ExtractDataService {
msg = true;
lastExecStatus = JobStatus.Completed;
} catch (Exception e) {
saveErrorLog(datasetTableId, taskId, e);
saveErrorLog(datasetTableTaskLog, e);
msg = false;
lastExecStatus = JobStatus.Error;
execTime = null;
......@@ -592,26 +591,14 @@ public class ExtractDataService {
dataSetTableTaskLogService.save(datasetTableTaskLog);
}
private void saveErrorLog(String datasetTableId, String taskId, Exception e) {
LogUtil.error("Extract data error: " + datasetTableId, e);
DatasetTableTaskLog datasetTableTaskLog = new DatasetTableTaskLog();
datasetTableTaskLog.setTableId(datasetTableId);
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
if (StringUtils.isNotEmpty(taskId)) {
datasetTableTaskLog.setTaskId(taskId);
}
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
if (CollectionUtils.isNotEmpty(datasetTableTaskLogs)) {
datasetTableTaskLog = datasetTableTaskLogs.get(0);
private void saveErrorLog(DatasetTableTaskLog datasetTableTaskLog, Exception e) {
LogUtil.error("Extract data error: " + datasetTableTaskLog.getTaskId(), e);
datasetTableTaskLog.setStatus(JobStatus.Error.name());
datasetTableTaskLog.setInfo(e.getMessage());
datasetTableTaskLog.setEndTime(System.currentTimeMillis());
dataSetTableTaskLogService.save(datasetTableTaskLog);
}
}
private void createEngineTable(String tableName, List<DatasetTableField> datasetTableFields) throws Exception {
Datasource engine = engineService.getDeEngine();
JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);
......@@ -671,14 +658,9 @@ public class ExtractDataService {
datasetTableTaskLog.setTaskId(taskId);
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
datasetTableTaskLog.setTriggerType(TriggerType.Cron.name());
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
if (CollectionUtils.isEmpty(datasetTableTaskLogs)) {
datasetTableTaskLog.setStartTime(System.currentTimeMillis());
dataSetTableTaskLogService.save(datasetTableTaskLog);
return datasetTableTaskLog;
} else {
return datasetTableTaskLogs.get(0);
}
}
private DatasetTableTaskLog getDatasetTableTaskLog(String datasetTableId, String taskId, Long startTime) {
......@@ -687,7 +669,7 @@ public class ExtractDataService {
datasetTableTaskLog.setTaskId(taskId);
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
datasetTableTaskLog.setTriggerType(TriggerType.Custom.name());
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 5; i++) {
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
if (CollectionUtils.isNotEmpty(datasetTableTaskLogs)) {
return datasetTableTaskLogs.get(0);
......
......@@ -213,5 +213,5 @@ export function checkCustomDs() {
loading: true
})
}
export const disabledSyncDs= ['es', 'ck', 'mongo', 'redshift', 'hive', 'impala']
export default { loadTable, getScene, addGroup, delGroup, addTable, delTable, groupTree, checkCustomDs }
......@@ -4,7 +4,8 @@ export function save(data) {
return request({
url: '/template/save',
data: data,
method: 'post'
method: 'post',
loading: true
})
}
export function templateDelete(id) {
......
<svg width="1285" height="1024" xmlns="http://www.w3.org/2000/svg" p-id="2359" version="1.1" class="icon" t="1621433305409">
<defs>
<filter id="svg_4_blur">
<feGaussianBlur stdDeviation="0" in="SourceGraphic"/>
</filter>
</defs>
<g>
<title>Layer 1</title>
<path id="svg_1" p-id="2360" fill="#0069F6" d="m100.39216,70.27451a30.11765,30.11765 0 0 0 -30.11765,30.11765l0,823.21568a30.11765,30.11765 0 0 0 30.11765,30.11765l1084.23529,0a30.11765,30.11765 0 0 0 30.11765,-30.11765l0,-823.21568a30.11765,30.11765 0 0 0 -30.11765,-30.11765l-1084.23529,0zm0,-60.23529l1084.23529,0a90.35294,90.35294 0 0 1 90.35294,90.35294l0,823.21568a90.35294,90.35294 0 0 1 -90.35294,90.35294l-1084.23529,0a90.35294,90.35294 0 0 1 -90.35294,-90.35294l0,-823.21568a90.35294,90.35294 0 0 1 90.35294,-90.35294z"/>
<path id="svg_2" p-id="2361" fill="#5ED7BC" d="m261.01961,261.01961m-60.2353,0a60.23529,60.23529 0 1 0 120.47059,0a60.23529,60.23529 0 1 0 -120.47059,0z"/>
<path id="svg_3" p-id="2362" fill="#5ED7BC" d="m331.29412,839.47922a30.11765,30.11765 0 0 1 -60.2353,0a189.94196,189.94196 0 0 1 189.94196,-189.94197l186.58887,0a102.46023,102.46023 0 0 0 98.4847,-130.71058a162.69553,162.69553 0 0 1 156.37083,-207.61098l241.14196,0a30.11765,30.11765 0 0 1 0,60.23529l-241.14196,0a102.46023,102.46023 0 0 0 -98.46463,130.73067a162.69553,162.69553 0 0 1 -156.3909,207.61098l-186.58887,0a129.70667,129.70667 0 0 0 -129.70666,129.70666l0,-0.02007z"/>
<rect stroke="null" id="svg_8" height="760.00015" width="508.00008" y="187.00002" x="689.50014" fill="#000000"/>
<rect stroke="null" rx="5" filter="url(#svg_4_blur)" id="svg_4" height="669.66668" width="430.00003" y="231.99995" x="728.16665" fill="#56ffff"/>
<line stroke="null" id="svg_5" y2="392.99996" x2="754.16667" y1="392.99996" x1="559.16667" fill="none"/>
<ellipse stroke="null" ry="65.5" rx="66.33335" id="svg_6" cy="823.83325" cx="952.16662" fill="#000000"/>
<rect stroke="null" id="svg_7" height="47.66669" width="187.33336" y="242.6666" x="863.49997" fill="#000000"/>
</g>
</svg>
\ No newline at end of file
......@@ -11,12 +11,11 @@
{{ chart.data.series[0].data[0] }}
</p>
</span>
<!-- 字段名暂时隐藏-->
<!-- <span v-if="dimensionShow" :style="label_space">-->
<!-- <p :style="label_class">-->
<!-- {{ chart.data.datas[0].category }}-->
<!-- </p>-->
<!-- </span>-->
<span v-if="dimensionShow" :style="label_space">
<p :style="label_class">
{{ chart.data.series[0].name }}
</p>
</span>
</div>
</div>
</template>
......
......@@ -48,7 +48,7 @@
<el-form-item v-show="(chart.type && (chart.type.includes('text') || chart.type === 'label')) || sourceType==='panelTable'" :label="$t('chart.quota_color')" class="form-item">
<el-color-picker v-model="colorForm.quotaColor" class="color-picker-style" :predefine="predefineColors" @change="changeColorCase" />
</el-form-item>
<el-form-item v-show="(chart.type && chart.type.includes('text')) || sourceType==='panelTable'" :label="$t('chart.dimension_color')" class="form-item">
<el-form-item v-show="(chart.type && chart.type.includes('text') || chart.type === 'label') || sourceType==='panelTable'" :label="$t('chart.dimension_color')" class="form-item">
<el-color-picker v-model="colorForm.dimensionColor" class="color-picker-style" :predefine="predefineColors" @change="changeColorCase" />
</el-form-item>
</div>
......
......@@ -133,15 +133,15 @@
<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="chart.type && (chart.type.includes('text'))" :label="$t('chart.dimension_show')" class="form-item">
<el-form-item v-show="chart.type" :label="$t('chart.dimension_show')" class="form-item">
<el-checkbox v-model="sizeForm.dimensionShow" @change="changeBarSizeCase">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<el-form-item v-show="chart.type && (chart.type.includes('text'))" :label="$t('chart.dimension_font_size')" class="form-item">
<el-form-item v-show="chart.type" :label="$t('chart.dimension_font_size')" class="form-item">
<el-select v-model="sizeForm.dimensionFontSize" :placeholder="$t('chart.dimension_font_size')" @change="changeBarSizeCase">
<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="chart.type && (chart.type.includes('text'))" :label="$t('chart.space_split')" class="form-item">
<el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item">
<el-input-number v-model="sizeForm.spaceSplit" size="mini" @change="changeBarSizeCase" />
</el-form-item>
</el-form>
......
......@@ -159,15 +159,15 @@
<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="chart.type && (chart.type.includes('text'))" :label="$t('chart.dimension_show')" class="form-item">
<el-form-item v-show="chart.type" :label="$t('chart.dimension_show')" class="form-item">
<el-checkbox v-model="sizeForm.dimensionShow" @change="changeBarSizeCase">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<el-form-item v-show="chart.type && (chart.type.includes('text'))" :label="$t('chart.dimension_font_size')" class="form-item">
<el-form-item v-show="chart.type" :label="$t('chart.dimension_font_size')" class="form-item">
<el-select v-model="sizeForm.dimensionFontSize" :placeholder="$t('chart.dimension_font_size')" @change="changeBarSizeCase">
<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="chart.type && (chart.type.includes('text'))" :label="$t('chart.space_split')" class="form-item">
<el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item">
<el-input-number v-model="sizeForm.spaceSplit" size="mini" @change="changeBarSizeCase" />
</el-form-item>
</el-form>
......
......@@ -2882,11 +2882,11 @@ span {
}
::v-deep .el-slider__input {
width: 80px !important;
width: 100px !important;
}
::v-deep .el-input-number--mini {
width: 80px !important;
width: 100px !important;
}
.no-senior {
......
......@@ -69,7 +69,7 @@
</template>
<script>
import {listDatasource, post, isKettleRunning} from '@/api/dataset/dataset'
import {listDatasource, post, isKettleRunning, disabledSyncDs} from '@/api/dataset/dataset'
import {engineMode} from "@/api/system/engine";
export default {
......@@ -94,7 +94,7 @@ export default {
selectedDatasource: {},
engineMode: 'local',
disabledSync: true,
disabledSyncDs: ['es', 'ck', 'mongo', 'redshift', 'hive']
disabledSyncDs: disabledSyncDs
}
},
watch: {
......
......@@ -99,7 +99,7 @@
</template>
<script>
import {post, listDatasource, isKettleRunning} from '@/api/dataset/dataset'
import {post, listDatasource, isKettleRunning, disabledSyncDs} from '@/api/dataset/dataset'
import {codemirror} from 'vue-codemirror'
import {getTable} from '@/api/dataset/dataset'
// 核心样式
......@@ -160,7 +160,8 @@ export default {
kettleRunning: false,
selectedDatasource: {},
engineMode: 'local',
disabledSync: true
disabledSync: true,
disabledSyncDs: disabledSyncDs
}
},
computed: {
......
......@@ -146,13 +146,17 @@ export default {
return false
}
this.editPanel.panelInfo['newFrom'] = this.inputType
this.loading = true
panelSave(this.editPanel.panelInfo).then(response => {
this.$message({
message: this.$t('commons.save_success'),
type: 'success',
showClose: true
})
this.loading = false
this.$emit('closeEditPanelDialog', response.data)
}).catch(() => {
this.loading = false
})
},
handleFileChange(e) {
......
......@@ -39,7 +39,8 @@
<span slot-scope="{ node, data }" class="custom-tree-node father">
<span style="display: flex; flex: 1 1 0%; width: 0px;">
<span>
<svg-icon icon-class="panel" class="ds-icon-scene" />
<svg-icon v-if="!data.mobileLayout" icon-class="panel" class="ds-icon-scene" />
<svg-icon v-if="data.mobileLayout" icon-class="panel-mobile" class="ds-icon-scene" />
</span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
</span>
......@@ -90,7 +91,8 @@
<span slot-scope="{ node, data }" class="custom-tree-node-list father">
<span style="display: flex; flex: 1 1 0%; width: 0px;">
<span v-if="data.nodeType === 'panel'">
<svg-icon icon-class="panel" class="ds-icon-scene" />
<svg-icon v-if="!data.mobileLayout" icon-class="panel" class="ds-icon-scene" />
<svg-icon v-if="data.mobileLayout" icon-class="panel-mobile" class="ds-icon-scene" />
</span>
<span v-if="data.nodeType === 'folder'">
<i class="el-icon-folder" />
......
<template>
<el-row>
<el-row v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-row style="margin-top: 5px">
<el-col :span="4">{{ $t('commons.name') }}</el-col>
<el-col :span="16">
......@@ -44,6 +44,7 @@ export default {
name: '',
templateStyle: null,
templateData: null,
dynamicData: null,
snapshot: ''
}
}
......@@ -118,6 +119,7 @@ export default {
this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle
this.templateInfo.templateData = this.importTemplateInfo.panelData
this.templateInfo.snapshot = this.importTemplateInfo.snapshot
this.templateInfo.dynamicData = this.importTemplateInfo.dynamicData
this.templateInfo.nodeType = 'template'
}
reader.readAsText(file)
......
......@@ -400,6 +400,7 @@ export default {
allTypes: [
{name: 'mysql', label: 'MySQL', type: 'jdbc', extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'},
{name: 'hive', label: 'Apache Hive', type: 'jdbc', extraParams: ''},
{name: 'impala', label: 'Apache Impala', type: 'jdbc', extraParams: 'auth=noSasl'},
{name: 'oracle', label: 'Oracle', type: 'jdbc'},
{name: 'sqlServer', label: 'SQL Server', type: 'jdbc', extraParams: ''},
{name: 'pg', label: 'PostgreSQL', type: 'jdbc', extraParams: ''},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论