Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
09c27d79
提交
09c27d79
编写于
8月 19, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minicode
上级
1dee2fcb
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
67 行增加
和
39 行删除
+67
-39
VoFieldModel.java
.../src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
+52
-25
{{pascalCase ctrls@FORM}}AddDto.java.hbs
...se appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
+1
-1
{{pascalCase ctrls@FORM}}BaseDto.java.hbs
...e appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
+1
-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
+1
-1
DictResource.java.hbs
...a/{{packageName}}/api/{{apps}}/dict/DictResource.java.hbs
+6
-1
{{pascalCase appEntities}}Resource.java.hbs
...{{apps}}/rest/{{pascalCase appEntities}}Resource.java.hbs
+2
-0
{{entities@NoSQL}}Service.java.hbs
...}}/{{modules}}/service/{{entities@NoSQL}}Service.java.hbs
+1
-3
{{entities@SQL}}Service.java.hbs
...me}}/{{modules}}/service/{{entities@SQL}}Service.java.hbs
+1
-3
{{entities@ServiceAPI}}Service.java.hbs
...modules}}/service/{{entities@ServiceAPI}}Service.java.hbs
+1
-3
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
浏览文件 @
09c27d79
...
...
@@ -7,10 +7,7 @@ import lombok.Setter;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.app.dataentity.IPSAppDEField
;
import
net.ibizsys.model.control.IPSEditor
;
import
net.ibizsys.model.control.editor.IPSCheckBoxList
;
import
net.ibizsys.model.control.editor.IPSCodeListEditor
;
import
net.ibizsys.model.control.editor.IPSFileUploader
;
import
net.ibizsys.model.control.editor.IPSMDropDownList
;
import
net.ibizsys.model.control.editor.*
;
import
net.ibizsys.model.control.form.IPSDEFDCatGroupLogic
;
import
net.ibizsys.model.control.form.IPSDEForm
;
import
net.ibizsys.model.control.form.IPSDEFormItem
;
...
...
@@ -60,8 +57,19 @@ public class VoFieldModel extends BaseModel {
}
public
PropType
getType
()
{
type
=
PropType
.
findType
(
this
.
getPSDEFormItem
().
getDataType
());
if
(
type
==
null
)
{
type
=
PropType
.
findType
(
this
.
getPSDEFormItem
().
getDataType
());
if
(
type
.
equals
(
PropType
.
VARCHAR
)&&
this
.
getPSEditor
()!=
null
&&
this
.
getPSEditor
()
instanceof
IPSDatePicker
)
{
IPSDatePicker
datePicker
=(
IPSDatePicker
)
this
.
getPSEditor
();
if
(
"YYYY-MM-DD"
.
equalsIgnoreCase
(
datePicker
.
getDateTimeFormat
()))
type
=
PropType
.
DATE
;
else
if
(!
StringUtils
.
isEmpty
(
datePicker
.
getDateTimeFormat
())
&&
datePicker
.
getDateTimeFormat
().
toUpperCase
().
startsWith
(
"HH"
))
type
=
PropType
.
TIME
;
else
type
=
PropType
.
DATETIME
;
}
}
return
type
;
}
...
...
@@ -174,21 +182,26 @@ public class VoFieldModel extends BaseModel {
}
public
String
getFormat
(){
if
(
"Timestamp"
.
equals
(
getType
().
getJava
())
)
if
(
format
==
null
)
{
if
(
this
.
getPSDEFormItem
().
getDataType
()==
PropType
.
DATE
.
getCode
()||
"%1$tY-%1$tm-%1$td"
.
equalsIgnoreCase
(
this
.
getPSDEFormItem
().
getValueFormat
())){
timeType
=
"DATE"
;
format
=
"yyyy-MM-dd"
;
}
else
if
(
this
.
getPSDEFormItem
().
getDataType
()==
PropType
.
TIME
.
getCode
()||
"%1$tH:%1$tM:%1$tS"
.
equalsIgnoreCase
(
this
.
getPSDEFormItem
().
getValueFormat
())){
timeType
=
"TIME"
;
format
=
"HH:mm:ss"
;
}
else
{
timeType
=
"DATETIME"
;
format
=
"yyyy-MM-dd HH:mm:ss"
;
format
=
""
;
if
(
"Timestamp"
.
equals
(
getType
().
getJava
()))
{
if
(
this
.
getPSDEFormItem
().
getDataType
()==
PropType
.
DATE
.
getCode
()||
"%1$tY-%1$tm-%1$td"
.
equalsIgnoreCase
(
this
.
getPSDEFormItem
().
getValueFormat
())||
type
.
equals
(
PropType
.
DATE
)){
timeType
=
"DATE"
;
format
=
"yyyy-MM-dd"
;
}
else
if
(
this
.
getPSDEFormItem
().
getDataType
()==
PropType
.
TIME
.
getCode
()||
"%1$tH:%1$tM:%1$tS"
.
equalsIgnoreCase
(
this
.
getPSDEFormItem
().
getValueFormat
())||
type
.
equals
(
PropType
.
TIME
)){
timeType
=
"TIME"
;
format
=
"HH:mm:ss"
;
}
else
{
timeType
=
"DATETIME"
;
format
=
"yyyy-MM-dd HH:mm:ss"
;
}
}
}
return
format
;
}
...
...
@@ -262,16 +275,30 @@ public class VoFieldModel extends BaseModel {
public
String
getExample
()
{
if
(
example
==
null
)
{
example
=
""
;
}
if
(
this
.
getDict
()
!=
null
&&
!
ObjectUtils
.
isEmpty
(
this
.
getDict
().
getOptions
()))
{
example
=
this
.
getDict
().
getOptions
().
get
(
0
).
getValue
().
toString
();
if
(!
this
.
isSingleSelect
()&&
this
.
getDict
().
getOptions
().
size
()>
1
)
String
dv
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
getPSDEFormItem
().
getCreateDV
()))
{
if
(
ObjectUtils
.
isEmpty
(
this
.
getPSDEFormItem
().
getCreateDVT
()))
dv
=
this
.
getPSDEFormItem
().
getCreateDV
();
}
if
(
ObjectUtils
.
isEmpty
(
dv
))
{
if
(!
ObjectUtils
.
isEmpty
(
this
.
getPSDEFormItem
().
getUpdateDV
()))
{
if
(
ObjectUtils
.
isEmpty
(
this
.
getPSDEFormItem
().
getUpdateDVT
()))
dv
=
this
.
getPSDEFormItem
().
getUpdateDV
();
}
}
if
(!
StringUtils
.
isEmpty
(
dv
))
example
=
dv
.
replace
(
"\""
,
""
);
else
if
(
this
.
getDict
()
!=
null
&&
!
ObjectUtils
.
isEmpty
(
this
.
getDict
().
getOptions
()))
{
example
+=
this
.
getDict
().
getCodeList
().
getValueSeparator
()==
null
?
";"
:
this
.
getDict
().
getCodeList
().
getValueSeparator
();
example
+=
this
.
getDict
().
getOptions
().
get
(
1
).
getValue
().
toString
();
example
=
this
.
getDict
().
getOptions
().
get
(
0
).
getValue
().
toString
();
if
(!
this
.
isSingleSelect
()&&
this
.
getDict
().
getOptions
().
size
()>
1
)
{
example
+=
this
.
getDict
().
getCodeList
().
getValueSeparator
()==
null
?
";"
:
this
.
getDict
().
getCodeList
().
getValueSeparator
();
example
+=
this
.
getDict
().
getOptions
().
get
(
1
).
getValue
().
toString
();
}
}
}
return
example
;
}
...
...
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
浏览文件 @
09c27d79
...
...
@@ -52,7 +52,7 @@ public class {{pascalCase ctrl.codeName}}AddDto extends {{pascalCase ctrl.codeNa
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
dict
}}
,
【字典:
{{
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
}}{{#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
浏览文件 @
09c27d79
...
...
@@ -52,7 +52,7 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
dict
}}
,
【字典:
{{
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
}}{{#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
}}
;
{{/
unless
}}
...
...
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
浏览文件 @
09c27d79
...
...
@@ -52,7 +52,7 @@ public class {{pascalCase ctrl.codeName}}Dto extends {{pascalCase ctrl.codeName}
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
dict
}}
,【字典:
{{
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
}}{{#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
浏览文件 @
09c27d79
...
...
@@ -52,7 +52,7 @@ public class {{pascalCase ctrl.codeName}}UpdateDto extends {{pascalCase ctrl.cod
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
@ApiModelProperty(value = "
{{
logicName
}}{{#if
dict
}}
,
【字典:
{{
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
}}{{#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}}/
res
t/DictResource.java.hbs
→
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/
dic
t/DictResource.java.hbs
浏览文件 @
09c27d79
{{#
eq
apps
"link"
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.
res
t;
package
{{
packageName
}}
.api.
{{
apps
}}
.
dic
t;
import java.sql.Timestamp;
import java.util.ArrayList;
...
...
@@ -29,12 +29,17 @@ import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.edge.api.link.annotation.G1;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
@Slf4j
@Api(tags = {"数据字典" })
@RestController("
{{
lowerCase
app
.
codeName
}}
-DictResource")
@RequestMapping("/
{{
lowerCase
app
.
codeName
}}
/dict")
@G1
@ApiSupport(order = 99)
public class DictResource {
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/rest/{{pascalCase appEntities}}Resource.java.hbs
浏览文件 @
09c27d79
{{#
eq
apps
"link"
}}
{{#if
appEntity
.
forms
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.rest;
import java.sql.Timestamp;
...
...
@@ -55,4 +56,5 @@ public class {{pascalCase appEntity.codeName}}Resource {
}
{{/if}}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizboot/src/main/resources/templ/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@NoSQL}}Service.java.hbs
浏览文件 @
09c27d79
...
...
@@ -78,9 +78,7 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
default boolean onRemove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
List keys=new ArrayList();
keys.add(key);
return IBaseService.super.onRemove(keys);
return IBaseService.super.onRemove(key);
}
{{#
enableEntityCache
}}
...
...
modules/ibizlab-template/ibizlab-template-ibizboot/src/main/resources/templ/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@SQL}}Service.java.hbs
浏览文件 @
09c27d79
...
...
@@ -79,9 +79,7 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
default boolean onRemove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
List keys=new ArrayList();
keys.add(key);
return IMPService.super.onRemove(keys);
return IMPService.super.onRemove(key);
}
{{#
enableEntityCache
}}
...
...
modules/ibizlab-template/ibizlab-template-ibizboot/src/main/resources/templ/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@ServiceAPI}}Service.java.hbs
浏览文件 @
09c27d79
...
...
@@ -78,9 +78,7 @@ public interface {{entity.codeName}}Service extends IServiceApiService<{{entity.
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
default boolean onRemove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
List keys=new ArrayList();
keys.add(key);
return IServiceApiService.super.onRemove(keys);
return IServiceApiService.super.onRemove(key);
}
{{#
enableEntityCache
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录