From 986536d417052adb51d1c1a111c5cf03766ec878 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Thu, 22 Aug 2024 16:44:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sql=E6=89=A7=E8=A1=8C=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hnac/hzims/common/service/UserAuthDataService.java | 5 +++++ .../com/hnac/hzims/bigmodel/business/service/DataSourceService.java | 1 + 2 files changed, 6 insertions(+) diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/service/UserAuthDataService.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/service/UserAuthDataService.java index 7d7de77..d793fd8 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/service/UserAuthDataService.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/service/UserAuthDataService.java @@ -1,9 +1,11 @@ package com.hnac.hzims.common.service; +import com.hnac.hzims.common.constant.CommonConstant; import com.hnac.hzims.common.logs.utils.StringUtils; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.http.HttpStatus; @@ -22,6 +24,9 @@ public class UserAuthDataService { * @return */ public String getUserAuthDataSQL(Long userId) { + if(CommonConstant.SYSTEM_USER.equals(userId)) { + return ""; + } R r = userClient.userInfoById(userId); String sqlScript = null; if(r.getCode() != HttpStatus.OK.value() || r.getData() == null) { diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/business/service/DataSourceService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/business/service/DataSourceService.java index 23613a2..c616d0a 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/business/service/DataSourceService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/business/service/DataSourceService.java @@ -63,6 +63,7 @@ public class DataSourceService { } } } + sql = sql.replaceAll(">", ">").replaceAll("<", "<"); log.info("执行sql:{}",sql); return this.queryListOnSpecificDataSource(sql, sqlVO.getTableAuthVOList().get(0).getDatasourceName()); }