Skip to content

Commit dad6d68

Browse files
authored
[appengine] 智能表单查询接口不返回内置表单 (#86)
1 parent 16756e9 commit dad6d68

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

app-builder/jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/condition/FormQueryCondition.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import lombok.Data;
1212
import lombok.NoArgsConstructor;
1313

14+
import java.util.List;
15+
1416
/**
1517
* 为Form提供查询条件
1618
*
@@ -35,4 +37,6 @@ public class FormQueryCondition {
3537
private String id;
3638

3739
private String createBy;
40+
41+
private List<String> excludeNames;
3842
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import modelengine.fit.jober.aipp.service.UploadedFileManageService;
2525
import modelengine.fit.jober.common.RangedResultSet;
2626
import modelengine.fitframework.annotation.Component;
27+
import modelengine.fitframework.annotation.Value;
2728
import modelengine.fitframework.log.Logger;
2829
import modelengine.fitframework.util.StringUtils;
2930

@@ -75,11 +76,15 @@ public class AppBuilderFormServiceImpl implements AppBuilderFormService {
7576

7677
private final UploadedFileManageService uploadedFileManageService;
7778

79+
private final List<String> excludeNames;
80+
7881
public AppBuilderFormServiceImpl(AppBuilderFormRepository formRepository, AippFormCreateConfig aippFormCreateConfig,
79-
UploadedFileManageService uploadedFileManageService) {
82+
UploadedFileManageService uploadedFileManageService,
83+
@Value("${app-engine.form.exclude-names}") List<String> excludeNames) {
8084
this.formRepository = formRepository;
8185
this.aippFormCreateConfig = aippFormCreateConfig;
8286
this.uploadedFileManageService = uploadedFileManageService;
87+
this.excludeNames = excludeNames;
8388
}
8489

8590
@Override
@@ -171,6 +176,7 @@ public RangedResultSet<AppBuilderFormDto> query(long pageNum, int pageSize, Stri
171176
.offset(offset)
172177
.limit(pageSize)
173178
.name(name)
179+
.excludeNames(excludeNames)
174180
.build();
175181
long total = this.formRepository.countWithCondition(cond);
176182
List<AppBuilderFormDto> result = this.formRepository.selectWithCondition(cond)

app-builder/jane/plugins/aipp-plugin/src/main/resources/application-prod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ app-engine:
4646
path: smart_form
4747
temporary-path: smart_form/temporary
4848
group-name: 60000
49+
exclude-names:
50+
- '表单'
4951
file:
5052
upload:
5153
maxStorageRatio: 0.9

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@
110110
<if test="cond.name != null">
111111
and name LIKE '%' || #{cond.name} || '%'
112112
</if>
113+
<if test="cond.excludeNames != null and cond.excludeNames.size() > 0">
114+
and name NOT IN
115+
<foreach item="excludeName" collection="cond.excludeNames" open="(" separator="," close=")">
116+
#{excludeName}
117+
</foreach>
118+
</if>
113119
ORDER BY update_at DESC, create_at DESC
114120
<if test="cond.offset != null and cond.limit != null">
115121
LIMIT #{cond.limit} OFFSET #{cond.offset}
@@ -122,11 +128,23 @@
122128
<if test="cond.tenantId != null">
123129
and tenant_id = #{cond.tenantId}
124130
</if>
131+
<if test="cond.createBy != null">
132+
and create_by = #{cond.createBy}
133+
</if>
125134
<if test="cond.type != null">
126135
and type = #{cond.type}
127136
</if>
137+
<if test="cond.id != null">
138+
and id = #{cond.id}
139+
</if>
128140
<if test="cond.name != null">
129141
and name LIKE '%' || #{cond.name} || '%'
130142
</if>
143+
<if test="cond.excludeNames != null and cond.excludeNames.size() > 0">
144+
and name NOT IN
145+
<foreach item="excludeName" collection="cond.excludeNames" open="(" separator="," close=")">
146+
#{excludeName}
147+
</foreach>
148+
</if>
131149
</select>
132150
</mapper>

app-builder/jane/plugins/aipp-plugin/src/test/java/modelengine/fit/jober/aipp/service/AppBuilderFormServiceImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void before() {
7575
this.aippFormCreateConfig = new AippFormCreateConfig();
7676
this.aippFormCreateConfig.setMaximumNum(400L);
7777
this.appBuilderFormService = new AppBuilderFormServiceImpl(this.appBuilderFormRepository,
78-
this.aippFormCreateConfig, this.uploadedFileManageService);
78+
this.aippFormCreateConfig, this.uploadedFileManageService, null);
7979
}
8080

8181
@Test

0 commit comments

Comments
 (0)