mirror of
https://github.com/dataease/dataease.git
synced 2026-05-21 04:08:10 +08:00
feat(i18n):后端国际化;cron 组件国际化
This commit is contained in:
@@ -8,6 +8,7 @@ import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.controller.request.chart.ChartGroupRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.dto.chart.ChartGroupDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -122,7 +123,7 @@ public class ChartGroupService {
|
||||
}
|
||||
List<ChartGroup> list = chartGroupMapper.selectByExample(chartGroupExample);
|
||||
if (list.size() > 0) {
|
||||
throw new RuntimeException("Name can't repeat in same group.");
|
||||
throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import io.dataease.dto.chart.ChartViewDTO;
|
||||
import io.dataease.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.dto.chart.Series;
|
||||
import io.dataease.dto.dataset.DataTableInfoDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.provider.QueryProvider;
|
||||
import io.dataease.service.dataset.DataSetTableFieldsService;
|
||||
import io.dataease.service.dataset.DataSetTableService;
|
||||
@@ -226,7 +227,7 @@ public class ChartViewService {
|
||||
}
|
||||
List<ChartViewWithBLOBs> list = chartViewMapper.selectByExampleWithBLOBs(chartViewExample);
|
||||
if (list.size() > 0) {
|
||||
throw new RuntimeException("Name can't repeat in same group.");
|
||||
throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import io.dataease.controller.request.dataset.DataSetGroupRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.dto.dataset.DataSetGroupDTO;
|
||||
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -133,7 +134,7 @@ public class DataSetGroupService {
|
||||
}
|
||||
List<DatasetGroup> list = datasetGroupMapper.selectByExample(datasetGroupExample);
|
||||
if (list.size() > 0) {
|
||||
throw new RuntimeException("Name can't repeat in same group.");
|
||||
throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import io.dataease.dto.dataset.DataSetTableDTO;
|
||||
import io.dataease.dto.dataset.DataSetTableUnionDTO;
|
||||
import io.dataease.dto.dataset.DataTableInfoCustomUnion;
|
||||
import io.dataease.dto.dataset.DataTableInfoDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.provider.DDLProvider;
|
||||
import io.dataease.provider.QueryProvider;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -177,7 +178,7 @@ public class DataSetTableService {
|
||||
.id("count")
|
||||
.tableId(dataSetTableRequest.getId())
|
||||
.originName("*")
|
||||
.name("记录数*")
|
||||
.name(Translator.get("i18n_chart_count"))
|
||||
.dataeaseName("*")
|
||||
.type("INT")
|
||||
.checked(true)
|
||||
@@ -500,7 +501,7 @@ public class DataSetTableService {
|
||||
return;
|
||||
}
|
||||
QueryProvider qp = null;
|
||||
if(!ObjectUtils.isEmpty(ds)) {
|
||||
if (!ObjectUtils.isEmpty(ds)) {
|
||||
qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fields)) {
|
||||
@@ -611,7 +612,7 @@ public class DataSetTableService {
|
||||
}
|
||||
List<DatasetTable> list = datasetTableMapper.selectByExample(datasetTableExample);
|
||||
if (list.size() > 0) {
|
||||
throw new RuntimeException("Name can't repeat in same group.");
|
||||
throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,11 +648,11 @@ public class DataSetTableService {
|
||||
if (StringUtils.equalsIgnoreCase(suffix, "xls")) {
|
||||
HSSFWorkbook workbook = new HSSFWorkbook(inputStream);
|
||||
HSSFSheet sheet0 = workbook.getSheetAt(0);
|
||||
for (int i=0;i<workbook.getNumberOfSheets();i++){
|
||||
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
|
||||
sheets.add(workbook.getSheetAt(i).getSheetName());
|
||||
}
|
||||
if (sheet0.getNumMergedRegions() > 0) {
|
||||
throw new RuntimeException("Sheet have merged regions.");
|
||||
throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
|
||||
}
|
||||
int rows;
|
||||
if (isPreview) {
|
||||
@@ -668,7 +669,7 @@ public class DataSetTableService {
|
||||
tableFiled.setFieldType("TEXT");
|
||||
tableFiled.setFieldSize(1024);
|
||||
String columnName = readCell(row.getCell(j));
|
||||
if(StringUtils.isEmpty(columnName)){
|
||||
if (StringUtils.isEmpty(columnName)) {
|
||||
columnName = "NONE_" + String.valueOf(j);
|
||||
}
|
||||
tableFiled.setFieldName(columnName);
|
||||
@@ -686,11 +687,11 @@ public class DataSetTableService {
|
||||
} else if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
|
||||
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream);
|
||||
XSSFSheet sheet0 = xssfWorkbook.getSheetAt(0);
|
||||
for (int i=0;i<xssfWorkbook.getNumberOfSheets();i++){
|
||||
for (int i = 0; i < xssfWorkbook.getNumberOfSheets(); i++) {
|
||||
sheets.add(xssfWorkbook.getSheetAt(i).getSheetName());
|
||||
}
|
||||
if (sheet0.getNumMergedRegions() > 0) {
|
||||
throw new RuntimeException("Sheet have merged regions.");
|
||||
throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
|
||||
}
|
||||
int rows;
|
||||
if (isPreview) {
|
||||
@@ -707,7 +708,7 @@ public class DataSetTableService {
|
||||
tableFiled.setFieldType("TEXT");
|
||||
tableFiled.setFieldSize(1024);
|
||||
String columnName = readCell(row.getCell(j));
|
||||
if(StringUtils.isEmpty(columnName)){
|
||||
if (StringUtils.isEmpty(columnName)) {
|
||||
columnName = "NONE_" + String.valueOf(j);
|
||||
}
|
||||
tableFiled.setFieldName(columnName);
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.dataease.service.dataset;
|
||||
import io.dataease.base.domain.DatasetTableTask;
|
||||
import io.dataease.base.domain.DatasetTableTaskExample;
|
||||
import io.dataease.base.mapper.DatasetTableTaskMapper;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.service.ScheduleService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.CronExpression;
|
||||
@@ -31,7 +32,7 @@ public class DataSetTableTaskService {
|
||||
// check
|
||||
if (StringUtils.isNotEmpty(datasetTableTask.getCron())) {
|
||||
if (!CronExpression.isValidExpression(datasetTableTask.getCron())) {
|
||||
throw new RuntimeException("cron expression error.");
|
||||
throw new RuntimeException(Translator.get("i18n_cron_expression_error"));
|
||||
}
|
||||
}
|
||||
if (StringUtils.isEmpty(datasetTableTask.getId())) {
|
||||
|
||||
Reference in New Issue
Block a user