Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
4a5935ca
提交
4a5935ca
authored
6月 24, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 优化代码格式 异常抛出优化
上级
3f94b2f7
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
63 行增加
和
46 行删除
+63
-46
JWTFilter.java
backend/src/main/java/io/dataease/auth/filter/JWTFilter.java
+2
-1
AuthServer.java
...end/src/main/java/io/dataease/auth/server/AuthServer.java
+4
-3
JWTUtils.java
backend/src/main/java/io/dataease/auth/util/JWTUtils.java
+2
-1
LicenseController.java
...c/main/java/io/dataease/controller/LicenseController.java
+5
-3
JdbcProvider.java
...in/java/io/dataease/datasource/provider/JdbcProvider.java
+21
-17
DatasourceService.java
...ava/io/dataease/datasource/service/DatasourceService.java
+2
-1
EasyExcelExporter.java
.../main/java/io/dataease/excel/utils/EasyExcelExporter.java
+3
-2
ScheduleManager.java
.../main/java/io/dataease/job/sechedule/ScheduleManager.java
+10
-9
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+4
-3
DataSetTableTaskService.java
.../io/dataease/service/dataset/DataSetTableTaskService.java
+3
-2
ExtractDataService.java
.../java/io/dataease/service/dataset/ExtractDataService.java
+2
-1
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+2
-1
PanelTemplateService.java
.../java/io/dataease/service/panel/PanelTemplateService.java
+3
-2
没有找到文件。
backend/src/main/java/io/dataease/auth/filter/JWTFilter.java
浏览文件 @
4a5935ca
...
...
@@ -7,6 +7,7 @@ import io.dataease.auth.service.AuthUserService;
import
io.dataease.auth.util.JWTUtils
;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
...
...
@@ -95,7 +96,7 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
AuthUserService
authUserService
=
CommonBeanFactory
.
getBean
(
AuthUserService
.
class
);
SysUserEntity
user
=
authUserService
.
getUserById
(
tokenInfo
.
getUserId
());
if
(
user
==
null
){
throw
new
Exception
(
Translator
.
get
(
"i18n_not_find_user"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_not_find_user"
));
}
String
password
=
user
.
getPassword
();
...
...
backend/src/main/java/io/dataease/auth/server/AuthServer.java
浏览文件 @
4a5935ca
...
...
@@ -14,6 +14,7 @@ import io.dataease.commons.utils.BeanUtils;
import
io.dataease.commons.utils.CodingUtil
;
import
io.dataease.commons.utils.ServletUtils
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -40,10 +41,10 @@ public class AuthServer implements AuthApi {
SysUserEntity
user
=
authUserService
.
getUserByName
(
username
);
if
(
ObjectUtils
.
isEmpty
(
user
))
{
throw
new
Runtime
Exception
(
Translator
.
get
(
"i18n_id_or_pwd_error"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_id_or_pwd_error"
));
}
if
(
user
.
getEnabled
()
==
0
)
{
throw
new
Runtime
Exception
(
Translator
.
get
(
"i18n_id_or_pwd_error"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_id_or_pwd_error"
));
}
String
realPwd
=
user
.
getPassword
();
//私钥解密
...
...
@@ -52,7 +53,7 @@ public class AuthServer implements AuthApi {
pwd
=
CodingUtil
.
md5
(
pwd
);
if
(!
StringUtils
.
equals
(
pwd
,
realPwd
))
{
throw
new
Runtime
Exception
(
Translator
.
get
(
"i18n_id_or_pwd_error"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_id_or_pwd_error"
));
}
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
TokenInfo
tokenInfo
=
TokenInfo
.
builder
().
userId
(
user
.
getUserId
()).
username
(
username
).
build
();
...
...
backend/src/main/java/io/dataease/auth/util/JWTUtils.java
浏览文件 @
4a5935ca
...
...
@@ -7,6 +7,7 @@ import com.auth0.jwt.exceptions.JWTDecodeException;
import
com.auth0.jwt.interfaces.DecodedJWT
;
import
io.dataease.auth.entity.TokenInfo
;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.exception.DataEaseException
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.core.env.Environment
;
...
...
@@ -50,7 +51,7 @@ public class JWTUtils {
String
username
=
jwt
.
getClaim
(
"username"
).
asString
();
Long
userId
=
jwt
.
getClaim
(
"userId"
).
asLong
();
if
(
StringUtils
.
isEmpty
(
username
)
||
ObjectUtils
.
isEmpty
(
userId
)
){
throw
new
Runtime
Exception
(
"token格式错误!"
);
DataEaseException
.
throw
Exception
(
"token格式错误!"
);
}
TokenInfo
tokenInfo
=
TokenInfo
.
builder
().
username
(
username
).
userId
(
userId
).
build
();
return
tokenInfo
;
...
...
backend/src/main/java/io/dataease/controller/LicenseController.java
浏览文件 @
4a5935ca
...
...
@@ -5,6 +5,7 @@ package io.dataease.controller;
import
com.google.gson.Gson
;
import
io.dataease.commons.license.DefaultLicenseService
;
import
io.dataease.commons.license.F2CLicenseResponse
;
import
io.dataease.exception.DataEaseException
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -35,11 +36,12 @@ public class LicenseController {
return
ResultHolder
.
success
(
null
);
case
expired:
String
expired
=
f2CLicenseResponse
.
getLicense
().
getExpired
();
throw
new
Exception
(
"License has expired since "
+
expired
+
", please update license."
);
DataEaseException
.
throw
Exception
(
"License has expired since "
+
expired
+
", please update license."
);
case
invalid:
throw
new
Exception
(
f2CLicenseResponse
.
getMessage
());
DataEaseException
.
throw
Exception
(
f2CLicenseResponse
.
getMessage
());
default
:
throw
new
Exception
(
"Invalid License."
);
DataEaseException
.
throw
Exception
(
"Invalid License."
);
}
return
new
ResultHolder
();
}
}
backend/src/main/java/io/dataease/datasource/provider/JdbcProvider.java
浏览文件 @
4a5935ca
...
...
@@ -7,6 +7,7 @@ import io.dataease.datasource.dto.MysqlConfigration;
import
io.dataease.datasource.dto.SqlServerConfigration
;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.datasource.request.DatasourceRequest
;
import
io.dataease.exception.DataEaseException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -31,9 +32,9 @@ public class JdbcProvider extends DatasourceProvider {
ResultSet
rs
=
stat
.
executeQuery
(
datasourceRequest
.
getQuery
());
list
=
fetchResult
(
rs
);
}
catch
(
SQLException
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
connection
!=
null
){
connection
.
close
();
...
...
@@ -50,9 +51,9 @@ public class JdbcProvider extends DatasourceProvider {
Boolean
result
=
stat
.
execute
(
datasourceRequest
.
getQuery
());
stat
.
close
();
}
catch
(
SQLException
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
connection
!=
null
){
connection
.
close
();
...
...
@@ -70,14 +71,15 @@ public class JdbcProvider extends DatasourceProvider {
rs
=
stat
.
executeQuery
(
datasourceRequest
.
getQuery
());
return
fetchResult
(
rs
);
}
catch
(
SQLException
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
connection
!=
null
){
connection
.
close
();
}
}
return
new
ArrayList
<>();
}
private
List
<
String
[]>
fetchResult
(
ResultSet
rs
)
throws
Exception
{
...
...
@@ -112,14 +114,15 @@ public class JdbcProvider extends DatasourceProvider {
rs
=
stat
.
executeQuery
(
datasourceRequest
.
getQuery
());
return
fetchResultField
(
rs
);
}
catch
(
SQLException
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
connection
!=
null
){
connection
.
close
();
}
}
return
new
ArrayList
<>();
}
@Override
...
...
@@ -139,14 +142,15 @@ public class JdbcProvider extends DatasourceProvider {
result
.
put
(
"fieldList"
,
fieldList
);
return
result
;
}
catch
(
SQLException
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
connection
!=
null
){
connection
.
close
();
}
}
return
new
HashMap
<>();
}
private
List
<
TableFiled
>
fetchResultField
(
ResultSet
rs
)
throws
Exception
{
...
...
@@ -183,12 +187,13 @@ public class JdbcProvider extends DatasourceProvider {
statement
.
close
();
return
tables
;
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR: "
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
con
!=
null
){
con
.
close
();
}
}
return
new
ArrayList
<>();
}
@Override
...
...
@@ -222,9 +227,9 @@ public class JdbcProvider extends DatasourceProvider {
}
resultSet
.
close
();
}
catch
(
SQLException
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR:"
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
connection
!=
null
){
connection
.
close
();
...
...
@@ -244,7 +249,7 @@ public class JdbcProvider extends DatasourceProvider {
resultSet
.
close
();
ps
.
close
();
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR: "
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
if
(
con
!=
null
){
con
.
close
();}
}
...
...
@@ -261,7 +266,7 @@ public class JdbcProvider extends DatasourceProvider {
return
resultSet
.
getLong
(
1
);
}
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"ERROR: "
+
e
.
getMessage
(),
e
);
DataEaseException
.
throwException
(
e
);
}
finally
{
con
.
close
();
}
...
...
@@ -423,4 +428,4 @@ public class JdbcProvider extends DatasourceProvider {
return
"show tables;"
;
}
}
}
\ No newline at end of file
}
backend/src/main/java/io/dataease/datasource/service/DatasourceService.java
浏览文件 @
4a5935ca
...
...
@@ -18,6 +18,7 @@ import io.dataease.datasource.provider.ProviderFactory;
import
io.dataease.datasource.request.DatasourceRequest
;
import
io.dataease.dto.DatasourceDTO
;
import
io.dataease.dto.dataset.DataTableInfoDTO
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.dataset.DataSetGroupService
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -97,7 +98,7 @@ public class DatasourceService {
example
.
createCriteria
().
andDataSourceIdEqualTo
(
datasourceId
);
List
<
DatasetTable
>
datasetTables
=
datasetTableMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
datasetTables
)){
throw
new
Exception
(
datasetTables
.
size
()
+
Translator
.
get
(
"i18n_datasource_not_allow_delete_msg"
));
DataEaseException
.
throw
Exception
(
datasetTables
.
size
()
+
Translator
.
get
(
"i18n_datasource_not_allow_delete_msg"
));
}
datasourceMapper
.
deleteByPrimaryKey
(
datasourceId
);
}
...
...
backend/src/main/java/io/dataease/excel/utils/EasyExcelExporter.java
浏览文件 @
4a5935ca
...
...
@@ -4,6 +4,7 @@ import com.alibaba.excel.EasyExcel;
import
com.alibaba.excel.write.metadata.style.WriteCellStyle
;
import
com.alibaba.excel.write.style.HorizontalCellStyleStrategy
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.exception.ExcelException
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -31,10 +32,10 @@ public class EasyExcelExporter {
EasyExcel
.
write
(
response
.
getOutputStream
(),
this
.
clazz
).
registerWriteHandler
(
horizontalCellStyleStrategy
).
sheet
(
sheetName
).
doWrite
(
data
);
}
catch
(
UnsupportedEncodingException
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Excel
Exception
(
"Utf-8 encoding is not supported"
);
DataEaseException
.
throw
Exception
(
"Utf-8 encoding is not supported"
);
}
catch
(
IOException
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Excel
Exception
(
"IO exception"
);
DataEaseException
.
throw
Exception
(
"IO exception"
);
}
}
...
...
backend/src/main/java/io/dataease/job/sechedule/ScheduleManager.java
浏览文件 @
4a5935ca
package
io
.
dataease
.
job
.
sechedule
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.exception.DataEaseException
;
import
org.quartz.*
;
import
org.springframework.stereotype.Component
;
...
...
@@ -96,7 +97,7 @@ public class ScheduleManager {
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -126,7 +127,7 @@ public class ScheduleManager {
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -187,7 +188,7 @@ public class ScheduleManager {
// addJob(jobName, jobGroupName, triggerName, triggerGroupName, jobClass, cron);
/** 方式二 :先删除,然后在创建一个新的Job */
}
catch
(
Exception
e
)
{
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -239,7 +240,7 @@ public class ScheduleManager {
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -271,7 +272,7 @@ public class ScheduleManager {
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -295,7 +296,7 @@ public class ScheduleManager {
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -305,7 +306,7 @@ public class ScheduleManager {
sched
.
start
();
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -317,7 +318,7 @@ public class ScheduleManager {
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
throw
new
Runtime
Exception
(
e
);
DataEaseException
.
throw
Exception
(
e
);
}
}
...
...
@@ -435,7 +436,7 @@ public class ScheduleManager {
public
static
CronTrigger
getCronTrigger
(
String
cron
)
{
if
(!
CronExpression
.
isValidExpression
(
cron
))
{
throw
new
Runtime
Exception
(
"cron :"
+
cron
+
" error"
);
DataEaseException
.
throw
Exception
(
"cron :"
+
cron
+
" error"
);
}
return
TriggerBuilder
.
newTrigger
().
withIdentity
(
"Calculate Date"
).
withSchedule
(
CronScheduleBuilder
.
cronSchedule
(
cron
)).
build
();
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
4a5935ca
...
...
@@ -18,6 +18,7 @@ import io.dataease.datasource.provider.JdbcProvider;
import
io.dataease.datasource.provider.ProviderFactory
;
import
io.dataease.datasource.request.DatasourceRequest
;
import
io.dataease.dto.dataset.*
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
io.dataease.provider.DDLProvider
;
import
io.dataease.provider.QueryProvider
;
...
...
@@ -412,7 +413,7 @@ public class DataSetTableService {
String
sql
=
new
Gson
().
fromJson
(
dataSetTableRequest
.
getInfo
(),
DataTableInfoDTO
.
class
).
getSql
();
if
(
StringUtils
.
isEmpty
(
sql
))
{
throw
new
Exception
(
Translator
.
get
(
"i18n_sql_not_empty"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_sql_not_empty"
));
}
QueryProvider
qp
=
ProviderFactory
.
getQueryProvider
(
ds
.
getType
());
String
sqlAsTable
=
qp
.
createSQLPreview
(
sql
,
null
);
...
...
@@ -734,7 +735,7 @@ public class DataSetTableService {
});
sort
(
sqlFileds
);
if
(!
originNameFileds
.
equals
(
sqlFileds
))
{
throw
new
Exception
(
Translator
.
get
(
"i18n_sql_add_not_matching"
)
+
sqlFileds
.
toString
());
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_sql_add_not_matching"
)
+
sqlFileds
.
toString
());
}
}
if
(
StringUtils
.
isNotEmpty
(
datasetTableIncrementalConfig
.
getIncrementalDelete
())
&&
StringUtils
.
isNotEmpty
(
datasetTableIncrementalConfig
.
getIncrementalDelete
().
replace
(
" "
,
""
)))
{
// 增量删除
...
...
@@ -747,7 +748,7 @@ public class DataSetTableService {
});
sort
(
sqlFileds
);
if
(!
originNameFileds
.
equals
(
sqlFileds
))
{
throw
new
Exception
(
Translator
.
get
(
"i18n_sql_delete_not_matching"
)
+
sqlFileds
.
toString
());
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_sql_delete_not_matching"
)
+
sqlFileds
.
toString
());
}
}
}
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java
浏览文件 @
4a5935ca
...
...
@@ -8,6 +8,7 @@ import io.dataease.base.mapper.DatasetTableTaskMapper;
import
io.dataease.commons.constants.JobStatus
;
import
io.dataease.commons.constants.ScheduleType
;
import
io.dataease.controller.request.dataset.DataSetTaskRequest
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.ScheduleService
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -71,11 +72,11 @@ public class DataSetTableTaskService {
if
(
datasetTableTask
.
getType
().
equalsIgnoreCase
(
"add_scope"
))
{
DatasetTable
datasetTable
=
dataSetTableService
.
get
(
datasetTableTask
.
getTableId
());
if
(
datasetTable
.
getLastUpdateTime
()
==
0
||
datasetTable
.
getLastUpdateTime
()
==
null
)
{
throw
new
Exception
(
Translator
.
get
(
"i18n_not_exec_add_sync"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_not_exec_add_sync"
));
}
}
if
(
extractDataService
.
updateSyncStatusIsNone
(
dataSetTableService
.
get
(
datasetTableTask
.
getTableId
())))
{
throw
new
Exception
(
Translator
.
get
(
"i18n_sync_job_exists"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_sync_job_exists"
));
}
else
{
//write log
DatasetTableTaskLog
datasetTableTaskLog
=
new
DatasetTableTaskLog
();
...
...
backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java
浏览文件 @
4a5935ca
...
...
@@ -22,6 +22,7 @@ import io.dataease.datasource.provider.ProviderFactory;
import
io.dataease.datasource.request.DatasourceRequest
;
import
io.dataease.dto.dataset.DataSetTaskLogDTO
;
import
io.dataease.dto.dataset.DataTableInfoDTO
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.provider.QueryProvider
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.io.FileUtils
;
...
...
@@ -461,7 +462,7 @@ public class ExtractDataService {
if
(
jobStatus
.
getStatusDescription
().
equals
(
"Finished"
))
{
return
;
}
else
{
throw
new
Exception
(
jobStatus
.
getLoggingString
(
));
DataEaseException
.
throwException
((
jobStatus
.
getLoggingString
()
));
}
}
...
...
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
4a5935ca
...
...
@@ -15,6 +15,7 @@ import io.dataease.dto.chart.ChartViewDTO;
import
io.dataease.dto.dataset.DataSetGroupDTO
;
import
io.dataease.dto.panel.PanelDesignDTO
;
import
io.dataease.dto.panel.PanelGroupDTO
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.chart.ChartViewService
;
import
io.dataease.service.sys.SysAuthService
;
...
...
@@ -128,7 +129,7 @@ public class PanelGroupService {
List
<
PanelGroup
>
checkResult
=
panelGroupMapper
.
selectByExample
(
groupExample
);
if
(
CollectionUtils
.
isNotEmpty
(
checkResult
))
{
throw
new
Runtime
Exception
(
Translator
.
get
(
"i18n_same_folder_can_not_repeat"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_same_folder_can_not_repeat"
));
}
}
...
...
backend/src/main/java/io/dataease/service/panel/PanelTemplateService.java
浏览文件 @
4a5935ca
...
...
@@ -9,6 +9,7 @@ import io.dataease.commons.utils.AuthUtils;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.controller.request.panel.PanelTemplateRequest
;
import
io.dataease.dto.panel.PanelTemplateDTO
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -71,7 +72,7 @@ public class PanelTemplateService {
request
.
setPid
(
request
.
getTemplateType
());
String
nameCheckResult
=
this
.
nameCheck
(
CommonConstants
.
OPT_TYPE
.
INSERT
,
request
.
getName
(),
request
.
getPid
(),
null
);
if
(
CommonConstants
.
CHECK_RESULT
.
EXIST_ALL
.
equals
(
nameCheckResult
)){
throw
new
Runtime
Exception
(
Translator
.
get
(
"i18n_same_folder_can_not_repeat"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_same_folder_can_not_repeat"
));
}
}
else
{
//模板插入 相同文件夹同名的模板进行覆盖(先删除)
PanelTemplateExample
exampleDelete
=
new
PanelTemplateExample
();
...
...
@@ -82,7 +83,7 @@ public class PanelTemplateService {
}
else
{
String
nameCheckResult
=
this
.
nameCheck
(
CommonConstants
.
OPT_TYPE
.
UPDATE
,
request
.
getName
(),
request
.
getPid
(),
request
.
getId
());
if
(
CommonConstants
.
CHECK_RESULT
.
EXIST_ALL
.
equals
(
nameCheckResult
)){
throw
new
Runtime
Exception
(
Translator
.
get
(
"i18n_same_folder_can_not_repeat"
));
DataEaseException
.
throw
Exception
(
Translator
.
get
(
"i18n_same_folder_can_not_repeat"
));
}
panelTemplateMapper
.
updateByPrimaryKeySelective
(
request
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论