Browse Source

fix: sql执行解析语义

zhongwei
haungxing 5 months ago
parent
commit
986536d417
  1. 5
      hzims-biz-common/src/main/java/com/hnac/hzims/common/service/UserAuthDataService.java
  2. 1
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/business/service/DataSourceService.java

5
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<User> r = userClient.userInfoById(userId);
String sqlScript = null;
if(r.getCode() != HttpStatus.OK.value() || r.getData() == null) {

1
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("&gt;", ">").replaceAll("&lt;", "<");
log.info("执行sql:{}",sql);
return this.queryListOnSpecificDataSource(sql, sqlVO.getTableAuthVOList().get(0).getDatasourceName());
}

Loading…
Cancel
Save