Skip to content

Commit 87df55d

Browse files
wuayeewuayee
andauthored
[app-builder] 优化分域功能关闭时的场景 (#495)
Co-authored-by: wuayee <lixin_33@noreply.gitcode.com>
1 parent 3337fae commit 87df55d

File tree

7 files changed

+17
-4
lines changed

7 files changed

+17
-4
lines changed

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/service/impl/AppBuilderAppServiceImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public Rsp<RangedResultSet<AppBuilderAppMetadataDto>> list(AppQueryCondition con
228228
if (cond == null) {
229229
cond = new AppQueryCondition();
230230
}
231+
cond.setCreateBy(context.getOperator());
231232
if (this.isEnableDomainDivision) {
232233
cond.setUserGroupId(this.domainDivisionService.getUserGroupId());
233234
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
#{excludeName}
124124
</foreach>
125125
</if>
126+
<if test="cond.userGroupId == null and cond.createBy != null">
127+
and create_by = #{cond.createBy}
128+
</if>
126129
<if test='cond.userGroupId != null'>
127130
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
128131
</if>
@@ -202,6 +205,9 @@
202205
<if test="cond.appCategory != null">
203206
and app_category = #{cond.appCategory}
204207
</if>
208+
<if test="cond.userGroupId == null and cond.createBy != null">
209+
and create_by = #{cond.createBy}
210+
</if>
205211
<if test='cond.userGroupId != null'>
206212
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
207213
</if>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<if test="cond.tenantId != null">
100100
and tenant_id = #{cond.tenantId}
101101
</if>
102+
<if test="cond.userGroupId == null and cond.createBy != null">
103+
and create_by = #{cond.createBy}
104+
</if>
102105
<if test='cond.userGroupId != null'>
103106
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
104107
</if>
@@ -129,6 +132,9 @@
129132
<if test="cond.tenantId != null">
130133
and tenant_id = #{cond.tenantId}
131134
</if>
135+
<if test="cond.userGroupId == null and cond.createBy != null">
136+
and create_by = #{cond.createBy}
137+
</if>
132138
<if test='cond.userGroupId != null'>
133139
and (user_group_id = #{cond.userGroupId} or user_group_id = '*')
134140
</if>

app-builder/plugins/aipp-plugin/src/main/resources/sql/schema/create_tables/appbuilder_create.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ create table if not exists app_builder_form
143143
is_deleted int2 DEFAULT 0,
144144
form_suite_id varchar(64) not null,
145145
version varchar(64) not null,
146-
user_group_id varchar(64) NULL
146+
user_group_id varchar(64)
147147
);
148148

149149
create table if not exists app_builder_form_property

store/plugins/store-repository-postgresql/src/main/resources/sql/schema/create_tables/schema-app.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create table if not exists store_app
1515
"app_category" varchar(16) default 'chatbot',
1616
"tool_name" varchar(256) not null,
1717
"tool_unique_name" varchar(36) not null,
18-
"user_group_id" varchar(64) not null,
18+
"user_group_id" varchar(64),
1919
unique("tool_unique_name")
2020
);
2121
create index if not exists fast_query_app on store_app ("tool_unique_name");

store/plugins/store-repository-postgresql/src/main/resources/sql/schema/create_tables/schema-plugin-tool.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create table if not exists store_plugin_tool
1515
"tool_unique_name" varchar(36) not null,
1616
"source" varchar(16) default '' not null,
1717
"icon" text,
18-
"user_group_id" varchar(64) not null,
18+
"user_group_id" varchar(64),
1919
unique("plugin_id", "tool_unique_name")
2020
);
2121
comment on column store_plugin_tool.id is '插件工具的自增主键';

store/plugins/store-repository-postgresql/src/main/resources/sql/schema/create_tables/schema-plugin.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create table if not exists store_plugin
1515
"is_builtin" boolean default false not null,
1616
"source" varchar(16) default '' not null,
1717
"icon" text,
18-
"user_group_id" varchar(64) not null,
18+
"user_group_id" varchar(64),
1919
unique ("plugin_id")
2020
);
2121
create index if not exists query_plugin ON store_plugin ("is_builtin");

0 commit comments

Comments
 (0)