forked from github/dataease
Merge pull request #218 from dataease/pr@dev@fix_数据集字段类型浮点转整型
fix: 数据集字段浮点转整型
This commit is contained in:
commit
381febe4cb
@ -7,6 +7,7 @@ import io.dataease.dto.chart.ChartViewFieldDTO;
|
|||||||
import io.dataease.dto.sqlObj.SQLObj;
|
import io.dataease.dto.sqlObj.SQLObj;
|
||||||
import io.dataease.provider.QueryProvider;
|
import io.dataease.provider.QueryProvider;
|
||||||
import io.dataease.provider.SQLConstants;
|
import io.dataease.provider.SQLConstants;
|
||||||
|
import io.dataease.provider.mysql.MySQLConstants;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -114,6 +115,8 @@ public class DorisQueryProvider extends QueryProvider {
|
|||||||
if (f.getDeType() == 1) {
|
if (f.getDeType() == 1) {
|
||||||
String cast = String.format(DorisConstants.CAST, originField, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(DorisConstants.CAST, originField, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
fieldName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
|
fieldName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
|
||||||
|
} else if (f.getDeType() == 2) {
|
||||||
|
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.DEFAULT_INT_FORMAT);
|
||||||
} else {
|
} else {
|
||||||
fieldName = originField;
|
fieldName = originField;
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,8 @@ public class MysqlQueryProvider extends QueryProvider {
|
|||||||
if (f.getDeType() == 1) {
|
if (f.getDeType() == 1) {
|
||||||
String cast = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
fieldName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
|
fieldName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||||
|
} else if (f.getDeType() == 2) {
|
||||||
|
fieldName = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_INT_FORMAT);
|
||||||
} else {
|
} else {
|
||||||
fieldName = originField;
|
fieldName = originField;
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,8 @@ public class OracleQueryProvider extends QueryProvider {
|
|||||||
if (f.getDeType() == 1) {
|
if (f.getDeType() == 1) {
|
||||||
String cast = String.format(OracleConstants.CAST, originField, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
|
String cast = String.format(OracleConstants.CAST, originField, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||||
fieldName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
|
fieldName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
|
||||||
|
} else if (f.getDeType() == 2) {
|
||||||
|
fieldName = String.format(OracleConstants.CAST, originField, OracleConstants.DEFAULT_INT_FORMAT);
|
||||||
} else {
|
} else {
|
||||||
fieldName = originField;
|
fieldName = originField;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { post } from '@/api/dataset/dataset'
|
import { post } from '@/api/dataset/dataset'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import i18n from "@/lang";
|
import i18n from '@/lang'
|
||||||
|
|
||||||
const token = getToken()
|
const token = getToken()
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (!this.param.tableId) {
|
if (!this.param.tableId) {
|
||||||
this.param.tableId = ""
|
this.param.tableId = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -143,9 +143,9 @@ export default {
|
|||||||
this.uploading = true
|
this.uploading = true
|
||||||
},
|
},
|
||||||
uploadFail(response, file, fileList) {
|
uploadFail(response, file, fileList) {
|
||||||
let myError=response.toString();
|
let myError = response.toString()
|
||||||
myError=myError.replace("Error: ","")
|
myError = myError.replace('Error: ', '')
|
||||||
const errorMessage = JSON.parse(myError).message + ", " + this.$t('dataset.parse_error');
|
const errorMessage = JSON.parse(myError).message + ', ' + this.$t('dataset.parse_error')
|
||||||
|
|
||||||
this.path = ''
|
this.path = ''
|
||||||
this.fields = []
|
this.fields = []
|
||||||
|
Loading…
Reference in New Issue
Block a user