Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
workflow-core
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
workflow-core
Commits
b6e726b2
提交
b6e726b2
authored
3月 15, 2021
作者:
ww1xhqc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[数据模型] 修改了查询列名的逻辑
上级
5cb69223
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
16 行删除
+17
-16
SearchColumnInfoVo.java
...orkflowcore/model_layer/entity/vo/SearchColumnInfoVo.java
+1
-0
ModelImpl.java
...tykj/workflowcore/model_layer/service/impl/ModelImpl.java
+16
-16
没有找到文件。
src/main/java/com/tykj/workflowcore/model_layer/entity/vo/SearchColumnInfoVo.java
浏览文件 @
b6e726b2
...
@@ -16,6 +16,7 @@ import lombok.NoArgsConstructor;
...
@@ -16,6 +16,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@NoArgsConstructor
@Data
@Data
public
class
SearchColumnInfoVo
extends
JpaCustomPage
{
public
class
SearchColumnInfoVo
extends
JpaCustomPage
{
private
Integer
id
;
private
Integer
id
;
private
String
dbName
;
private
String
dbName
;
}
}
src/main/java/com/tykj/workflowcore/model_layer/service/impl/ModelImpl.java
浏览文件 @
b6e726b2
...
@@ -4,12 +4,14 @@ import cn.hutool.db.Db;
...
@@ -4,12 +4,14 @@ import cn.hutool.db.Db;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.workflowcore.model_layer.annotati
ion
.WorkFlowCoreNoScan
;
import
com.tykj.workflowcore.model_layer.annotati
ons
.WorkFlowCoreNoScan
;
import
com.tykj.workflowcore.model_layer.dao.ColumnInfoDao
;
import
com.tykj.workflowcore.model_layer.dao.ColumnInfoDao
;
import
com.tykj.workflowcore.model_layer.dao.TableInfoDao
;
import
com.tykj.workflowcore.model_layer.dao.TableInfoDao
;
import
com.tykj.workflowcore.model_layer.model.*
;
import
com.tykj.workflowcore.model_layer.entity.TableInfo
;
import
com.tykj.workflowcore.model_layer.entity.vo.*
;
import
com.tykj.workflowcore.model_layer.entity.*
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
com.tykj.workflowcore.model_layer.utils.CreatTableUtil
;
import
com.tykj.workflowcore.model_layer.utils.Creat
e
TableUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -41,7 +43,8 @@ import java.text.SimpleDateFormat;
...
@@ -41,7 +43,8 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
import
java.util.*
;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
ClassTypeLength
.
setLength
;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
ClassTypeLength
.
setLength
;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
CreatTableUtil
.*;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
CreateTableUtil
.*;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
HqlUtil
.
createQuery
;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
HqlUtil
.
createQuery
;
...
@@ -91,15 +94,12 @@ public class ModelImpl implements ModelService {
...
@@ -91,15 +94,12 @@ public class ModelImpl implements ModelService {
* @Date 16:15 2021/3/5
* @Date 16:15 2021/3/5
**/
**/
@Override
@Override
public
List
<
ColumnInfo
>
showModelFields
(
String
tableName
)
{
public
List
<
ColumnInfo
>
showModelFields
(
SearchColumnInfoVo
SearchColumnInfoVo
)
{
PredicateBuilder
<
ColumnInfo
>
and
=
Specifications
.
and
();
and
.
eq
(
SearchColumnInfoVo
.
getId
()
!=
null
,
"id"
,
SearchColumnInfoVo
.
getId
());
and
.
eq
(
SearchColumnInfoVo
.
getDbName
()
!=
null
,
"dbName"
,
SearchColumnInfoVo
.
getDbName
());
return
columnInfoDao
.
findAll
(
and
.
build
());
Specification
specification
=
(
Specification
)
(
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
Path
dbName
=
root
.
get
(
"dbName"
);
Predicate
equal
=
criteriaBuilder
.
equal
(
dbName
,
tableName
);
return
equal
;
};
List
<
ColumnInfo
>
all
=
columnInfoDao
.
findAll
(
specification
);
return
all
;
}
}
...
@@ -112,7 +112,7 @@ public class ModelImpl implements ModelService {
...
@@ -112,7 +112,7 @@ public class ModelImpl implements ModelService {
**/
**/
@Override
@Override
public
TableVO
newTable
(
TableVO
tableVO
)
{
public
TableVO
newTable
(
TableVO
tableVO
)
{
String
xmlMapping
=
creatTable
(
tableVO
);
String
xmlMapping
=
creat
e
Table
(
tableVO
);
Integer
modelType
=
tableVO
.
getModelType
();
Integer
modelType
=
tableVO
.
getModelType
();
String
parentTable
=
null
;
String
parentTable
=
null
;
//扫描新建类型
//扫描新建类型
...
@@ -123,7 +123,7 @@ public class ModelImpl implements ModelService {
...
@@ -123,7 +123,7 @@ public class ModelImpl implements ModelService {
tableVO
.
setModelType
(
1
);
tableVO
.
setModelType
(
1
);
}
}
Creat
TableUtil
creatTableUtil
=
new
Creat
TableUtil
();
Creat
eTableUtil
creatTableUtil
=
new
Create
TableUtil
();
Session
session
=
creatTableUtil
.
getSession
(
entityManagerFactory
,
xmlMapping
);
Session
session
=
creatTableUtil
.
getSession
(
entityManagerFactory
,
xmlMapping
);
List
<
ColumnVO
>
dataList
=
tableVO
.
getDataList
();
List
<
ColumnVO
>
dataList
=
tableVO
.
getDataList
();
...
@@ -199,7 +199,7 @@ public class ModelImpl implements ModelService {
...
@@ -199,7 +199,7 @@ public class ModelImpl implements ModelService {
* @Date 16:17 2021/3/5
* @Date 16:17 2021/3/5
**/
**/
public
void
insertValue
(
String
tableName
,
String
xml
,
Map
map
)
{
public
void
insertValue
(
String
tableName
,
String
xml
,
Map
map
)
{
Creat
TableUtil
creatTableUtil
=
new
Creat
TableUtil
();
Creat
eTableUtil
creatTableUtil
=
new
Create
TableUtil
();
Session
newSession
=
creatTableUtil
.
getSession
(
entityManagerFactory
,
xml
);
Session
newSession
=
creatTableUtil
.
getSession
(
entityManagerFactory
,
xml
);
SessionImpl
session
=
(
SessionImpl
)
newSession
;
SessionImpl
session
=
(
SessionImpl
)
newSession
;
EntityPersister
entityPersister
=
session
.
getEntityPersister
(
tableName
,
map
);
EntityPersister
entityPersister
=
session
.
getEntityPersister
(
tableName
,
map
);
...
@@ -300,7 +300,7 @@ public class ModelImpl implements ModelService {
...
@@ -300,7 +300,7 @@ public class ModelImpl implements ModelService {
list
.
add
(
columnVO
);
list
.
add
(
columnVO
);
}
}
tableVO
.
setDataList
(
list
);
tableVO
.
setDataList
(
list
);
String
xml
=
creatTable
(
tableVO
);
String
xml
=
creat
e
Table
(
tableVO
);
tableInfo
.
setName
(
tableVO
.
getModelName
());
tableInfo
.
setName
(
tableVO
.
getModelName
());
tableInfo
.
setCnName
(
tableVO
.
getModelTitle
());
tableInfo
.
setCnName
(
tableVO
.
getModelTitle
());
tableInfo
.
setXml
(
xml
);
tableInfo
.
setXml
(
xml
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论