Skip to content

Commit f7b8831

Browse files
author
wuayee
committed
[appBuilder] 实现分域功能
1 parent 6c8930c commit f7b8831

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

app-builder/plugins/aipp-plugin/src/main/resources/mapper/AppBuilderAppMapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
and app_category = #{cond.appCategory}
204204
</if>
205205
<if test='cond.userGroupId != null'>
206-
and user_group_id = #{cond.userGroupId} or user_group_id = '*'
206+
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
207207
</if>
208208
) as latest_records WHERE <include refid="appTypeCondition"/>;
209209
</select>

app-builder/plugins/aipp-plugin/src/main/resources/mapper/AppBuilderFormMapper.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
and tenant_id = #{cond.tenantId}
101101
</if>
102102
<if test='cond.userGroupId != null'>
103-
and user_group_id = #{cond.userGroupId} or user_group_id = '*'
103+
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
104104
</if>
105105
<if test="cond.type != null">
106106
and type = #{cond.type}
@@ -130,7 +130,7 @@
130130
and tenant_id = #{cond.tenantId}
131131
</if>
132132
<if test='cond.userGroupId != null'>
133-
and user_group_id = #{cond.userGroupId} or user_group_id = '*'
133+
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
134134
</if>
135135
<if test="cond.type != null">
136136
and type = #{cond.type}

store/plugins/store-repository-postgresql/src/main/java/modelengine/jade/store/repository/pgsql/service/DefaultPluginService.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,15 @@ public List<PluginData> getPlugins(DeployStatus deployStatus) {
157157
}
158158

159159
private Predicate<PluginData> isNotInUserGroup() {
160-
return data -> data.getUserGroupId() != null && (
161-
!StringUtils.equals(data.getUserGroupId(), this.domainDivisionService.getUserGroupId())
162-
|| !StringUtils.equals(data.getUserGroupId(), "*"));
160+
return data -> {
161+
if (data.getUserGroupId() == null) {
162+
return true;
163+
}
164+
String currentUserGroupId = this.domainDivisionService.getUserGroupId();
165+
boolean isCurrentGroup = StringUtils.equals(data.getUserGroupId(), currentUserGroupId);
166+
boolean isAllGroup = StringUtils.equals(data.getUserGroupId(), "*");
167+
return !(isCurrentGroup || isAllGroup);
168+
};
163169
}
164170

165171
@Override

0 commit comments

Comments
 (0)