Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
7c80a0b1
提交
7c80a0b1
编写于
9月 09, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改说明
上级
4f8b0159
变更
9
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
149 行增加
和
46 行删除
+149
-46
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+6
-1
VoFieldModel.java
.../src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
+18
-0
{{pascalCase ctrls@FORM}}AddDto.java.hbs
...se appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
+2
-2
{{pascalCase ctrls@FORM}}BaseDto.java.hbs
...e appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
+5
-2
{{pascalCase ctrls@FORM}}Dto.java.hbs
...lCase appEntities}}/{{pascalCase ctrls@FORM}}Dto.java.hbs
+5
-2
{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
...appEntities}}/{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
+2
-2
DictHtmlResource.java.hbs
...packageName}}/api/{{apps}}/dict/DictHtmlResource.java.hbs
+12
-0
DictService.java.hbs
...{{packageName}}/api/{{apps}}/service/DictService.java.hbs
+46
-0
{{entities@SQL}}ServiceBase.java.hbs
...dules}}/service/impl/{{entities@SQL}}ServiceBase.java.hbs
+53
-37
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
7c80a0b1
...
...
@@ -122,7 +122,8 @@ public class EntityModel extends BaseModel {
{
return
!
ObjectUtils
.
isEmpty
(
references
);
}
public
boolean
hasPhisicalLinkField
=
false
;
private
Map
<
String
,
RelationshipModel
>
refMaps
;
...
...
@@ -815,6 +816,10 @@ public class EntityModel extends BaseModel {
relationshipModel
.
setFkField
(
fieldModel
);
relationshipModel
.
setFkFieldCodeName
(
fieldModel
.
getCodeName
().
toString
());
}
else
if
(
defield
.
isPhisicalDEField
()||(!
StringUtils
.
isEmpty
(
defield
.
getUnionKeyValue
())))
{
hasPhisicalLinkField
=
true
;
}
}
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
浏览文件 @
7c80a0b1
...
...
@@ -325,5 +325,23 @@ public class VoFieldModel extends BaseModel {
return
example
;
}
private
String
columnName
;
public
String
getColumnName
()
{
if
(
columnName
==
null
)
{
columnName
=
""
;
if
(
getAppDEField
()!=
null
)
{
if
(
appDEField
.
isPhisicalDEField
())
columnName
=
"["
+
appDEField
.
getEntity
().
getTableName
()+
"."
+
appDEField
.
getColumnName
().
toUpperCase
()+
"]"
;
else
if
(
appDEField
.
getDataEntityField
().
getDEFType
()==
5
)
columnName
=
"[TYYW_KG_XFJSDJZJB."
+
appDEField
.
getColumnName
().
toUpperCase
()+
"]"
;
else
if
(!
ObjectUtils
.
isEmpty
(
appDEField
.
getRefFieldName
()))
{
columnName
=
"["
+
appDEField
.
getReference
().
getTableName
()+
"."
+
appDEField
.
getRefFieldName
().
toUpperCase
()+
"]"
;
}
}
}
return
columnName
;
}
}
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
浏览文件 @
7c80a0b1
...
...
@@ -51,11 +51,11 @@ 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 = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
@ApiModelProperty(value = "
{{
logicName
}}{{
columnName
}}{{
#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
protected
{{
javaType
}}
{{
camelCase
codeName
}}
{{#if
createDefaultValue
}}
=
{{
createDefaultValue
}}{{/if}}
;
{{/if}}
...
...
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
浏览文件 @
7c80a0b1
...
...
@@ -44,6 +44,9 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
/**
*
{{
logicName
}}
*/
{{#if
required
}}
{{#
eq
javaType
"String"
}}
@NotBlank
{{else}}
@NotNull
{{/
eq
}}
(message = "
{{
logicName
}}
[
{{
jsonName
}}
]不能为空")
{{/if}}
@JsonProperty("
{{
jsonName
}}
")
{{#
timeType
}}
@JsonFormat(pattern = "
{{
format
}}
", locale = "zh", timezone = "GMT+8")
...
...
@@ -52,11 +55,11 @@ 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 = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
@ApiModelProperty(value = "
{{
logicName
}}{{
columnName
}}{{
#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
protected
{{
javaType
}}
{{
camelCase
codeName
}}
;
{{#if
dictList
}}
public void set
{{
pascalCase
codeName
}}
(String
{{
camelCase
codeName
}}
) {
...
...
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
浏览文件 @
7c80a0b1
...
...
@@ -43,6 +43,9 @@ public class {{pascalCase ctrl.codeName}}Dto extends {{pascalCase ctrl.codeName}
/**
*
{{
logicName
}}
*/
{{#if
required
}}
{{#
eq
javaType
"String"
}}
@NotBlank
{{else}}
@NotNull
{{/
eq
}}
(message = "
{{
logicName
}}
[
{{
jsonName
}}
]不能为空")
{{/if}}
@JsonProperty("
{{
jsonName
}}
")
{{#
timeType
}}
@JsonFormat(pattern = "
{{
format
}}
", locale = "zh", timezone = "GMT+8")
...
...
@@ -51,11 +54,11 @@ 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 = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
@ApiModelProperty(value = "
{{
logicName
}}{{
columnName
}}{{
#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
protected
{{
javaType
}}
{{
camelCase
codeName
}}
;
{{/if}}
...
...
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
浏览文件 @
7c80a0b1
...
...
@@ -51,11 +51,11 @@ 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 = "
{{
lowerCase
n
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
@JSONField(name = "
{{
jsonN
ame
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
@ApiModelProperty(value = "
{{
logicName
}}{{
columnName
}}{{
#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
protected
{{
javaType
}}
{{
camelCase
codeName
}}
{{#if
updateDefaultValue
}}
=
{{
updateDefaultValue
}}{{/if}}
;
{{/if}}
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/dict/DictHtmlResource.java.hbs
浏览文件 @
7c80a0b1
{{#
eq
apps
"link"
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.dict;
import cn.ibizlab.edge.api.link.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
...
...
@@ -20,6 +22,16 @@ import java.util.List;
@ApiSupport(order = 99)
public class DictHtmlResource {
@Autowired
private DictService dictService;
@RequestMapping(method = RequestMethod.GET, value = "/sync")
public ResponseEntity
<String>
sync() {
dictService.syncDict();
return ResponseEntity.ok("同步完成");
}
private String html="
<html
lang=
\"en
\"
><head><meta
charset=
\"UTF-8
\"
><title></title>
" +
"
<style>table
.reference
,
table
.tecspec
{
table-layout
:
fixed
;
word-break
:
break-all
;
border-collapse
:
collapse
;
width
:
100%
%
;
margin
:
4px
}
table
.reference
.fa
{
font-size
:
24px
;}
table
.reference
td
:nth-child
(
odd
)
{
background-color
:
#f2f7f9
}
table
.reference
td
:nth-child
(
even
)
{
background-color
:
#fff
}
table
.reference
tr
.fixzebra
{
background-color
:
#f6f4f0
}
table
.reference
th
{
line-height
:
2em
;
min-width
:
24px
;
color
:
#fff
;
background-color
:
#555
;
border
:
1px
solid
#555
;
font-size
:
12px
;
padding
:
3px
;
vertical-align
:
top
;
text-align
:
left
}
table
.reference
td
{
line-height
:
2em
;
min-width
:
24px
;
border
:
1px
solid
#d4d4d4
;
padding
:
5px
;
padding-top
:
7px
;
padding-bottom
:
7px
;
font-size
:
12px
;
vertical-align
:
top
;
color
:
#606266
;}
.captr
{
height
:
0px
;
border
:
0px
;
margin
:
0px
;
padding
:
0px
}
" +
"
</style></header><body>
%s
<br/></body></html>
";
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/service/DictService.java.hbs
0 → 100644
浏览文件 @
7c80a0b1
{{#
eq
apps
"link"
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.service;
import cn.ibizlab.edge.core.common.domain.*;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import cn.ibizlab.edge.core.common.service.DictCatalogService;
@Slf4j
@Service("link-DictService")
public class DictService {
@Autowired
private DictCatalogService dictCatalogService;
public void syncDict() {
{{#
each
app
.
dicts
}}
{
DictCatalog dict=new DictCatalog();
dict.setCode("
{{
pascalCase
codeName
}}
Dict");
dict.setName("
{{
name
}}
");
dict.setId(dict.getCode());
List
<DictOption>
options=new ArrayList
<>
();
new
{{
pascalCase
codeName
}}
Dict().getAllItems().forEach(item->{
DictOption option=new DictOption();
option.setCatalog(dict);
option.setCatalogId(dict.getId());
option.setCatalogName(dict.getName());
option.setValue(item.getValue());
option.setLabel(item.getLabel());
option.setParent(item.getParent());
option.setShoworder(options.size()+1);
options.add(option);
});
dict.setOptions(options);
dictCatalogService.save(dict);
}
{{/
each
}}
}
}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/service/impl/{{entities@SQL}}ServiceBase.java.hbs
浏览文件 @
7c80a0b1
此差异已折叠。
点击以展开。
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录