Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
0cdb4735
提交
0cdb4735
编写于
8月 27, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
model
上级
9cb292f8
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
167 行增加
和
15 行删除
+167
-15
CtrlModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
+29
-8
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+5
-0
{{pascalCase ctrls@FORM}}AddDto.java.hbs
...se appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
+6
-1
{{pascalCase ctrls@FORM}}BaseDto.java.hbs
...e appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
+51
-1
{{pascalCase ctrls@FORM}}Dto.java.hbs
...lCase appEntities}}/{{pascalCase ctrls@FORM}}Dto.java.hbs
+1
-1
{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
...appEntities}}/{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
+6
-1
DictAllJsonResource.java.hbs
...kageName}}/api/{{apps}}/dict/DictAllJsonResource.java.hbs
+43
-0
DictAllResource.java.hbs
...{packageName}}/api/{{apps}}/dict/DictAllResource.java.hbs
+1
-2
DictResource.java.hbs
...a/{{packageName}}/api/{{apps}}/dict/DictResource.java.hbs
+1
-1
entities.json.hbs
...{{projectName}}-rest/src/main/resources/entities.json.hbs
+24
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
浏览文件 @
0cdb4735
...
...
@@ -313,28 +313,49 @@ public class CtrlModel extends BaseModel{
return
StringAdvUtils
.
pascalcase
(
getCodeName
());
}
private
List
<
VoFieldModel
>
voItem
s
;
private
Map
<
String
,
VoFieldModel
>
voItemSet
s
;
public
List
<
VoFieldModel
>
getVoItem
s
()
public
Map
<
String
,
VoFieldModel
>
getVoItemSet
s
()
{
if
(
voItems
==
null
&&
this
.
getControl
()
instanceof
IPSDEEditForm
)
if
(
voItem
Set
s
==
null
&&
this
.
getControl
()
instanceof
IPSDEEditForm
)
{
IPSDEEditForm
editForm
=(
IPSDEEditForm
)
this
.
getControl
();
if
(
editForm
.
getPSDEFormItems
()!=
null
)
{
voItem
s
=
new
ArrayList
<>();
voItem
Sets
=
new
LinkedHashMap
<>();
editForm
.
getPSDEFormPages
().
forEach
(
page
->{
loopItem
(
page
.
getPSDEFormDetails
()).
forEach
(
item
->{
VoFieldModel
field
=
new
VoFieldModel
(
this
,
item
);
field
.
setPosition
(
voItems
.
size
()+
1
);
voItem
s
.
add
(
field
);
field
.
setPosition
(
voItem
Set
s
.
size
()+
1
);
voItem
Sets
.
put
(
field
.
getName
().
toLowerCase
(),
field
);
});
});
if
(
appEntity
!=
null
&&
appEntity
.
getEntity
()!=
null
)
{
FieldModel
keyField
=
appEntity
.
getEntity
().
getKeyField
();
if
(!
voItemSets
.
containsKey
(
keyField
.
getCodeName
().
toLowerCase
()))
sysField
.
put
(
"key"
,
keyField
);
else
sysField
.
put
(
"key"
,
voItemSets
.
get
(
keyField
.
getCodeName
().
toLowerCase
()));
FieldModel
mainField
=
appEntity
.
getEntity
().
getMajorField
();
if
(
mainField
!=
null
&&
!
voItemSets
.
containsKey
(
mainField
.
getCodeName
().
toLowerCase
()))
sysField
.
put
(
"major"
,
mainField
);
else
if
(
voItemSets
.
containsKey
(
mainField
.
getCodeName
().
toLowerCase
()))
sysField
.
put
(
"major"
,
voItemSets
.
get
(
mainField
.
getCodeName
().
toLowerCase
()));
}
}
}
return
voItems
;
return
voItemSets
;
}
private
Map
<
String
,
BaseModel
>
sysField
=
new
LinkedHashMap
<>();
public
Collection
<
VoFieldModel
>
getVoItems
()
{
if
(
getVoItemSets
()!=
null
)
return
voItemSets
.
values
();
return
null
;
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
0cdb4735
...
...
@@ -221,6 +221,8 @@ public class EntityModel extends BaseModel {
private
FieldModel
orgField
;
private
FieldModel
majorField
;
public
FieldModel
getOrgField
()
{
if
(
fields
!=
null
&&
orgField
==
null
)
...
...
@@ -778,6 +780,9 @@ public class EntityModel extends BaseModel {
FieldModel
fieldModel
=
new
FieldModel
(
this
,
defield
);
if
(
defield
.
isMajorDEField
())
this
.
majorField
=
fieldModel
;
try
{
fieldModel
.
setDict
(
defield
.
getPSCodeList
()!=
null
?
defield
.
getPSCodeList
().
getCodeName
():
null
);
}
catch
(
Exception
ex
){}
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
浏览文件 @
0cdb4735
...
...
@@ -48,7 +48,7 @@ public class {{pascalCase ctrl.codeName}}AddDto extends {{pascalCase ctrl.codeNa
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
@@ -57,5 +57,10 @@ public class {{pascalCase ctrl.codeName}}AddDto extends {{pascalCase ctrl.codeNa
{{/if}}
{{/
each
}}
@Override
public String getSrfuf() {
return srfuf==null?"0":srfuf;
}
}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
浏览文件 @
0cdb4735
...
...
@@ -23,6 +23,7 @@ import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.ObjectUtils;
import cn.ibizlab.util.domain.*;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
...
...
@@ -48,7 +49,7 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
@@ -57,5 +58,54 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
{{/
unless
}}
{{/
each
}}
{{#if
ctrl
.
sysField
.
key
}}
{{#
or
ctrl
.
sysField
.
key
.
hidden
ctrl
.
sysField
.
key
.
entity
}}
@JsonProperty("
{{
ctrl
.
sysField
.
key
.
jsonName
}}
")
@JSONField(name = "
{{
lowerCase
ctrl
.
sysField
.
key
.
jsonName
}}
")
@ApiModelProperty(value = "
{{
ctrl
.
sysField
.
key
.
logicName
}}
", position =
{{#if
ctrl
.
sysField
.
key
.
position
}}{{
ctrl
.
sysField
.
key
.
position
}}{{else}}
9980
{{/if}}
)
protected
{{
ctrl
.
sysField
.
key
.
type
.
java
}}
{{
camelCase
ctrl
.
sysField
.
key
.
codeName
}}
;
{{/
or
}}
@ApiModelProperty(value = "系统数据主键", hidden = true)
protected
{{
ctrl
.
sysField
.
key
.
type
.
java
}}
srfkey;
public
{{
ctrl
.
sysField
.
key
.
type
.
java
}}
getSrfkey() {
return this.get
{{
pascalCase
ctrl
.
sysField
.
key
.
codeName
}}
();
}
public void setSrfkey(
{{
ctrl
.
sysField
.
key
.
type
.
java
}}
{{
camelCase
ctrl
.
sysField
.
key
.
codeName
}}
) {
this.srfkey =
{{
camelCase
ctrl
.
sysField
.
key
.
codeName
}}
;
if(!ObjectUtils.isEmpty(
{{
camelCase
ctrl
.
sysField
.
key
.
codeName
}}
))
this.set
{{
pascalCase
ctrl
.
sysField
.
key
.
codeName
}}
(
{{
camelCase
ctrl
.
sysField
.
key
.
codeName
}}
);
}
{{/if}}
{{#if
ctrl
.
sysField
.
major
}}
{{#
or
ctrl
.
sysField
.
major
.
hidden
ctrl
.
sysField
.
major
.
entity
}}
@JsonProperty("
{{
ctrl
.
sysField
.
major
.
jsonName
}}
")
@JSONField(name = "
{{
lowerCase
ctrl
.
sysField
.
major
.
jsonName
}}
")
@ApiModelProperty(value = "
{{
ctrl
.
sysField
.
major
.
logicName
}}
", position =
{{#if
ctrl
.
sysField
.
major
.
position
}}{{
ctrl
.
sysField
.
major
.
position
}}{{else}}
9981
{{/if}}
)
protected
{{
ctrl
.
sysField
.
major
.
type
.
java
}}
{{
camelCase
ctrl
.
sysField
.
major
.
codeName
}}
;
{{/
or
}}
@ApiModelProperty(value = "系统数据显示", hidden = true)
protected
{{
ctrl
.
sysField
.
major
.
type
.
java
}}
srfmajortext;
public
{{
ctrl
.
sysField
.
major
.
type
.
java
}}
getSrfmajortext() {
return this.get
{{
pascalCase
ctrl
.
sysField
.
major
.
codeName
}}
();
}
public void setSrfmajortext(
{{
ctrl
.
sysField
.
major
.
type
.
java
}}
{{
camelCase
ctrl
.
sysField
.
major
.
codeName
}}
) {
this.srfmajortext =
{{
camelCase
ctrl
.
sysField
.
major
.
codeName
}}
;
if(!ObjectUtils.isEmpty(
{{
camelCase
ctrl
.
sysField
.
major
.
codeName
}}
))
this.set
{{
pascalCase
ctrl
.
sysField
.
major
.
codeName
}}
(
{{
camelCase
ctrl
.
sysField
.
major
.
codeName
}}
);
}
{{/if}}
@JsonProperty("srfuf")
@JSONField(name = "srfuf")
@ApiModelProperty(value = "系统更新标志", hidden = true)
protected String srfuf;
}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}Dto.java.hbs
浏览文件 @
0cdb4735
...
...
@@ -48,7 +48,7 @@ public class {{pascalCase ctrl.codeName}}Dto extends {{pascalCase ctrl.codeName}
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
浏览文件 @
0cdb4735
...
...
@@ -48,7 +48,7 @@ public class {{pascalCase ctrl.codeName}}UpdateDto extends {{pascalCase ctrl.cod
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
@@ -57,5 +57,10 @@ public class {{pascalCase ctrl.codeName}}UpdateDto extends {{pascalCase ctrl.cod
{{/if}}
{{/
each
}}
@Override
public String getSrfuf() {
return srfuf==null?"1":srfuf;
}
}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/dict/DictAllJsonResource.java.hbs
0 → 100644
浏览文件 @
0cdb4735
{{#
eq
apps
"link"
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.dict;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.ibizlab.edge.api.link.annotation.G1;
import java.util.*;
@Slf4j
@Api(tags = {"数据字典" })
@RestController("link-DictAllJsonResource")
@RequestMapping("/link/dict")
@G1
@ApiSupport(order = 98)
public class DictAllJsonResource {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "全部字典", tags = {"数据字典" }, notes = "
<a
href=
\"/xftong/link/dict/all.html
\"
target=
\"_blank
\"
>
查看展示清单
</a>
<a
href=
\"/xftong/link/dict/all
\"
target=
\"_blank
\"
>
查看json
</a>
")
@RequestMapping(method = RequestMethod.GET, value = "/all")
public ResponseEntity
<Map
<
String
,
Object
>
> getDict() {
Map
<String
,
Object
>
all=new LinkedHashMap
<>
();
{{#
each
app
.
dicts
}}
{
Map
<String
,
Object
>
dict=new LinkedHashMap
<>
();
dict.put("code","
{{
pascalCase
codeName
}}
Dict");
dict.put("name","字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]");
dict.put("allItems",new
{{
pascalCase
codeName
}}
Dict().getAllItems());
all.put("
{{
pascalCase
codeName
}}
Dict",dict);
}
{{/
each
}}
return ResponseEntity.ok(all);
}
}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/dict/DictAllResource.java.hbs
浏览文件 @
0cdb4735
...
...
@@ -18,7 +18,6 @@ import java.util.List;
@Api(tags = {"数据字典" })
@RestController("link-DictAllResource")
@RequestMapping("/link/dict")
@G1
@ApiSupport(order = 98)
public class DictAllResource {
...
...
@@ -30,7 +29,7 @@ public class DictAllResource {
private String templateItem="
<tr><td>
%s
</td><td>
%s
</td><td>
%s
</td></tr>
";
@ApiOperationSupport(order = 1)
@ApiOperation(value = "全部字典", tags = {"数据字典" }, notes = "
<a
href=
\"/xftong/link/dict/all.html
\"
target=
\"_blank
\"
>
view
</a>
")
@ApiOperation(value = "全部字典", tags = {"数据字典" }, notes = "
<a
href=
\"/xftong/link/dict/all.html
\"
target=
\"_blank
\"
>
查看展示清单
</a>
<a
href=
\"/xftong/link/dict/all
\"
target=
\"_blank
\"
>
查看json
</a>
")
@RequestMapping(method = RequestMethod.GET, value = "/all.html")
public ResponseEntity
<String>
getDict() {
List
<String>
all=new ArrayList
<>
();
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/dict/DictResource.java.hbs
浏览文件 @
0cdb4735
...
...
@@ -44,7 +44,7 @@ public class DictResource {
{{#
each
app
.
dicts
}}
@ApiOperation(value = "字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]", tags = {"数据字典" }, notes = "字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]")
@ApiOperation(value = "字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]", tags = {"数据字典" }, notes = "字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]
<a
href=
\"/xftong/link/dict/
{{
pascalCase
codeName
}}
Dict
.
html
\"
target=
\"_blank
\"
>
查看展示清单
</a>
<a
href=
\"/xftong/link/dict/
{{
pascalCase
codeName
}}
Dict
\"
target=
\"_blank
\"
>
查看json
</a>
")
@RequestMapping(method = RequestMethod.GET, value = "/
{{
pascalCase
codeName
}}
Dict")
public ResponseEntity
<
{{
pascalCase
codeName
}}
Dict>
get
{{
pascalCase
codeName
}}
Dict() {
return ResponseEntity.ok(new
{{
pascalCase
codeName
}}
Dict());
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/resources/entities.json.hbs
0 → 100644
浏览文件 @
0cdb4735
{{#
each
system
.
apps
as
|
app
|
}}
{{#
eq
app
.
codeName
"link"
}}
{
{{#
each
app
.
appEntities
as
|
appEntity
|
}}
"
{{
appEntity
.
entity
.
codeName
}}
":
{
"codeName": "
{{
appEntity
.
entity
.
codeName
}}
",
"tableName": "
{{
appEntity
.
entity
.
tableName
}}
",
"keyField": "
{{
appEntity
.
entity
.
keyField
.
jsonName
}}
",
"references": [
{{#
each
appEntity
.
entity
.
references
}}
{{#
eq
entityCodeName
"TYYW_KG_XFJSDJ"
}}
{
"refTopic": "
{{
entityCodeName
}}
",
"keyField": "
{{
fkField
.
jsonName
}}
"
}
{{/
eq
}}
{{/
each
}}
]
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
}
{{/
eq
}}
{{/
each
}}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录