fix(个人中心): 修复个人中心数据显示问题
【【个人中心】有组织无项目不显示组织】 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001035521
This commit is contained in:
parent
193aa7032c
commit
5df3ca1d19
|
@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ -56,10 +55,7 @@ public class KeyValueInfo {
|
||||||
}
|
}
|
||||||
} else if (StringUtils.equals(this.condition, ParamConditionEnums.REGULAR_MATCH.name())) {
|
} else if (StringUtils.equals(this.condition, ParamConditionEnums.REGULAR_MATCH.name())) {
|
||||||
try {
|
try {
|
||||||
Pattern pattern = Pattern.compile(value);
|
return this.value.matches(Pattern.quote(value));
|
||||||
Matcher matcher = pattern.matcher(this.value);
|
|
||||||
boolean isMatch = matcher.matches();
|
|
||||||
return isMatch;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,15 +139,10 @@ public class UserRoleRelationService {
|
||||||
for (UserRoleRelation userRoleRelation : userRoleRelationList) {
|
for (UserRoleRelation userRoleRelation : userRoleRelationList) {
|
||||||
Organization organization = organizationMapper.selectByPrimaryKey(userRoleRelation.getOrganizationId());
|
Organization organization = organizationMapper.selectByPrimaryKey(userRoleRelation.getOrganizationId());
|
||||||
if (organization != null) {
|
if (organization != null) {
|
||||||
|
returnMap.computeIfAbsent(organization, k -> new ArrayList<>());
|
||||||
Project project = projectMapper.selectByPrimaryKey(userRoleRelation.getSourceId());
|
Project project = projectMapper.selectByPrimaryKey(userRoleRelation.getSourceId());
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
if (returnMap.containsKey(organization)) {
|
returnMap.get(organization).add(project);
|
||||||
if (!returnMap.get(organization).contains(project)) {
|
|
||||||
returnMap.get(organization).add(project);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
returnMap.put(organization, new ArrayList<>(Arrays.asList(project)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue