Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
226656b2
提交
226656b2
编写于
12月 23, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
action
上级
239662ae
变更
9
展开全部
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
288 行增加
和
152 行删除
+288
-152
pom.xml
modules/ibizlab-generator-core/pom.xml
+1
-1
DataSetModel.java
.../src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
+24
-0
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+166
-82
RelationshipModel.java
...main/java/cn/ibizlab/codegen/model/RelationshipModel.java
+15
-3
SystemModel.java
...e/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
+29
-9
TransUtils.java
...re/src/main/java/cn/ibizlab/codegen/model/TransUtils.java
+2
-2
I{{entities@SQL}}Service.java.hbs
...e}}/{{modules}}/service/I{{entities@SQL}}Service.java.hbs
+11
-4
{{entities}}ServiceImpl.java.hbs
...{{modules}}/service/impl/{{entities}}ServiceImpl.java.hbs
+0
-47
pom.xml.hbs
...sources/templ/r7/{{projectName}}-dependencies/pom.xml.hbs
+40
-4
未找到文件。
modules/ibizlab-generator-core/pom.xml
浏览文件 @
226656b2
...
...
@@ -156,7 +156,7 @@
<dependency>
<groupId>
net.ibizsys.model
</groupId>
<artifactId>
ibiz-model
</artifactId>
<version>
0.2.
2
</version>
<version>
0.2.
3
</version>
<exclusions>
<exclusion>
<artifactId>
slf4j-simple
</artifactId>
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
浏览文件 @
226656b2
...
...
@@ -11,6 +11,9 @@ import lombok.Setter;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.ds.IPSDEDataSet
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 实体[数据集]
*/
...
...
@@ -46,6 +49,9 @@ public class DataSetModel extends BaseModel{
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
entity
.
getCodeName
(),
codeName
));
return
this
;
}
private
String
dsType
;
/**
* 代码
*/
...
...
@@ -60,6 +66,24 @@ public class DataSetModel extends BaseModel{
return
(
IPSDEDataSet
)
opt
;
}
private
String
select
=
""
;
private
String
from
=
""
;
private
String
groupBy
=
""
;
private
String
orderBy
=
""
;
private
List
<
String
>
queries
;
public
DataSetModel
addQueries
(
String
queryCodeName
)
{
if
(
queries
==
null
)
queries
=
new
ArrayList
<>();
queries
.
add
(
queryCodeName
);
return
this
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
226656b2
此差异已折叠。
点击以展开。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/RelationshipModel.java
浏览文件 @
226656b2
...
...
@@ -7,6 +7,7 @@ import lombok.Setter;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.defield.IPSDEField
;
import
net.ibizsys.model.dataentity.der.IPSDERBase
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -20,18 +21,29 @@ public class RelationshipModel extends BaseModel{
public
RelationshipModel
(
EntityModel
entityModel
,
IPSDERBase
der
)
{
this
.
opt
=
der
;
this
.
e
ntity
=
entityModel
;
this
.
ownerE
ntity
=
entityModel
;
this
.
setName
(
der
.
getName
());
}
@Override
public
RelationshipModel
setCodeName
(
String
codeName
)
{
super
.
setCodeName
(
codeName
);
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
e
ntity
.
getCodeName
(),
codeName
));
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
ownerE
ntity
.
getCodeName
(),
codeName
));
return
this
;
}
private
EntityModel
entity
;
private
EntityModel
ownerEntity
;
private
EntityModel
relEntity
;
public
EntityModel
getRelEntity
()
{
if
(
relEntity
==
null
&&
ownerEntity
!=
null
&&(!
StringUtils
.
isEmpty
(
entityCodeName
)))
{
relEntity
=
ownerEntity
.
getSystem
().
getEntity
(
entityCodeName
);
}
return
relEntity
;
}
private
String
entityName
;
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
浏览文件 @
226656b2
...
...
@@ -16,6 +16,7 @@ import net.ibizsys.model.dataentity.ds.IPSDEDataQueryCode;
import
net.ibizsys.model.dataentity.ds.IPSDEDataQueryCodeCond
;
import
net.ibizsys.model.dataentity.ds.IPSDEDataSetGroupParam
;
import
net.ibizsys.model.dataentity.ds.PSDEDataSetGroupParamImpl
;
import
net.ibizsys.model.pub.IPSSysSFPub
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -33,12 +34,32 @@ public class SystemModel extends BaseModel {
public
SystemModel
(
IPSSystem
system
)
{
this
.
opt
=
system
;
this
.
setCodeName
(
system
.
getCodeName
());
this
.
setName
(
system
.
getName
());
getEntitiesMap
();
system
.
getAllPSSystemModules
().
forEach
(
item
->{
});
if
(!
ObjectUtils
.
isEmpty
(
system
.
getAllPSSysSFPubs
()))
{
system
.
getAllPSSysSFPubs
().
forEach
(
pub
->{
if
(
pub
.
isMainPSSysSFPub
())
this
.
pub
=
pub
;
});
if
(
this
.
pub
==
null
)
this
.
pub
=
system
.
getAllPSSysSFPubs
().
get
(
0
);
}
if
(
this
.
pub
!=
null
)
{
this
.
setCodeName
(
this
.
pub
.
getCodeName
());
this
.
setName
(
this
.
pub
.
getName
());
this
.
setPackageName
(
this
.
pub
.
getPKGCodeName
());
}
else
{
this
.
setCodeName
(
system
.
getCodeName
());
this
.
setName
(
system
.
getName
());
this
.
setPackageName
(
system
.
getCodeName
().
toLowerCase
());
}
getEntitiesMap
();
}
public
IPSSystem
getSystem
()
...
...
@@ -48,18 +69,15 @@ public class SystemModel extends BaseModel {
public
String
getProjectName
()
{
return
getSystem
().
getCodeName
()
.
toLowerCase
();
return
this
.
codeName
.
toLowerCase
();
}
public
String
getProjectDesc
()
{
return
getSystem
().
getName
()
;
return
this
.
name
;
}
public
String
getPackageName
()
{
return
getSystem
().
getCodeName
().
toLowerCase
();
}
private
String
packageName
;
private
boolean
enableDS
=
false
;
private
boolean
enableES
=
false
;
...
...
@@ -72,6 +90,8 @@ public class SystemModel extends BaseModel {
private
boolean
enablePostgreSQL
=
false
;
private
boolean
enableDyna
=
false
;
private
IPSSysSFPub
pub
;
private
Map
<
String
,
EntityModel
>
entitiesMap
;
public
synchronized
Map
<
String
,
EntityModel
>
getEntitiesMap
()
{
if
(
entitiesMap
==
null
)
{
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/TransUtils.java
浏览文件 @
226656b2
...
...
@@ -283,10 +283,10 @@ public class TransUtils {
order
++;
}
if
(
entityModel
.
get
DataSet
s
()!=
null
)
if
(
entityModel
.
get
Querie
s
()!=
null
)
{
entityModel
.
get
DataSet
s
().
forEach
(
dataSet
->{
entityModel
.
get
Querie
s
().
forEach
(
dataSet
->{
if
(
dataSet
.
getDatasetId
().
startsWith
(
entityModel
.
getEntityName
().
toLowerCase
()+
"-"
)&&
dataSet
.
getDatasetId
().
endsWith
(
dataSourceType
))
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/I{{entities@SQL}}Service.java.hbs
浏览文件 @
226656b2
...
...
@@ -21,9 +21,9 @@ impott om.baomidou.dynamic.datasource.annotation.DS;
import
{{
packageName
}}
.
{{
entity
.
module
}}
.domain.
{{
entity
.
codeName
}}
;
import
{{
packageName
}}
.
{{
entity
.
module
}}
.filter.
{{
entity
.
codeName
}}
SearchContext;
{{#
d
ataSourc
e
}}
{{#
d
sNam
e
}}
@DS("
{{
entity
.
dataSource
}}
")
{{/
d
ataSourc
e
}}
{{/
d
sNam
e
}}
public interface I
{{
entity
.
codeName
}}
Service extends IService
<
{{
entity
.
codeName
}}
>
{
{{
entity
.
codeName
}}
get(
{{
entity
.
keyField
.
type
.
java
}}
key);
...
...
@@ -63,14 +63,21 @@ public interface I{{entity.codeName}}Service extends IService<{{entity.codeName}
boolean
{{
codeName
.
camelCase
}}
Batch(List
<
{{
entity
.
codeName
}}
>
list);
{{/
entity
.
actions
}}
{{#
entity
.
dataSets
}}
Page
<
{{
entity
.
codeName
}}
>
search
{{
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext context);
List
<
{{
entity
.
codeName
}}
>
list
{{
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext context);
{{/
entity
.
dataSets
}}
{{#
entity
.
references
}}
List
<
{{
entity
.
codeName
}}
>
selectBy
{{
fkField
.
codeName
.
pascalCase
}}
(
{{
fkField
.
type
.
java
}}
{{
fkField
.
codeName
.
camelCase
}}
);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
entity
.
codeName
.
lowerCase
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean removeBy
{{
fkField
.
codeName
.
pascalCase
}}
(
{{
fkField
.
type
.
java
}}
{{
fkField
.
codeName
.
camelCase
}}
);
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
entity
.
codeName
.
lowerCase
}}
", allEntries = true)
{{/
enableEntityCache
}}
boolean saveBy
{{
fkField
.
codeName
.
pascalCase
}}
(
{{
fkField
.
type
.
java
}}
{{
fkField
.
codeName
.
camelCase
}}
,List
<
{{
entity
.
codeName
}}
>
list);
{{/
entity
.
references
}}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/impl/{{entities}}ServiceImpl.java.hbs
已删除
100644 → 0
浏览文件 @
239662ae
package
{{
packageName
}}
.core.
{{
entity
.
module
}}
.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import
{{
packageName
}}
.util.errors.BadRequestAlertException;
<
#
system
.
enableGlobalTransaction
>
import io.seata.spring.annotation.GlobalTransactional;
</system
.enableGlobalTransaction
>
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.domain.
{{
entity
.
codeName
}}
;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.filter.
{{
entity
.
codeName
}}
SearchContext;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.service.I
{{
entity
.
codeName
}}
Service;
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.mapper.${item.getCodeName()}Mapper;
import
{{
packageName
}}
.util.helper.CachedBeanCopier;
import
{{
packageName
}}
.util.helper.DEFieldCacheMap;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
public class
{{
entity
.
codeName
}}
ServiceImpl implements I
{{
entity
.
codeName
}}
Service
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-dependencies/pom.xml.hbs
浏览文件 @
226656b2
...
...
@@ -346,31 +346,63 @@
<groupId>
com.baomidou
</groupId>
<artifactId>
dynamic-datasource-spring-boot-starter
</artifactId>
</dependency>
{{/
system
.
enableDS
}}
{{/
system
.
enableDS
}}
{{#
system
.
enableES
}}
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
</dependency>
{{/
system
.
enableES
}}
{{/
system
.
enableES
}}
{{#
system
.
enableMQ
}}
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-client
</artifactId>
<version>
${rocketmq.version}
</version>
</dependency>
{{/
system
.
enableMQ
}}
{{/
system
.
enableMQ
}}
{{#
system
.
enableGlobalTransaction
}}
<dependency>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring-boot-starter
</artifactId>
<version>
${r'${alibaba-seata.version}'}
</version>
<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>
<version>
${r'${spring-cloud-alibaba.version}'}
</version>
<exclusions>
<exclusion>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring-boot-starter
</artifactId>
</exclusion>
</exclusions>
</dependency>
{{/
system
.
enableGlobalTransaction
}}
{{#
system
.
enableOAuth2
}}
<dependency>
<groupId>
org.springframework.security.oauth
</groupId>
<artifactId>
spring-security-oauth2
</artifactId>
<version>
2.3.6.RELEASE
</version>
</dependency>
{{/
system
.
enableGlobalTransaction
}}
<dependency>
<groupId>
org.springframework.security
</groupId>
<artifactId>
spring-security-jwt
</artifactId>
<version>
1.0.10.RELEASE
</version>
</dependency>
{{/
system
.
enableOAuth2
}}
{{#
system
.
enableOracle
}}
<!-- Oracle驱动包 -->
<dependency>
...
...
@@ -378,11 +410,13 @@
<artifactId>
ojdbc8
</artifactId>
<version>
${oracle.version}
</version>
</dependency>
<dependency>
<groupId>
com.oracle.database.nls
</groupId>
<artifactId>
orai18n
</artifactId>
<version>
${oracle.version}
</version>
</dependency>
{{/
system
.
enableOracle
}}
{{#
system
.
enablePostgreSQL
}}
<!-- PostgreSQL驱动包 -->
...
...
@@ -391,6 +425,7 @@
<artifactId>
postgresql
</artifactId>
<version>
${postgresql.version}
</version>
</dependency>
{{/
system
.
enablePostgreSQL
}}
{{#
system
.
enableMysql
}}
<!-- MySQL驱动包 -->
...
...
@@ -398,6 +433,7 @@
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
{{/
system
.
enableMysql
}}
</dependencies>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录