Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
eac8730a
提交
eac8730a
编写于
8月 01, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizlab模板
上级
8f51d4ca
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
34 行增加
和
57 行删除
+34
-57
BootApplication.java.hbs
...ot/src/main/java/{{packageName}}/BootApplication.java.hbs
+2
-2
{{entities@ServiceAPI}}FeignClient.java.hbs
...ules}}/client/{{entities@ServiceAPI}}FeignClient.java.hbs
+6
-12
{{entities@NONE}}.java.hbs
...Name}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
+0
-13
{{entities@SQL}}.java.hbs
...eName}}/core/{{modules}}/domain/{{entities@SQL}}.java.hbs
+3
-6
{{entities@ServiceAPI}}.java.hbs
.../core/{{modules}}/domain/{{entities@ServiceAPI}}.java.hbs
+2
-4
{{entities@SQL}}ServiceBase.java.hbs
...dules}}/service/impl/{{entities@SQL}}ServiceBase.java.hbs
+12
-12
{{entities@ServiceAPI}}ServiceBase.java.hbs
.../service/impl/{{entities@ServiceAPI}}ServiceBase.java.hbs
+7
-5
MybatisConfiguration.java.hbs
...{{packageName}}/util/config/MybatisConfiguration.java.hbs
+1
-1
{{apiDtos@DEFAULT}}.java.hbs
...{{packageName}}/{{apis}}/dto/{{apiDtos@DEFAULT}}.java.hbs
+1
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/BootApplication.java.hbs
浏览文件 @
eac8730a
...
...
@@ -21,14 +21,14 @@ import org.springframework.beans.factory.annotation.Autowired;
@EnableDiscoveryClient
@Configuration
@EnableTransactionManagement
@EnableFeignClients(basePackages = {"
{{
packageName
}}
","cn.ibizlab.util
"})
@EnableFeignClients(basePackages = {"
cn.ibizlab.util","
{{
packageName
}}
"})
@SpringBootApplication(exclude = {
{{#
unless
system
.
enableMongo
}}
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
{{/
unless
}}
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
})
@ComponentScan(basePackages = {"
{{
packageName
}}
","cn.ibizlab.util
"}
@ComponentScan(basePackages = {"
cn.ibizlab.util","
{{
packageName
}}
"}
// ,excludeFilters = {
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX, pattern="
{{
packageName
}}
.xxx.rest.xxx"),
// }
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/client/{{entities@ServiceAPI}}FeignClient.java.hbs
浏览文件 @
eac8730a
package
{{
packageName
}}
.core.
{{
entity
.
module
}}
.
service.impl
;
package
{{
packageName
}}
.core.
{{
entity
.
module
}}
.
client
;
import java.io.Serializable;
import java.util.ArrayList;
...
...
@@ -41,25 +41,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* 实体[
{{
entity
.
logicName
}}
] 服务对象接口实现
*/
@Slf4j
@Service("
{{
entity
.
codeName
}}
Service")
public class
{{
entity
.
codeName
}}
FeignClient implements
{{
entity
.
codeName
}}
Service {
public interface
{{
entity
.
codeName
}}
FeignClient {
default
{{
entity
.
codeName
}}
get(
{{
entity
.
codeName
}}
et){
return get(et.get
{{
pascalCase
entity
.
keyField
.
codeName
}}
());
}
@RequestMapping(method = RequestMethod.GET, value = "/
{{
pluralize
entity
.
codeName
}}
/{key}")
{{
entity
.
codeName
}}
get(
{{
entity
.
keyField
.
type
.
java
}}
key) {
{{
entity
.
codeName
}}
et = new
{{
entity
.
codeName
}}
();
et.set
{{
pascalCase
entity
.
keyField
.
codeName
}}
(key);
return get(et);
}
{{
entity
.
codeName
}}
get(
{{
entity
.
keyField
.
type
.
java
}}
key);
default List
<
{{
entity
.
codeName
}}
>
getByIds(Collection
<
{{
entity
.
keyField
.
type
.
java
}}
>
ids) {
List
<
{{
entity
.
codeName
}}
>
entities =new ArrayList();
ids.forEach(key -> {
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
浏览文件 @
eac8730a
...
...
@@ -91,19 +91,6 @@ public class {{entity.codeName}} extends EntityBase implements Serializable
{{#
each
entity
.
fields
}}
{{#
unless
deepStructure
}}
{{#
timeType
}}
/**
* 格式化日期 [
{{
logicName
}}
]
*/
public String format
{{
pascalCase
codeName
}}
() {
if (this.
{{
camelCase
codeName
}}
== null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("
{{
format
}}
");
return sdf.format(
{{
camelCase
codeName
}}
);
}
{{/
timeType
}}
{{/
unless
}}
{{/
each
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@SQL}}.java.hbs
浏览文件 @
eac8730a
...
...
@@ -118,10 +118,9 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
/**
* 设置 [
{{
logicName
}}
]
*/
public
{{
entity
.
codeName
}}
set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
public
void
set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
name
}}
",
{{
camelCase
codeName
}}
);
return this;
}
{{/
unless
}}
{{/
unless
}}
...
...
@@ -134,10 +133,9 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
/**
* 设置 [
{{
entityLogicName
}}
]
*/
public
{{
entity
.
codeName
}}
set
{{
pascalCase
codeName
}}
(List
<
{{
entityCodeName
}}
>
{{
camelCase
codeName
}}
) {
public
void
set
{{
pascalCase
codeName
}}
(List
<
{{
entityCodeName
}}
>
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
columnName
}}
", (
{{
camelCase
codeName
}}
!=null)?
{{
camelCase
codeName
}}
:(new ArrayList()));
return this;
}
{{/
columnName
}}
...
...
@@ -156,7 +154,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
/**
* 设置 [
{{
logicName
}}
]
*/
public
{{
entity
.
codeName
}}
set
{{
pascalCase
entity
.
keyField
.
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
{{
camelCase
entity
.
keyField
.
codeName
}}
) {
public
void
set
{{
pascalCase
entity
.
keyField
.
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
{{
camelCase
entity
.
keyField
.
codeName
}}
) {
this.
{{
camelCase
entity
.
keyField
.
codeName
}}
=
{{
camelCase
entity
.
keyField
.
codeName
}}
;
if(!ObjectUtils.isEmpty(
{{
camelCase
entity
.
keyField
.
codeName
}}
)) {
String [] args=
{{
camelCase
entity
.
keyField
.
codeName
}}
.split("\\|\\|");
...
...
@@ -164,7 +162,6 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
this.set("
{{
camelCase
codeName
}}
", args[
{{
@index
}}
]);
{{/
each
}}
}
return this;
}
public
{{
entity
.
keyField
.
type
.
java
}}
get
{{
pascalCase
entity
.
keyField
.
codeName
}}
() {
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@ServiceAPI}}.java.hbs
浏览文件 @
eac8730a
...
...
@@ -96,10 +96,9 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
/**
* 设置 [
{{
logicName
}}
]
*/
public
{{
entity
.
codeName
}}
set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
public
void
set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
codeName
}}
",
{{
camelCase
codeName
}}
);
return this;
}
{{/
unless
}}
{{/
unless
}}
...
...
@@ -112,10 +111,9 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
/**
* 设置 [
{{
entityLogicName
}}
]
*/
public
{{
entity
.
codeName
}}
set
{{
pascalCase
codeName
}}
(List
<
{{
entityCodeName
}}
>
{{
camelCase
codeName
}}
) {
public
void
set
{{
pascalCase
codeName
}}
(List
<
{{
entityCodeName
}}
>
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
listCode
}}
", (
{{
camelCase
codeName
}}
!=null)?
{{
camelCase
codeName
}}
:(new ArrayList()));
return this;
}
{{/if}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/service/impl/{{entities@SQL}}ServiceBase.java.hbs
浏览文件 @
eac8730a
...
...
@@ -59,7 +59,7 @@ import {{packageName}}.core.{{module}}.service.{{codeName}}Service;
@Service("
{{
entity
.
codeName
}}
Service")
public class
{{
entity
.
codeName
}}
ServiceBase extends ServiceImpl
<
{{
entity
.
codeName
}}
Mapper
,
{{
entity
.
codeName
}}
>
implements
{{
entity
.
codeName
}}
Service {
protected
{{
entity
.
codeName
}}
Service get
ProxyService
() {
protected
{{
entity
.
codeName
}}
Service get
Self
() {
return SpringContextHolder.getBean(this.getClass());
}
...
...
@@ -169,9 +169,9 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
{{#if
(
or
entity
.
actions
.
create
.
psDEActionLogics
entity
.
isIndexSubDE
)
}}
for (
{{
entity
.
codeName
}}
et : list) {
{{#if
entity
.
unionKeyMode
}}
get
ProxyService
().save(et);
get
Self
().save(et);
{{else}}
get
ProxyService
().create(et);
get
Self
().create(et);
{{/if}}
}
{{else}}
...
...
@@ -228,7 +228,7 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
public boolean updateBatch(List
<
{{
entity
.
codeName
}}
>
list) {
{{#if
(
or
entity
.
actions
.
update
.
psDEActionLogics
entity
.
isIndexSubDE
(
not
entity
.
keyField
.
phisicalDEField
))
}}
for (
{{
entity
.
codeName
}}
et : list) {
get
ProxyService
().update(et);
get
Self
().update(et);
}
{{else}}
{{#
entity
.
hasReferences
}}
...
...
@@ -245,9 +245,9 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
{{#
eq
entity
.
actions
.
save
.
transactionMode
"GLOBAL"
}}
@GlobalTransactional
{{/
eq
}}{{#
eq
entity
.
actions
.
save
.
transactionMode
"DEFAULT"
}}
@Transactional
{{/
eq
}}
public boolean save(
{{
entity
.
codeName
}}
et) {
if(checkKey(et)==0)
return get
ProxyService
().update(et);
return get
Self
().update(et);
else
return get
ProxyService
().create(et);
return get
Self
().create(et);
}
{{#
eq
entity
.
actions
.
save
.
transactionMode
"GLOBAL"
}}
@GlobalTransactional
{{/
eq
}}{{#
eq
entity
.
actions
.
save
.
transactionMode
"DEFAULT"
}}
@Transactional
{{/
eq
}}
...
...
@@ -269,9 +269,9 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
_create.add(et);
});
List rtList=new ArrayList
<>
();
if(_update.size()>0
&&
(!get
ProxyService
().updateBatch(_update)))
if(_update.size()>0
&&
(!get
Self
().updateBatch(_update)))
return false;
if(_create.size()>0
&&
(!get
ProxyService
().createBatch(_create)))
if(_create.size()>0
&&
(!get
Self
().createBatch(_create)))
return false;
return true;
}
...
...
@@ -320,7 +320,7 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
public boolean removeBatch(Collection
<
{{
entity
.
keyField
.
type
.
java
}}
>
ids) {
{{#if
(
or
entity
.
actions
.
update
.
psDEActionLogics
entity
.
isIndexSubDE
(
not
entity
.
keyField
.
phisicalDEField
)
entity
.
hasPSDERsMapping
)
}}
for (
{{
entity
.
keyField
.
type
.
java
}}
et : ids)
get
ProxyService
().remove(et);
get
Self
().remove(et);
{{else}}
if(!removeByIds(ids))
return false;
...
...
@@ -390,11 +390,11 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
else
_create.add(sub);
}
if(_update.size()>0
&&
(!get
ProxyService
().updateBatch(_update)))
if(_update.size()>0
&&
(!get
Self
().updateBatch(_update)))
return false;
if(_create.size()>0
&&
(!get
ProxyService
().createBatch(_create)))
if(_create.size()>0
&&
(!get
Self
().createBatch(_create)))
return false;
if(delIds.size()>0
&&
(!get
ProxyService
().removeBatch(delIds)))
if(delIds.size()>0
&&
(!get
Self
().removeBatch(delIds)))
return false;
return true;
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/service/impl/{{entities@ServiceAPI}}ServiceBase.java.hbs
浏览文件 @
eac8730a
...
...
@@ -50,7 +50,9 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
@Service("
{{
entity
.
codeName
}}
Service")
public class
{{
entity
.
codeName
}}
ServiceBase implements
{{
entity
.
codeName
}}
Service {
protected
{{
entity
.
codeName
}}
Service
{{
camelCase
entity
.
codeName
}}
Service = SpringContextHolder.getBean(this.getClass());
protected
{{
entity
.
codeName
}}
Service getSelf() {
return SpringContextHolder.getBean(this.getClass());
}
{{#
entity
.
relEntities
}}
{{#
neq
storage
"NONE"
}}
...
...
@@ -120,9 +122,9 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic
{{#
eq
entity
.
actions
.
save
.
transactionMode
"GLOBAL"
}}
@GlobalTransactional
{{/
eq
}}{{#
eq
entity
.
actions
.
save
.
transactionMode
"DEFAULT"
}}
@Transactional
{{/
eq
}}
public boolean save(
{{
entity
.
codeName
}}
et) {
if(checkKey(et)==0)
return
{{
camelCase
entity
.
codeName
}}
Service
.update(et);
return
getSelf()
.update(et);
else
return
{{
camelCase
entity
.
codeName
}}
Service
.create(et);
return
getSelf()
.create(et);
}
{{#
eq
entity
.
actions
.
save
.
transactionMode
"GLOBAL"
}}
@GlobalTransactional
{{/
eq
}}{{#
eq
entity
.
actions
.
save
.
transactionMode
"DEFAULT"
}}
@Transactional
{{/
eq
}}
...
...
@@ -144,9 +146,9 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic
_create.add(et);
});
List rtList=new ArrayList
<>
();
if(_update.size()>0
&&
(!
{{
camelCase
entity
.
codeName
}}
Service
.updateBatch(_update)))
if(_update.size()>0
&&
(!
getSelf()
.updateBatch(_update)))
return false;
if(_create.size()>0
&&
(!
{{
camelCase
entity
.
codeName
}}
Service
.createBatch(_create)))
if(_create.size()>0
&&
(!
getSelf()
.createBatch(_create)))
return false;
return true;
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/util/config/MybatisConfiguration.java.hbs
浏览文件 @
eac8730a
...
...
@@ -26,7 +26,7 @@ import java.util.List;
* mybatis全局配置类
*/
@Configuration
@MapperScan(value=
"
{{
packageName
}}
.core.*.mapper"
,nameGenerator = UniqueNameGenerator.class)
@MapperScan(value=
{"cn.ibizlab.util.mapper","
{{
packageName
}}
.core.*.mapper"}
,nameGenerator = UniqueNameGenerator.class)
public class MybatisConfiguration {
{{#
eq
system
.
saaSMode
4
}}
@Autowired
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/{{apis}}/dto/{{apiDtos@DEFAULT}}.java.hbs
浏览文件 @
eac8730a
...
...
@@ -59,10 +59,9 @@ public class {{apiDto.codeName}} extends {{#eq apiDto.apiEntity.entity.psSubSysS
/**
* 设置 [
{{
logicName
}}
]
*/
public
{{
apiDto
.
codeName
}}
set
{{
pascalCase
codeName
}}
(
{{
javaType
}}
{{
camelCase
codeName
}}
) {
public
void
set
{{
pascalCase
codeName
}}
(
{{
javaType
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
name
}}
",
{{
camelCase
codeName
}}
);
return this;
}
{{/
unless
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录