fix(个人中心): 修复个人中心数据显示问题

【【个人中心】有组织无项目不显示组织】
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001035521
This commit is contained in:
song-tianyang 2024-02-22 15:38:10 +08:00 committed by Craftsman
parent 193aa7032c
commit 5df3ca1d19
2 changed files with 3 additions and 12 deletions

View File

@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Data
@ -56,10 +55,7 @@ public class KeyValueInfo {
}
} else if (StringUtils.equals(this.condition, ParamConditionEnums.REGULAR_MATCH.name())) {
try {
Pattern pattern = Pattern.compile(value);
Matcher matcher = pattern.matcher(this.value);
boolean isMatch = matcher.matches();
return isMatch;
return this.value.matches(Pattern.quote(value));
} catch (Exception e) {
return false;
}

View File

@ -139,15 +139,10 @@ public class UserRoleRelationService {
for (UserRoleRelation userRoleRelation : userRoleRelationList) {
Organization organization = organizationMapper.selectByPrimaryKey(userRoleRelation.getOrganizationId());
if (organization != null) {
returnMap.computeIfAbsent(organization, k -> new ArrayList<>());
Project project = projectMapper.selectByPrimaryKey(userRoleRelation.getSourceId());
if (project != null) {
if (returnMap.containsKey(organization)) {
if (!returnMap.get(organization).contains(project)) {
returnMap.get(organization).add(project);
}
} else {
returnMap.put(organization, new ArrayList<>(Arrays.asList(project)));
}
returnMap.get(organization).add(project);
}
}
}