From 38c3986ba443107eac2172dccdd738ac1dbd7685 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 28 Nov 2022 16:18:37 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix(=E7=99=BB=E5=BD=95):=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/entity/AccountLockStatus.java | 2 ++ .../io/dataease/auth/server/AuthServer.java | 29 ++++++++++++------- .../auth/service/AuthUserService.java | 2 +- .../service/impl/AuthUserServiceImpl.java | 9 ++++-- .../resources/i18n/messages_en_US.properties | 1 + .../resources/i18n/messages_zh_CN.properties | 1 + .../resources/i18n/messages_zh_TW.properties | 1 + 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/entity/AccountLockStatus.java b/backend/src/main/java/io/dataease/auth/entity/AccountLockStatus.java index 8555d2c381..cc37ef3cb4 100644 --- a/backend/src/main/java/io/dataease/auth/entity/AccountLockStatus.java +++ b/backend/src/main/java/io/dataease/auth/entity/AccountLockStatus.java @@ -12,4 +12,6 @@ public class AccountLockStatus { private Long unlockTime; private Integer relieveTimes; + + private Integer remainderTimes; } diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index 4455484c75..44fe78b13e 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -81,8 +81,8 @@ public class AuthServer implements AuthApi { ValidateResult validateResult = ldapXpackService.login(request); if (!validateResult.isSuccess()) { - authUserService.recordLoginFail(username, 1); - DataEaseException.throwException(validateResult.getMsg()); + AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 1); + DataEaseException.throwException(appendLoginErrorMsg(validateResult.getMsg(), lockStatus)); } XpackLdapUserEntity ldapUserEntity = validateResult.getData(); if (StringUtils.isBlank(ldapUserEntity.getEmail())) { @@ -120,19 +120,19 @@ public class AuthServer implements AuthApi { SysUserEntity user = authUserService.getUserByName(username); if (ObjectUtils.isEmpty(user)) { - authUserService.recordLoginFail(username, 0); - DataEaseException.throwException(Translator.get("i18n_user_do_not_exist")); + AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 0); + DataEaseException.throwException(appendLoginErrorMsg(Translator.get("i18n_id_or_pwd_error"), lockStatus)); } // 验证登录类型是否与用户类型相同 if (!sysUserService.validateLoginType(user.getFrom(), loginType)) { - authUserService.recordLoginFail(username, 0); - DataEaseException.throwException(Translator.get("i18n_login_type_error")); + AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 0); + DataEaseException.throwException(appendLoginErrorMsg(Translator.get("i18n_login_type_error"), lockStatus)); } if (user.getEnabled() == 0) { - authUserService.recordLoginFail(username, 0); - DataEaseException.throwException(Translator.get("i18n_user_is_disable")); + AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 0); + DataEaseException.throwException(appendLoginErrorMsg(Translator.get("i18n_user_is_disable"), lockStatus)); } String realPwd = user.getPassword(); @@ -144,8 +144,8 @@ public class AuthServer implements AuthApi { pwd = CodingUtil.md5(pwd); if (!StringUtils.equals(pwd, realPwd)) { - authUserService.recordLoginFail(username, 0); - DataEaseException.throwException(Translator.get("i18n_id_or_pwd_error")); + AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 0); + DataEaseException.throwException(appendLoginErrorMsg(Translator.get("i18n_id_or_pwd_error"), lockStatus)); } } @@ -161,6 +161,15 @@ public class AuthServer implements AuthApi { return result; } + private String appendLoginErrorMsg(String msg, AccountLockStatus lockStatus) { + if (ObjectUtils.isEmpty(lockStatus)) return msg; + if (ObjectUtils.isNotEmpty(lockStatus.getRemainderTimes())) { + String i18n = Translator.get("i18n_login_remainder_times"); + msg += String.format(i18n, lockStatus.getRemainderTimes()); + } + return msg; + } + @Override public CurrentUserDto userInfo() { CurrentUserDto userDto = (CurrentUserDto) SecurityUtils.getSubject().getPrincipal(); diff --git a/backend/src/main/java/io/dataease/auth/service/AuthUserService.java b/backend/src/main/java/io/dataease/auth/service/AuthUserService.java index e8704f5dc5..6db8a61695 100644 --- a/backend/src/main/java/io/dataease/auth/service/AuthUserService.java +++ b/backend/src/main/java/io/dataease/auth/service/AuthUserService.java @@ -55,7 +55,7 @@ public interface AuthUserService { void checkAdmin(String uname, String pwd); - void recordLoginFail(String username, Integer logintype); + AccountLockStatus recordLoginFail(String username, Integer logintype); void unlockAccount(String username, Integer logintype); diff --git a/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java index f5329eb743..c65ef79ab6 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java @@ -277,14 +277,16 @@ public class AuthUserServiceImpl implements AuthUserService { } @Override - public void recordLoginFail(String username, Integer logintype) { - if (!supportLoginLimit()) return; + public AccountLockStatus recordLoginFail(String username, Integer logintype) { + if (!supportLoginLimit()) return null; long now = System.currentTimeMillis(); SysLoginLimit sysLoginLimit = new SysLoginLimit(); sysLoginLimit.setUsername(username); sysLoginLimit.setLoginType(logintype); sysLoginLimit.setRecordTime(now); sysLoginLimitMapper.insert(sysLoginLimit); + return lockStatus(username, logintype); + } @Override @@ -312,13 +314,16 @@ public class AuthUserServiceImpl implements AuthUserService { SysLoginLimitExample example = new SysLoginLimitExample(); example.createCriteria().andUsernameEqualTo(username).andLoginTypeEqualTo(logintype).andRecordTimeGreaterThan(dividingPointTime); List sysLoginLimits = sysLoginLimitMapper.selectByExample(example); + accountLockStatus.setRemainderTimes(limitTimes); if (CollectionUtils.isNotEmpty(sysLoginLimits)) { boolean needLock = sysLoginLimits.size() >= limitTimes; + accountLockStatus.setRemainderTimes(limitTimes - sysLoginLimits.size()); accountLockStatus.setLocked(needLock); if (needLock) { long unlockTime = now + (longRelieveTimes * 60L * 1000L); accountLockStatus.setUnlockTime(unlockTime); accountLockStatus.setRelieveTimes(relieveTimes); + accountLockStatus.setRemainderTimes(0); } } diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 951dca55a6..44b053e949 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -75,6 +75,7 @@ i18n_sql_not_empty=SQL can not be empty. i18n_datasource_not_allow_delete_msg=datasets are using this data source and cannot be deleted i18n_task_name_repeat=Name is used in same data set i18n_id_or_pwd_error=Invalid ID or password +i18n_login_remainder_times=(You can still enter %s times) i18n_user_do_not_exist=User do not exist i18n_user_is_disable=User is disabled i18n_login_type_error=Login type error diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 6ec5cc2064..d51c0e69cf 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -75,6 +75,7 @@ i18n_sql_not_empty=SQL \u4E0D\u80FD\u4E3A\u7A7A i18n_datasource_not_allow_delete_msg=\u4E2A\u6570\u636E\u96C6\u6B63\u5728\u4F7F\u7528\u6B64\u6570\u636E\u6E90\uFF0C\u65E0\u6CD5\u5220\u9664 i18n_task_name_repeat=\u540C\u4E00\u6570\u636E\u96C6\u4E0B\u4EFB\u52A1\u540D\u79F0\u5DF2\u88AB\u4F7F\u7528 i18n_id_or_pwd_error=\u65E0\u6548\u7684ID\u6216\u5BC6\u7801 +i18n_login_remainder_times=(\u8FD8\u80FD\u8F93\u5165%s\u6B21) i18n_user_do_not_exist=\u7528\u6237\u4E0D\u5B58\u5728 i18n_user_is_disable=\u7528\u6237\u72B6\u6001\u65E0\u6548 i18n_login_type_error=\u767B\u5F55\u65B9\u5F0F\u9519\u8BEF diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 0f0c6d30f2..37072949cb 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -75,6 +75,7 @@ i18n_sql_not_empty=SQL \u4E0D\u80FD\u70BA\u7A7A i18n_datasource_not_allow_delete_msg=\u500B\u6578\u64DA\u96C6\u6B63\u5728\u4F7F\u7528\u6B64\u6578\u64DA\u6E90\uFF0C\u7121\u6CD5\u522A\u9664 i18n_task_name_repeat=\u540C\u4E00\u6578\u64DA\u96C6\u4E0B\u4EFB\u52D9\u540D\u7A31\u5DF2\u88AB\u4F7F\u7528 i18n_id_or_pwd_error=\u7121\u6548\u7684ID\u6216\u5BC6\u78BC +i18n_login_remainder_times=(\u9084\u80FD\u8F38\u5165%s\u6B21) i18n_user_do_not_exist=\u7528\u6236\u4E0D\u5B58\u5728 i18n_user_is_disable=\u7528\u6236\u72C0\u614B\u7121\u6548 i18n_login_type_error=\u767B\u9304\u65B9\u5F0F\u932F\u8AA4 From e12d31be12002d69563003348e1134cb017e1456 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 28 Nov 2022 16:23:11 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=98=8E=E7=BB=86=E8=A1=A8=E5=88=86=E9=A1=B5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/engine/doris/DorisQueryProvider.java | 5 +++-- .../provider/engine/mysql/MysqlQueryProvider.java | 5 +++-- .../provider/query/mysql/MysqlQueryProvider.java | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/engine/doris/DorisQueryProvider.java b/backend/src/main/java/io/dataease/provider/engine/doris/DorisQueryProvider.java index 41de90d9c6..d7963002c6 100644 --- a/backend/src/main/java/io/dataease/provider/engine/doris/DorisQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/engine/doris/DorisQueryProvider.java @@ -364,10 +364,11 @@ public class DorisQueryProvider extends QueryProvider { @Override public String getSQLWithPage(boolean isTable, String table, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) { + String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize() : ""); if (isTable) { - return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize(); + return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; } else { - return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize(); + return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; } } diff --git a/backend/src/main/java/io/dataease/provider/engine/mysql/MysqlQueryProvider.java b/backend/src/main/java/io/dataease/provider/engine/mysql/MysqlQueryProvider.java index 29888495af..e072cba02a 100644 --- a/backend/src/main/java/io/dataease/provider/engine/mysql/MysqlQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/engine/mysql/MysqlQueryProvider.java @@ -364,10 +364,11 @@ public class MysqlQueryProvider extends QueryProvider { @Override public String getSQLWithPage(boolean isTable, String table, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) { + String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize() : ""); if (isTable) { - return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize(); + return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; } else { - return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize(); + return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; } } diff --git a/backend/src/main/java/io/dataease/provider/query/mysql/MysqlQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/mysql/MysqlQueryProvider.java index a990aed009..25cc5c4a04 100644 --- a/backend/src/main/java/io/dataease/provider/query/mysql/MysqlQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/mysql/MysqlQueryProvider.java @@ -381,10 +381,11 @@ public class MysqlQueryProvider extends QueryProvider { @Override public String getSQLWithPage(boolean isTable, String table, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) { - if(isTable){ - return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize(); - }else { - return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize(); + String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " LIMIT " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + "," + pageInfo.getPageSize() : ""); + if (isTable) { + return originalTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; + } else { + return originalTableInfo("(" + sqlFix(table) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; } } From ff9b1e8309e511e562a37450509a413832bffa6d Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 28 Nov 2022 17:40:09 +0800 Subject: [PATCH 03/12] =?UTF-8?q?refactor(=E6=8F=92=E4=BB=B6):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8F=92=E4=BB=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/plugin/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/views/system/plugin/index.vue b/frontend/src/views/system/plugin/index.vue index 2e3aeb49fd..ec1a8c165c 100644 --- a/frontend/src/views/system/plugin/index.vue +++ b/frontend/src/views/system/plugin/index.vue @@ -391,7 +391,6 @@ export default { width: 40px; height: 40px; background: #ffffff; - border: 1px solid #dee0e3; border-radius: 4px; display: flex; From d4eb6266d9b645f012196700abf8909888aea23e Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 28 Nov 2022 21:01:04 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=20=E6=A0=A1=E9=AA=8C=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/datasource/DsForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/system/datasource/DsForm.vue b/frontend/src/views/system/datasource/DsForm.vue index d8227cf5bb..ff73aeeccf 100644 --- a/frontend/src/views/system/datasource/DsForm.vue +++ b/frontend/src/views/system/datasource/DsForm.vue @@ -385,8 +385,8 @@ export default { desc: [ { min: 0, - max: 200, - message: i18n.t('datasource.input_limit', { num: '0~200' }), + max: 50, + message: i18n.t('datasource.input_limit', { num: '0~50' }), trigger: 'blur' } ], From 1d08506f0ca7c8604b0aca6d6fc09ed01be4a9f3 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 28 Nov 2022 22:23:30 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix(=E5=BA=94=E7=94=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=90=AB=E6=9C=89=E5=85=B3=E8=81=94=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=9A=84=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=90=8E=E5=85=B3=E8=81=94=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/commons/utils/DatasetUtils.java | 26 ++++++++ .../ext/ExtDataSetTableFieldMapper.java | 2 + .../ext/ExtDataSetTableFieldMapper.xml | 33 +++++----- .../dataease/ext/ExtDataSetTableMapper.java | 5 ++ .../io/dataease/ext/ExtDataSetTableMapper.xml | 11 +++- .../io/dataease/ext/ExtDataSetTaskMapper.java | 4 +- .../io/dataease/ext/ExtDataSetTaskMapper.xml | 61 ++++++++++--------- .../io/dataease/ext/ExtDataSourceMapper.java | 6 +- .../io/dataease/ext/ExtDataSourceMapper.xml | 13 ++++ .../dataset/DataSetTableFieldsService.java | 4 ++ .../panel/PanelAppTemplateService.java | 38 ++++++++++-- .../service/panel/PanelGroupService.java | 52 ++++++++++++---- 12 files changed, 189 insertions(+), 66 deletions(-) create mode 100644 backend/src/main/java/io/dataease/commons/utils/DatasetUtils.java diff --git a/backend/src/main/java/io/dataease/commons/utils/DatasetUtils.java b/backend/src/main/java/io/dataease/commons/utils/DatasetUtils.java new file mode 100644 index 0000000000..35b97fd3bb --- /dev/null +++ b/backend/src/main/java/io/dataease/commons/utils/DatasetUtils.java @@ -0,0 +1,26 @@ +package io.dataease.commons.utils; + +import io.dataease.dto.dataset.union.UnionDTO; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.List; + +/** + * Author: wangjiahao + * Date: 2022/11/28 + * Description: + */ +public class DatasetUtils { + + public static void getUnionTable(List tableIdList, List childrenDs) { + if (CollectionUtils.isNotEmpty(childrenDs)) { + for (UnionDTO unionDTO : childrenDs) { + String tableId = unionDTO.getCurrentDs().getId(); + tableIdList.add(tableId); + if (CollectionUtils.isNotEmpty(unionDTO.getChildrenDs())) { + getUnionTable(tableIdList, unionDTO.getChildrenDs()); + } + } + } + } +} diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.java b/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.java index 88fd842d99..0f10fb6c79 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.java +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.java @@ -8,4 +8,6 @@ import java.util.List; public interface ExtDataSetTableFieldMapper { List findByPanelId(@Param("panelId") String panelId); + List findByTableIds(@Param("tableIds") List tableIds); + } diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.xml index f42396ed96..4aec2878ca 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTableFieldMapper.xml @@ -7,23 +7,22 @@ + + diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.java b/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.java index a28e4145f3..4c6684cbcd 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.java +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.java @@ -11,8 +11,13 @@ public interface ExtDataSetTableMapper { List search(DataSetTableRequest request); DataSetTableDTO searchOne(DataSetTableRequest request); + DataSetTableDTO findOneDetails(@Param("datasetTableId") String datasetTableId); + List searchDataSetTableWithPanelId(@Param("panelId") String panelId, @Param("userId") String userId); + List findByPanelId(@Param("panelId") String panelId); + List findByTableIds(@Param("tableIds") List tableIds); + } diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml index a2e4df7896..deaa2f183b 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml @@ -25,7 +25,7 @@ `info`, create_by, create_time, - ( SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by ) AS creator_name + (SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by) AS creator_name from dataset_table where id = #{datasetTableId} @@ -147,4 +147,13 @@ FROM panel_view WHERE panel_id = #{panelId})) + + diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.java b/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.java index c0c320d041..91ff96757e 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.java +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.java @@ -1,8 +1,8 @@ package io.dataease.ext; -import io.dataease.ext.query.GridExample; import io.dataease.dto.dataset.DataSetTaskDTO; import io.dataease.dto.dataset.DataSetTaskLogDTO; +import io.dataease.ext.query.GridExample; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -25,4 +25,6 @@ public interface ExtDataSetTaskMapper { List taskWithTriggers(GridExample example); List findByPanelId(@Param("panelId") String panelId); + + List findByTableIds(@Param("tableIds") List tableIds); } diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.xml index b073d3c111..2680c1875c 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTaskMapper.xml @@ -8,19 +8,21 @@ - + - SELECT dataset_table_task_log.*, dataset_table_task.name, dataset_table.name as dataset_name FROM dataset_table_task_log LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id LEFT JOIN dataset_table ON dataset_table_task_log.table_id = dataset_table.id - + order by ${orderByClause} @@ -30,13 +32,14 @@ - SELECT dataset_table_task_log.*, dataset_table_task.name, dataset_table.name as dataset_name FROM dataset_table_task_log LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id LEFT JOIN dataset_table ON dataset_table_task_log.table_id = dataset_table.id - + order by ${orderByClause} @@ -47,12 +50,13 @@ + + - diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.java b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.java index d9d1b687e0..18e91bf687 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.java +++ b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.java @@ -1,8 +1,8 @@ package io.dataease.ext; -import io.dataease.ext.query.GridExample; import io.dataease.controller.request.DatasourceUnionRequest; import io.dataease.dto.DatasourceDTO; +import io.dataease.ext.query.GridExample; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -15,7 +15,9 @@ public interface ExtDataSourceMapper { List findByPanelId(@Param("panelId") String panelId); - DatasourceDTO queryDetails(@Param("datasourceId") String datasourceId,@Param("userId") String userId); + List findByTableIds(@Param("tableIds") List tableIds); + + DatasourceDTO queryDetails(@Param("datasourceId") String datasourceId, @Param("userId") String userId); } diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml index 10ce945c85..782da6288a 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml @@ -130,6 +130,19 @@ WHERE panel_view.panel_id = #{panelId} + +