Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
30e5a6a7
提交
30e5a6a7
编写于
12月 17, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
便捷操作
上级
4be084b0
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
160 行增加
和
37 行删除
+160
-37
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+18
-4
SystemModel.java
...e/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
+23
-2
pom.xml
.../src/main/resources/templ/r7/{{projectName}}-core/pom.xml
+24
-0
{{entities#SQL}}.java
.../{{packageName}}/{{modules}}/domain/{{entities#SQL}}.java
+46
-0
{{entities}}.java
...java/{{packageName}}/{{modules}}/domain/{{entities}}.java
+0
-25
pom.xml
...n/resources/templ/r7/{{projectName}}-dependencies/pom.xml
+49
-6
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
30e5a6a7
...
...
@@ -28,8 +28,7 @@ import java.util.*;
public
class
EntityModel
extends
BaseModel
{
private
SystemModel
system
;
public
String
getEntityName
()
{
...
...
@@ -342,11 +341,14 @@ public class EntityModel extends BaseModel {
return
extParams
.
getStringValue
(
key
,
defaultVal
);
}
private
boolean
hasResetField
=
false
;
public
EntityModel
(
IPSDataEntity
dataEntity
)
public
EntityModel
(
SystemModel
systemModel
,
IPSDataEntity
dataEntity
)
{
Assert
.
notNull
(
dataEntity
,
"未找到对应的实体模型:"
+
dataEntity
.
getId
());
this
.
opt
=
dataEntity
;
this
.
system
=
systemModel
;
this
.
setCodeName
(
dataEntity
.
getCodeName
());
this
.
setName
(
dataEntity
.
getName
());
this
.
setStorageMode
(
dataEntity
.
getStorageMode
());
...
...
@@ -355,7 +357,16 @@ public class EntityModel extends BaseModel {
if
(
dataEntity
.
getAllPSDEDBConfigs
()!=
null
)
{
dataEntity
.
getAllPSDEDBConfigs
().
forEach
(
item
->{
dsTypes
.
add
(
item
.
getDBType
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
));
String
dbType
=
item
.
getDBType
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
);
if
(
"mysql"
.
equals
(
dbType
))
system
.
setEnableMysql
(
true
);
else
if
(
"oracle"
.
equals
(
dbType
))
system
.
setEnableOracle
(
true
);
else
if
(
"postgresql"
.
equals
(
dbType
))
system
.
setEnablePostgreSQL
(
true
);
else
if
(
"dameng"
.
equals
(
dbType
)||
"dm"
.
equals
(
dbType
))
system
.
setEnableDameng
(
true
);
dsTypes
.
add
(
dbType
);
if
(!
this
.
getTableName
().
equalsIgnoreCase
(
item
.
getTableName
()))
this
.
set
(
"table-"
+
item
.
getDBType
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
),
item
.
getTableName
());
});
...
...
@@ -424,6 +435,9 @@ public class EntityModel extends BaseModel {
String
dict
=
null
;
try
{
dict
=
defield
.
getPSCodeList
()!=
null
?
defield
.
getPSCodeList
().
getCodeName
():
null
;
}
catch
(
Exception
ex
){}
if
(
defield
.
isPasteReset
())
this
.
hasResetField
=
true
;
FieldModel
fieldModel
=
new
FieldModel
(
this
,
defield
);
if
(
defield
.
getAllPSDEFDTColumns
()!=
null
)
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
浏览文件 @
30e5a6a7
...
...
@@ -33,6 +33,10 @@ public class SystemModel extends BaseModel {
public
SystemModel
(
IPSSystem
system
)
{
this
.
opt
=
system
;
getEntitiesMap
();
system
.
getAllPSSystemModules
().
forEach
(
item
->{
});
}
public
IPSSystem
getSystem
()
...
...
@@ -55,12 +59,29 @@ public class SystemModel extends BaseModel {
return
getSystem
().
getCodeName
().
toLowerCase
();
}
private
boolean
enableDS
=
false
;
private
boolean
enableES
=
false
;
private
boolean
enableMQ
=
false
;
private
boolean
enableOAuth2
=
false
;
private
boolean
enableGlobalTransaction
=
false
;
private
boolean
enableMysql
=
false
;
private
boolean
enableOracle
=
false
;
private
boolean
enableDameng
=
false
;
private
boolean
enablePostgreSQL
=
false
;
private
boolean
enableDyna
=
false
;
private
Map
<
String
,
EntityModel
>
entitiesMap
;
public
synchronized
Map
<
String
,
EntityModel
>
getEntitiesMap
()
{
if
(
entitiesMap
==
null
)
{
entitiesMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSDataEntities
().
forEach
(
dataEntity
->
{
entitiesMap
.
put
(
dataEntity
.
getCodeName
(),
new
EntityModel
(
dataEntity
));
getSystem
().
getAllPSDataEntities
().
forEach
(
entity
->
{
if
((
entity
.
getStorageMode
()==
1
||
entity
.
getStorageMode
()==
2
)
&&
"DEFAULT"
.
equals
(
entity
.
getDSLink
()))
enableDS
=
true
;
if
(
"elasticsearch"
.
equalsIgnoreCase
(
entity
.
getUserTag
()))
enableES
=
true
;
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getAllPSDEDataSyncs
()))
enableMQ
=
true
;
entitiesMap
.
put
(
entity
.
getCodeName
(),
new
EntityModel
(
this
,
entity
));
});
}
return
entitiesMap
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/pom.xml
浏览文件 @
30e5a6a7
...
...
@@ -98,6 +98,30 @@
<artifactId>
jobs-spring-boot-starter
</artifactId>
</dependency>
{{#system.enableGlobalTransaction}}
<!-- 阿里seata分布式事务 -->
<dependency>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring-boot-starter
</artifactId>
<exclusions>
<exclusion>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.alibaba.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-seata
</artifactId>
<exclusions>
<exclusion>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring-boot-starter
</artifactId>
</exclusion>
</exclusions>
</dependency>
{{/system.enableGlobalTransaction}}
</dependencies>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities#SQL}}.java
0 → 100644
浏览文件 @
30e5a6a7
package
{{
packageName
}}.{{
module
}}.
domain
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.DigestUtils
;
import
{{
packageName
}}.
util
.
domain
.
EntityBase
;
import
{{
packageName
}}.
util
.
annotation
.
DEField
;
import
{{
packageName
}}.
util
.
enums
.
DEPredefinedFieldType
;
import
{{
packageName
}}.
util
.
enums
.
DEFieldDefaultValueType
;
import
{{
packageName
}}.
util
.
helper
.
DataObject
;
import
{{
packageName
}}.
util
.
enums
.
DupCheck
;
import
java.io.Serializable
;
import
lombok.*
;
import
org.springframework.data.annotation.Transient
;
import
{{
packageName
}}.
util
.
annotation
.
Audit
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.baomidou.mybatisplus.annotation.*
;
import
{{
packageName
}}.
util
.
domain
.
EntityMP
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties
(
value
=
"handler"
)
@TableName
(
value
=
"{{entity.tableName}}"
,
resultMap
=
"{{entity.codeName}}ResultMap"
)
@ApiModel
(
"{{entity.logicName}}"
)
public
class
{{
entity
.
codeName
}}
extends
EntityMP
implements
Serializable
{
{{
#
entity
.
fields
}}
private
{{
type
.
java
}}
{{
codeName
.
camelCase
}};
{{/
entity
.
fields
}}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities}}.java
已删除
100644 → 0
浏览文件 @
4be084b0
package
{{
packageName
}}.{{
module
}}.
domain
;
// {{entity.dataAccCtrlArch}}
public
class
{{
entity
.
codeName
}}
{
{{
#
pascalcase
}}{{
entity
.
codeName
}}{{/
pascalcase
}}
{{
#
camelcase
}}{{
entity
.
codeName
}}{{/
camelcase
}}
{{
#
snakecase
}}{{
entity
.
codeName
}}{{/
snakecase
}}
{{
#
snakecase
}}
SNAKECASE
{{/
snakecase
}}
{{
#
snakecase
}}
snakeCase
{{/
snakecase
}}
{{
#
snakecase
}}
snake_case
{{/
snakecase
}}
{{
#
camelcase
}}
camelCase
{{/
camelcase
}}
{{
#
camelcase
}}
Camel_case
{{/
camelcase
}}
{{
#
camelcase
}}
CAMELCase
{{/
camelcase
}}
{{
#
camelcase
}}
CAMELCASE
{{/
camelcase
}}
{{
#
pascalcase
}}
camel_case
{{/
pascalcase
}}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-dependencies/pom.xml
浏览文件 @
30e5a6a7
...
...
@@ -83,8 +83,16 @@
<!-- 阿里seata分布式事务 -->
<alibaba-seata.version>
1.3.0
</alibaba-seata.version>
{{#system.enableOracle}}
<oracle.version>
19.8.0.0
</oracle.version>
{{/system.enableOracle}}
{{#system.enablePostgreSQL}}
<postgresql.version>
42.2.6
</postgresql.version>
{{/system.enablePostgreSQL}}
{{#system.enableMQ}}
<rocketmq.version>
4.7.0
</rocketmq.version>
{{/system.enableMQ}}
<flowable-modeler.version>
6.4.2
</flowable-modeler.version>
</properties>
...
...
@@ -333,6 +341,37 @@
<version>
${eureka-client.version}
</version>
</dependency>
{{#system.enableDS}}
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
dynamic-datasource-spring-boot-starter
</artifactId>
</dependency>
{{/system.enableDS}}
{{#system.enableES}}
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
</dependency>
{{/system.enableES}}
{{#system.enableMQ}}
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-client
</artifactId>
<version>
${rocketmq.version}
</version>
</dependency>
{{/system.enableMQ}}
{{#system.enableGlobalTransaction}}
<dependency>
<groupId>
org.springframework.security.oauth
</groupId>
<artifactId>
spring-security-oauth2
</artifactId>
<version>
2.3.6.RELEASE
</version>
</dependency>
{{/system.enableGlobalTransaction}}
{{#system.enableOracle}}
<!-- Oracle驱动包 -->
<dependency>
<groupId>
com.oracle.database.jdbc
</groupId>
...
...
@@ -344,18 +383,22 @@
<artifactId>
orai18n
</artifactId>
<version>
${oracle.version}
</version>
</dependency>
{{/system.enableOracle}}
{{#system.enablePostgreSQL}}
<!-- PostgreSQL驱动包 -->
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
${postgresql.version}
</version>
</dependency>
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
${postgresql.version}
</version>
</dependency>
{{/system.enablePostgreSQL}}
{{#system.enableMysql}}
<!-- MySQL驱动包 -->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
{{/system.enableMysql}}
</dependencies>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录