forked from github/dataease
fix: 数据集脱敏
This commit is contained in:
parent
fe2ce6ef58
commit
65ae8e84b4
core/core-backend/src/main/java/io/dataease
@ -1106,11 +1106,11 @@ public class ChartDataBuild {
|
||||
break;
|
||||
}
|
||||
if (originStr.length() >= columnPermissionItem.getDesensitizationRule().getM() && originStr.length() >= columnPermissionItem.getDesensitizationRule().getN()) {
|
||||
desensitizationStr = StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, columnPermissionItem.getDesensitizationRule().getN()) + "***";
|
||||
desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, columnPermissionItem.getDesensitizationRule().getN()) + "***";
|
||||
break;
|
||||
}
|
||||
if (originStr.length() >= columnPermissionItem.getDesensitizationRule().getM() && originStr.length() < columnPermissionItem.getDesensitizationRule().getN()) {
|
||||
desensitizationStr = StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, originStr.length()) + "***";
|
||||
desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, originStr.length());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public class ExcelUtils {
|
||||
|
||||
public static final String UFEFF = "\uFEFF";
|
||||
private static String path = "/opt/dataease/data/excel/";
|
||||
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@ -450,6 +450,9 @@ public class ExcelUtils {
|
||||
if(StringUtils.isEmpty(filedName)){
|
||||
DEException.throwException("首行行中不允许有空单元格!");
|
||||
}
|
||||
if (filedName.startsWith(UFEFF)) {
|
||||
filedName = filedName.replace(UFEFF, "");
|
||||
}
|
||||
TableField tableFiled = new TableField();
|
||||
tableFiled.setName(filedName);
|
||||
tableFiled.setOriginName(filedName);
|
||||
|
@ -144,8 +144,10 @@ public class DatasourceServer implements DatasourceApi {
|
||||
private void filterDs(List<BusiNodeVO> busiNodeVOS, List<Long> ids, String type, Long id) {
|
||||
for (BusiNodeVO busiNodeVO : busiNodeVOS) {
|
||||
if (busiNodeVO.getType() != null && busiNodeVO.getType().equalsIgnoreCase(type)) {
|
||||
if (id != null && !busiNodeVO.getId().equals(id)) {
|
||||
if (id != null) {
|
||||
if (!busiNodeVO.getId().equals(id)) {
|
||||
ids.add(busiNodeVO.getId());
|
||||
}
|
||||
} else {
|
||||
ids.add(busiNodeVO.getId());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user