Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
workflow
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
2
议题
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
workflow
Commits
2c33101a
提交
2c33101a
authored
4月 22, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[工作流模块]修改了根页面id查询数据模型
上级
adbea71d
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
39 行增加
和
19 行删除
+39
-19
ModelService.java
...m/tykj/workflowcore/model_layer/service/ModelService.java
+3
-4
ModelImpl.java
...tykj/workflowcore/model_layer/service/impl/ModelImpl.java
+1
-1
FormPageController.java
...owcore/workflow_editer/controller/FormPageController.java
+7
-2
FormPage.java
...om/tykj/workflowcore/workflow_editer/entity/FormPage.java
+4
-1
FormPageVo.java
...kj/workflowcore/workflow_editer/entity/vo/FormPageVo.java
+9
-5
FormPageService.java
...workflowcore/workflow_editer/service/FormPageService.java
+3
-1
FormPageServiceImpl.java
...ore/workflow_editer/service/impl/FormPageServiceImpl.java
+12
-5
没有找到文件。
src/main/java/com/tykj/workflowcore/model_layer/service/ModelService.java
浏览文件 @
2c33101a
...
...
@@ -29,18 +29,17 @@ public interface ModelService {
* 分页查询
* @param searchTableInfoVo
* @return
* @throws SQLException
*/
// @Cacheable(cacheNames = "tableInfos",sync = true)
Page
<
TableInfo
>
pageAllEntities
(
SearchTableInfoVo
searchTableInfoVo
)
throws
SQLException
;
Page
<
TableInfo
>
pageAllEntities
(
SearchTableInfoVo
searchTableInfoVo
);
/**
* 方法重载不分页查询
* @return
* @throws SQLException
*/
List
<
TableInfo
>
listAllEntities
(
SearchTableInfoVo
searchTableInfoVo
)
throws
SQLException
;
List
<
TableInfo
>
listAllEntities
(
SearchTableInfoVo
searchTableInfoVo
)
;
...
...
src/main/java/com/tykj/workflowcore/model_layer/service/impl/ModelImpl.java
浏览文件 @
2c33101a
...
...
@@ -98,7 +98,7 @@ public class ModelImpl implements ModelService {
}
@Override
public
List
<
TableInfo
>
listAllEntities
(
SearchTableInfoVo
searchTableInfoVo
)
throws
SQLException
{
public
List
<
TableInfo
>
listAllEntities
(
SearchTableInfoVo
searchTableInfoVo
)
{
PredicateBuilder
<
TableInfo
>
and
=
createPredicateBySearchTableInfoVo
(
searchTableInfoVo
);
return
tableInfoDao
.
findAll
(
and
.
build
());
}
...
...
src/main/java/com/tykj/workflowcore/workflow_editer/controller/FormPageController.java
浏览文件 @
2c33101a
...
...
@@ -15,7 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* ClassName: FormPageController
...
...
@@ -68,9 +71,11 @@ public class FormPageController {
}
@ApiOperation
(
"通过页面id查询所对应的数据模型"
)
@PostMapping
(
"/findByPages"
)
public
TableAndColumnInfoVO
findByPages
(
@RequestBody
List
<
Integer
>
pageIds
){
@PostMapping
(
"/findByPageIds"
)
public
List
<
TableInfo
>
findByPageIds
(
@RequestBody
List
<
Integer
>
pageIds
){
return
formPageService
.
findByPageIds
(
pageIds
);
}
}
src/main/java/com/tykj/workflowcore/workflow_editer/entity/FormPage.java
浏览文件 @
2c33101a
...
...
@@ -15,6 +15,7 @@ import org.springframework.beans.BeanUtils;
import
javax.persistence.*
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* ClassName: FormPage
...
...
@@ -67,7 +68,9 @@ public class FormPage extends BaseEntity {
String
entityId
=
this
.
getEntityId
();
String
str
[]
=
entityId
.
split
(
","
);
List
<
String
>
entityIds
=
Arrays
.
asList
(
str
);
inFormPageVo
.
setEntityIds
(
entityIds
);
//去重
List
<
String
>
collectIds
=
entityIds
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
inFormPageVo
.
setEntityIds
(
collectIds
);
return
inFormPageVo
;
}
}
src/main/java/com/tykj/workflowcore/workflow_editer/entity/vo/FormPageVo.java
浏览文件 @
2c33101a
...
...
@@ -61,12 +61,16 @@ public class FormPageVo {
public
FormPage
toEntity
(){
FormPage
formPage
=
new
FormPage
();
StringBuffer
IdStr
=
new
StringBuffer
();
for
(
String
entityId
:
entityIds
)
{
IdStr
.
append
(
entityId
);
IdStr
.
append
(
","
);
StringBuffer
idStr
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
entityIds
.
size
();
i
++)
{
idStr
.
append
(
entityIds
.
get
(
i
));
idStr
.
append
(
","
);
if
(
i
==
entityIds
.
size
()-
1
){
idStr
.
deleteCharAt
(
idStr
.
length
()-
1
);
}
}
formPage
.
setEntityId
(
I
dStr
.
toString
());
formPage
.
setEntityId
(
i
dStr
.
toString
());
BeanUtils
.
copyProperties
(
this
,
formPage
);
return
formPage
;
}
...
...
src/main/java/com/tykj/workflowcore/workflow_editer/service/FormPageService.java
浏览文件 @
2c33101a
...
...
@@ -8,6 +8,7 @@ import com.tykj.workflowcore.workflow_editer.entity.vo.PageFormPageVo;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.sql.SQLException
;
import
java.util.List
;
/**
...
...
@@ -58,5 +59,6 @@ public interface FormPageService {
* @param pageIds 页面id
* @return
*/
TableAndColumnInfoVO
findByPageIds
(
List
<
Integer
>
pageIds
);
List
<
TableInfo
>
findByPageIds
(
List
<
Integer
>
pageIds
);
}
src/main/java/com/tykj/workflowcore/workflow_editer/service/impl/FormPageServiceImpl.java
浏览文件 @
2c33101a
...
...
@@ -5,6 +5,7 @@ import com.github.wenhao.jpa.PredicateBuilder;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.workflowcore.model_layer.dao.TableInfoDao
;
import
com.tykj.workflowcore.model_layer.entity.TableInfo
;
import
com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo
;
import
com.tykj.workflowcore.model_layer.entity.vo.TableAndColumnInfoVO
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
com.tykj.workflowcore.workflow_editer.entity.FormPage
;
...
...
@@ -18,6 +19,7 @@ import org.springframework.data.domain.Sort;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
...
...
@@ -80,24 +82,29 @@ public class FormPageServiceImpl implements FormPageService {
}
@Override
public
TableAndColumnInfoVO
findByPageIds
(
List
<
Integer
>
pageIds
)
{
ArrayList
<
TableInfo
>
list
=
new
ArrayList
<>();
public
List
<
TableInfo
>
findByPageIds
(
List
<
Integer
>
pageIds
)
{
PredicateBuilder
<
FormPage
>
builder
=
Specifications
.
and
();
builder
.
in
(
"id"
,
pageIds
);
List
<
FormPage
>
tableInfoList
=
formPageMapper
.
findAll
(
builder
.
build
());
StringBuffer
entityIds
=
new
StringBuffer
();
for
(
FormPage
formPage
:
tableInfoList
)
{
String
entityId
=
formPage
.
getEntityId
();
for
(
int
i
=
0
;
i
<
tableInfoList
.
size
();
i
++
)
{
String
entityId
=
tableInfoList
.
get
(
i
)
.
getEntityId
();
entityIds
.
append
(
entityId
);
entityIds
.
append
(
","
);
if
(
i
==
tableInfoList
.
size
()-
1
){
entityIds
.
deleteCharAt
(
entityIds
.
length
()-
1
);
}
}
String
[]
split
=
entityIds
.
toString
().
split
(
","
);
List
<
String
>
lastEntityIds
=
Arrays
.
asList
(
split
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//todo
Integer
[]
ids
=
(
Integer
[])
lastEntityIds
.
toArray
();
SearchTableInfoVo
searchTableInfoVo
=
new
SearchTableInfoVo
();
searchTableInfoVo
.
setIds
(
ids
);
return
modelService
.
getTableInfoAndColumnInfoByBatch
(
ids
);
return
modelService
.
listAllEntities
(
searchTableInfoVo
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论