Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
44178267
提交
44178267
编写于
7月 01, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改模板自定义方法适配customCall参数
上级
8cf03901
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
120 行增加
和
92 行删除
+120
-92
ActionModel.java
...e/src/main/java/cn/ibizlab/codegen/model/ActionModel.java
+50
-0
{{entities@SQL}}.java.hbs
...ackageName}}/{{modules}}/domain/{{entities@SQL}}.java.hbs
+1
-1
{{entities@NoSQL}}Service.java.hbs
...}}/{{modules}}/service/{{entities@NoSQL}}Service.java.hbs
+23
-29
{{entities@SQL}}Service.java.hbs
...me}}/{{modules}}/service/{{entities@SQL}}Service.java.hbs
+23
-31
{{entities@ServiceAPI}}Service.java.hbs
...modules}}/service/{{entities@ServiceAPI}}Service.java.hbs
+23
-31
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ActionModel.java
浏览文件 @
44178267
...
...
@@ -40,6 +40,56 @@ public class ActionModel extends BaseModel{
return
codeName
.
toLowerCase
().
startsWith
(
"get"
);
}
public
String
getInParam
()
{
String
param
=
this
.
getEntity
().
getCodeName
();
if
(
getDEAction
().
getPSDEActionInput
()==
null
)
return
param
;
if
(
"KEYFIELD"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
this
.
getEntity
().
getKeyField
().
getType
().
java
;
else
if
(
"KEYFIELDS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"List<"
+
this
.
getEntity
().
getKeyField
().
getType
().
java
+
">"
;
return
param
;
}
public
String
getInParamName
()
{
String
param
=
"dto"
;
if
(
getDEAction
().
getPSDEActionInput
()==
null
)
return
param
;
if
(
"KEYFIELD"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"key"
;
else
if
(
"KEYFIELDS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"keys"
;
return
param
;
}
public
boolean
isVoidReturn
()
{
if
(
getDEAction
().
getPSDEActionReturn
()==
null
)
return
true
;
if
(!
"VOID"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
false
;
return
true
;
}
public
String
getOutParam
()
{
String
param
=
this
.
getEntity
().
getCodeName
();
if
(
getDEAction
().
getPSDEActionReturn
()==
null
)
return
param
;
if
(
"VOID"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
getInParam
();
if
(
"SIMPLE"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
param
=
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
;
else
if
(
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
param
=
"List<"
+
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
+
">"
;
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
param
=
"List<"
+
param
+
">"
;
return
param
;
}
public
Set
<
String
>
getLogics
()
{
Set
<
String
>
validLogic
=
new
HashSet
<>();
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities@SQL}}.java.hbs
浏览文件 @
44178267
...
...
@@ -56,7 +56,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{else}}
@TableField(value = "
{{
columnName
}}
"
{{#
insertOnly
}}
, fill = FieldFill.INSERT
{{/
insertOnly
}}{{^
phisicalDEField
}}
, exist = false
{{/
phisicalDEField
}}
)
{{#
logicValidField
}}
@TableLogic
{{#
validLogicValue
}}
(value = "
{{
validLogicValue
}}
"
{{#
invalidLogicValue
}}
, delval = "
{{
invalidLogicValue
}}
"
{{/
invalidLogicValue
}}
)
{{/
validLogicValue
}}
@TableLogic
{{#
entity
.
validLogicValue
}}
(value = "
{{
entity
.
validLogicValue
}}
"
{{#
entity
.
invalidLogicValue
}}
, delval = "
{{
entity
.
invalidLogicValue
}}
"
{{/
entity
.
invalidLogicValue
}}
)
{{/
entity
.
validLogicValue
}}
{{/
logicValidField
}}
{{/if}}
@JsonProperty("
{{
jsonName
}}
")
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@NoSQL}}Service.java.hbs
浏览文件 @
44178267
...
...
@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import java.math.BigDecimal;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
...
...
@@ -135,29 +136,26 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
}
{{#
each
entity
.
extActions
}}
{{#if
action
}}
default
{{
entity
.
codeName
}}
{{
camelCase
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
key) {
{{
entity
.
codeName
}}
dto = this.getRuntimeService().getDataEntityRuntime().executeAction("
{{
name
}}
", null, new Object[]{key}, true);
if(dto!=null)
afterAction("
{{
codeName
}}
",dto);
return dto;
}
default
{{
entity
.
codeName
}}
on
{{
pascalCase
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
key) {
return this.getDataEntityRuntimeContext().executeActionReal("
{{
name
}}
", null, new Object[]{key}, null);;
}
{{else}}
default boolean
{{
camelCase
codeName
}}
(
{{
entity
.
codeName
}}
dto) throws Throwable {
IBaseService.super.beforeAction("
{{
codeName
}}
",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("
{{
name
}}
", null, new Object[]{dto}, true);
IBaseService.super.afterAction("
{{
codeName
}}
",dto);
return true;
}
default boolean on
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
dto) throws Throwable {
this.getDataEntityRuntimeContext().executeActionReal("
{{
name
}}
", null, new Object[]{dto}, null);
return true;
default
{{
outParam
}}
{{
camelCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
IBaseService.super.callAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
{{else}}
IBaseService.super.beforeAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{
outParam
}}
rt = (
{{
outParam
}}
)IBaseService.super.forwardAction("
{{
name
}}
",
{{
inParamName
}}
);
if(rt!=null)
IBaseService.super.afterAction("
{{
codeName
}}
",rt);
return rt;
{{/if}}
}
default
{{
outParam
}}
on
{{
pascalCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
IBaseService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
{{else}}
return (
{{
outParam
}}
)IBaseService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{/if}}
}
{{/if}}
...
...
@@ -167,15 +165,11 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
{{#
entity
.
dataSets
}}
default Page
<
{{
entity
.
codeName
}}
>
fetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
IBaseService.super.beforeFetch("
{{
codeName
}}
",dto);
return (Page)
this.getRuntimeService().getDataEntityRuntime().fetchDataSet("
{{
name
}}
", dto.getDataSet(), new Object[]{dto}, true
);
return (Page)
IBaseService.super.forwardFetch("
{{
name
}}
",dto
);
}
default Page
<
{{
entity
.
codeName
}}
>
onFetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (Page) this.getDataEntityRuntimeContext().fetchDataSetReal("
{{
name
}}
", dto.getDataSet(), new Object[]{dto}, null);
}
default List
<
{{
entity
.
codeName
}}
>
select
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (List)this.getRuntimeService().getDataEntityRuntime().selectDataQuery("
{{
name
}}
", dto);
return (Page) IBaseService.super.onRealFetch("
{{
name
}}
",dto);
}
{{/
entity
.
dataSets
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@SQL}}Service.java.hbs
浏览文件 @
44178267
...
...
@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import java.math.BigDecimal;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
...
...
@@ -136,47 +137,38 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
}
{{#
each
entity
.
extActions
}}
{{#if
action
}}
default
{{
entity
.
codeName
}}
{{
camelCase
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
key) {
{{
entity
.
codeName
}}
dto = this.getRuntimeService().getDataEntityRuntime().executeAction("
{{
name
}}
", null, new Object[]{key}, true);
if(dto!=null)
afterAction("
{{
codeName
}}
",dto);
return dto;
default
{{
outParam
}}
{{
camelCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
IMPService.super.callAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
{{else}}
IMPService.super.beforeAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{
outParam
}}
rt = (
{{
outParam
}}
)IMPService.super.forwardAction("
{{
name
}}
",
{{
inParamName
}}
);
if(rt!=null)
IMPService.super.afterAction("
{{
codeName
}}
",rt);
return rt;
{{/if}}
}
default
{{
outParam
}}
on
{{
pascalCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
IMPService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
{{else}}
return (
{{
outParam
}}
)IMPService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{/if}}
}
default
{{
entity
.
codeName
}}
on
{{
pascalCase
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
key) {
return this.getDataEntityRuntimeContext().executeActionReal("
{{
name
}}
", null, new Object[]{key}, null);;
}
{{else}}
default boolean
{{
camelCase
codeName
}}
(
{{
entity
.
codeName
}}
dto) throws Throwable {
IMPService.super.beforeAction("
{{
codeName
}}
",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("
{{
name
}}
", null, new Object[]{dto}, true);
IMPService.super.afterAction("
{{
codeName
}}
",dto);
return true;
}
default boolean on
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
dto) throws Throwable {
this.getDataEntityRuntimeContext().executeActionReal("
{{
name
}}
", null, new Object[]{dto}, null);
return true;
}
{{/if}}
{{/
each
}}
{{#
entity
.
dataSets
}}
default Page
<
{{
entity
.
codeName
}}
>
fetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
IMPService.super.beforeFetch("
{{
codeName
}}
",dto);
return (Page)
this.getRuntimeService().getDataEntityRuntime().fetchDataSet("
{{
name
}}
", dto.getDataSet(), new Object[]{dto}, true
);
return (Page)
IMPService.super.forwardFetch("
{{
name
}}
",dto
);
}
default Page
<
{{
entity
.
codeName
}}
>
onFetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (Page) this.getDataEntityRuntimeContext().fetchDataSetReal("
{{
name
}}
", dto.getDataSet(), new Object[]{dto}, null);
}
default List
<
{{
entity
.
codeName
}}
>
select
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (List)this.getRuntimeService().getDataEntityRuntime().selectDataQuery("
{{
name
}}
", dto);
return (Page) IMPService.super.onRealFetch("
{{
name
}}
",dto);
}
{{/
entity
.
dataSets
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@ServiceAPI}}Service.java.hbs
浏览文件 @
44178267
...
...
@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import java.math.BigDecimal;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
...
...
@@ -135,47 +136,38 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
}
{{#
each
entity
.
extActions
}}
{{#if
action
}}
default
{{
entity
.
codeName
}}
{{
camelCase
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
key) {
{{
entity
.
codeName
}}
dto = this.getRuntimeService().getDataEntityRuntime().executeAction("
{{
name
}}
", null, new Object[]{key}, true);
if(dto!=null)
afterAction("
{{
codeName
}}
",dto);
return dto;
default
{{
outParam
}}
{{
camelCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
IBaseService.super.callAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
{{else}}
IBaseService.super.beforeAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{
outParam
}}
rt = (
{{
outParam
}}
)IBaseService.super.forwardAction("
{{
name
}}
",
{{
inParamName
}}
);
if(rt!=null)
IBaseService.super.afterAction("
{{
codeName
}}
",rt);
return rt;
{{/if}}
}
default
{{
outParam
}}
on
{{
pascalCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
IBaseService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
{{else}}
return (
{{
outParam
}}
)IBaseService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{/if}}
}
default
{{
entity
.
codeName
}}
on
{{
pascalCase
codeName
}}
(
{{
entity
.
keyField
.
type
.
java
}}
key) {
return this.getDataEntityRuntimeContext().executeActionReal("
{{
name
}}
", null, new Object[]{key}, null);;
}
{{else}}
default boolean
{{
camelCase
codeName
}}
(
{{
entity
.
codeName
}}
dto) throws Throwable {
IBaseService.super.beforeAction("
{{
codeName
}}
",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("
{{
name
}}
", null, new Object[]{dto}, true);
IBaseService.super.afterAction("
{{
codeName
}}
",dto);
return true;
}
default boolean on
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
dto) throws Throwable {
this.getDataEntityRuntimeContext().executeActionReal("
{{
name
}}
", null, new Object[]{dto}, null);
return true;
}
{{/if}}
{{/
each
}}
{{#
entity
.
dataSets
}}
default Page
<
{{
entity
.
codeName
}}
>
fetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
IBaseService.super.beforeFetch("
{{
codeName
}}
",dto);
return (Page)
this.getRuntimeService().getDataEntityRuntime().fetchDataSet("
{{
name
}}
", dto.getDataSet(), new Object[]{dto}, true
);
return (Page)
IBaseService.super.forwardFetch("
{{
name
}}
",dto
);
}
default Page
<
{{
entity
.
codeName
}}
>
onFetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (Page) this.getDataEntityRuntimeContext().fetchDataSetReal("
{{
name
}}
", dto.getDataSet(), new Object[]{dto}, null);
}
default List
<
{{
entity
.
codeName
}}
>
select
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (List)this.getRuntimeService().getDataEntityRuntime().selectDataQuery("
{{
name
}}
", dto);
return (Page) IBaseService.super.onRealFetch("
{{
name
}}
",dto);
}
{{/
entity
.
dataSets
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录