feat(REQ-2300):字段展示处理

This commit is contained in:
李昆鹏 2024-07-24 14:26:15 +08:00
parent 5b1b4c1b13
commit bf3e2c71e1

View File

@ -32,7 +32,8 @@ public class DataPermissionResponseExecutor {
private static final Integer ATTRIBUTE_ISUNMASKABLE = 2;
private static final Integer ATTRIBUTE_ISEDITABLE = 2;
private static final String ATTRIBUTE_ADD_ALLOW_EDIT_PREFIX = "dp_allow_edit_";
private static final String ATTRIBUTE_ADD_ALLOW_DISPLAY_PREFIX = "dp_allow_display_";
private final DataObjectApi dataObjectApi;
public DataPermissionResponseExecutor(DataObjectApi dataObjectApi) {
@ -103,12 +104,12 @@ public class DataPermissionResponseExecutor {
ExamineDpColumnsResp.AttributePermissionBasicDTO basic = entry.getValue();
if (dataNode.has(basic.getAttrCode())) {
ObjectNode objectNode = (ObjectNode) dataNode;
if (!ATTRIBUTE_ISUNMASKABLE.equals(basic.getIsUnmaskable())) {
objectNode.remove(basic.getAttrCode());
}
if (Objects.nonNull(basic.getIsEditable())) {
objectNode.put(ATTRIBUTE_ADD_ALLOW_EDIT_PREFIX + basic.getAttrCode(), ATTRIBUTE_ISEDITABLE.equals(basic.getIsEditable()));
}
if (Objects.nonNull(basic.getIsUnmaskable())) {
objectNode.put(ATTRIBUTE_ADD_ALLOW_DISPLAY_PREFIX + basic.getAttrCode(), ATTRIBUTE_ISUNMASKABLE.equals(basic.getIsUnmaskable()));
}
}
}
}