Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
e9827ee7
Unverified
提交
e9827ee7
authored
7月 28, 2021
作者:
taojinlong
提交者:
GitHub
7月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #369 from dataease/pr@v1.1@excel
fix: 判断excel 第一行不为空并且不能有空单元格
上级
fc56d34e
3290e0d9
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
10 行增加
和
11 行删除
+10
-11
ExcelXlsReader.java
...c/main/java/io/dataease/commons/utils/ExcelXlsReader.java
+0
-11
ExcelXlsxReader.java
.../main/java/io/dataease/commons/utils/ExcelXlsxReader.java
+4
-0
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+3
-0
messages_en_US.properties
backend/src/main/resources/i18n/messages_en_US.properties
+1
-0
messages_zh_CN.properties
backend/src/main/resources/i18n/messages_zh_CN.properties
+1
-0
messages_zh_TW.properties
backend/src/main/resources/i18n/messages_zh_TW.properties
+1
-0
没有找到文件。
backend/src/main/java/io/dataease/commons/utils/ExcelXlsReader.java
浏览文件 @
e9827ee7
...
...
@@ -206,17 +206,6 @@ public class ExcelXlsReader implements HSSFListener {
thisRow
=
frec
.
getRow
();
thisColumn
=
frec
.
getColumn
();
thisStr
=
String
.
valueOf
(
frec
.
getValue
());
// if (outputFormulaValues) {
// if (Double.isNaN(frec.getValue())) {
// outputNextStringRecord = true;
// nextRow = frec.getRow();
// nextColumn = frec.getColumn();
// } else {
// thisStr = '"' + HSSFFormulaParser.toFormulaString(stubWorkbook, frec.getParsedExpression()) + '"';
// }
// } else {
// thisStr = '"' + HSSFFormulaParser.toFormulaString(stubWorkbook, frec.getParsedExpression()) + '"';
// }
String
feildType
=
checkType
(
thisStr
,
thisColumn
);
if
(
feildType
.
equalsIgnoreCase
(
"LONG"
)
&&
thisStr
.
endsWith
(
".0"
)){
thisStr
=
thisStr
.
substring
(
0
,
thisStr
.
length
()
-
2
);
...
...
backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java
浏览文件 @
e9827ee7
...
...
@@ -4,6 +4,7 @@ import io.dataease.datasource.dto.TableFiled;
import
io.dataease.dto.dataset.ExcelSheetData
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.message.MsgAop
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.openxml4j.opc.OPCPackage
;
import
org.apache.poi.ss.usermodel.BuiltinFormats
;
...
...
@@ -410,6 +411,9 @@ public class ExcelXlsxReader extends DefaultHandler {
tableFiled
.
setRemarks
(
thisStr
);
this
.
fields
.
add
(
tableFiled
);
}
else
{
if
(
CollectionUtils
.
isEmpty
(
this
.
getFields
())){
throw
new
RuntimeException
(
Translator
.
get
(
"i18n_excel_header_empty"
));
}
this
.
getFields
().
get
(
curCol
).
setFieldType
(
type
);
}
return
thisStr
;
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
e9827ee7
...
...
@@ -1402,6 +1402,9 @@ public class DataSetTableService {
public
static
boolean
checkIsRepeat
(
String
[]
array
)
{
HashSet
<
String
>
hashSet
=
new
HashSet
<
String
>();
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++)
{
if
(
StringUtils
.
isEmpty
(
array
[
i
])){
throw
new
RuntimeException
(
Translator
.
get
(
"i18n_excel_empty_column"
));
}
hashSet
.
add
(
array
[
i
]);
}
if
(
hashSet
.
size
()
==
array
.
length
)
{
...
...
backend/src/main/resources/i18n/messages_en_US.properties
浏览文件 @
e9827ee7
...
...
@@ -255,6 +255,7 @@ i18n_dataset_delete_or_no_permission=Data set is delete or no permission
i18n_chart_delete
=
Chart is delete
i18n_not_exec_add_sync
=
There is no completed synchronization task. Incremental synchronization cannot be performed
i18n_excel_header_empty
=
Excel first row can not empty
i18n_excel_empty_column
=
There are empty cells in the first row
i18n_custom_ds_delete
=
Custom dataset union data is deleted,can not display
i18n_sql_add_not_matching
=
The data column of incremental SQL does not match the dataset,
i18n_sql_delete_not_matching
=
The data column of incremental delete SQL does not match the dataset,
...
...
backend/src/main/resources/i18n/messages_zh_CN.properties
浏览文件 @
e9827ee7
...
...
@@ -254,6 +254,7 @@ i18n_dataset_delete_or_no_permission=当前用到的数据集没有权限或已
i18n_chart_delete
=
当前用到的视图已被删除
i18n_not_exec_add_sync
=
没有已完成的同步任务,无法进行增量同步
i18n_excel_header_empty
=
Excel第一行为空
i18n_excel_empty_column
=
第一行存在空单元格
i18n_custom_ds_delete
=
自定义数据集所关联数据被删除,无法正常显示
i18n_sql_add_not_matching
=
增量添加 sql 的数据列与数据集不匹配,
i18n_sql_delete_not_matching
=
增量删除 sql 的数据列与数据集不匹配,
...
...
backend/src/main/resources/i18n/messages_zh_TW.properties
浏览文件 @
e9827ee7
...
...
@@ -257,6 +257,7 @@ i18n_dataset_delete_or_no_permission=當前用到的數據集沒有權限或已
i18n_chart_delete
=
當前用到的視圖已被刪除
i18n_not_exec_add_sync
=
沒有已經完成的同步任務,無法進行增量同步
i18n_excel_header_empty
=
Excel第一行為空
i18n_excel_empty_column
=
第一行存在空單元格
i18n_custom_ds_delete
=
自定義數據集所關聯數據被刪除,無法正常顯示
i18n_sql_add_not_matching
=
增量添加 sql 的數據列與數據集不匹配,
i18n_sql_delete_not_matching
=
增量刪除 sql 的數據列與數據集不匹配,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论