fix(数据集): 数据集sql变量

This commit is contained in:
taojinlong 2022-07-29 11:44:18 +08:00
parent d934726036
commit a9f6d0ac98
2 changed files with 9 additions and 9 deletions

View File

@ -1027,20 +1027,20 @@ public class DataSetTableService {
}
plainSelect.setWhere(CCJSqlParserUtil.parseCondExpression(stringBuilder.toString()));
StringBuilder builder = new StringBuilder();
if (CollectionUtils.isNotEmpty(select.getWithItemsList())) {
builder.append("WITH");
builder.append(" ");
}
for (Iterator<WithItem> iter = select.getWithItemsList().iterator(); iter.hasNext();) {
WithItem withItem = iter.next();
builder.append(withItem.toString());
if (iter.hasNext()) {
builder.append(",");
for (Iterator<WithItem> iter = select.getWithItemsList().iterator(); iter.hasNext();) {
WithItem withItem = iter.next();
builder.append(withItem.toString());
if (iter.hasNext()) {
builder.append(",");
}
}
}
builder.append(plainSelect);
builder.append( " " + plainSelect);
return builder.toString();
}

View File

@ -183,7 +183,7 @@ public class PermissionService {
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
columnPermissionsDTO.getWhiteListUser();
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {}.getType());
if(!userIdList.contains(userId)){
if(CollectionUtils.isNotEmpty(userIdList) && !userIdList.contains(userId)){
roleColumnPermissionsDTOS.add(columnPermissionsDTO);
}
}