Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
64e78604
Commit
64e78604
authored
Apr 28, 2018
by
scwang18
Browse files
1、支持逻辑删除,数据库建表的时候,要包括 deleteFlag的int字段
parent
fb395113
Changes
8
Show whitespace changes
Inline
Side-by-side
admin-core/src/main/java/com/ibeetl/admin/core/service/CoreCodeGenService.java
View file @
64e78604
...
...
@@ -131,7 +131,7 @@ public class CoreCodeGenService {
displayName
=
comment
.
substring
(
0
,
index
);
attr
.
setDisplayName
(
displayName
);
}
else
{
attr
.
setDisplayName
(
attr
.
getName
()
);
attr
.
setDisplayName
(
comment
);
}
}
...
...
admin-core/src/main/resources/codeTemplate/html/add.html
View file @
64e78604
...
...
@@ -12,7 +12,9 @@
<div
class=
"layui-form-item"
>
@for(item in array){
@if(item==null){continue;}
@if(item.name=="delFlag"){continue;}
@if(item.name=="version"){continue;}
@if(item.name=="attachmentId"){continue;}
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
${item.displayName}
</label>
<div
class=
"layui-input-inline"
>
...
...
@@ -24,7 +26,6 @@
@}
</div>
</div>
@}
</div>
</div>
...
...
admin-core/src/main/resources/codeTemplate/html/edit.html
View file @
64e78604
...
...
@@ -12,6 +12,9 @@
<div
class=
"layui-form-item"
>
@for(item in array){
@if(item==null){continue;}
@if(item.name=="delFlag"){continue;}
@if(item.name=="version"){continue;}
@if(item.name=="attachmentId"){continue;}
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
${item.displayName}
</label>
<div
class=
"layui-input-inline"
>
...
...
@@ -27,12 +30,18 @@
</div>
</div>
@}
@if(entity.attachment){
<div
class=
"layui-row"
>
<layui:attachment
name=
"attachmentId"
batchFileUUID=
"\${${entity.code}.attachmentId}"
isNew=
"false"
bizId=
"\${${entity.code}.${entity.idAttribute.name}}"
bizType=
"${entity.name}"
/>
<layui:attachment
name=
"attachmentId"
batchFileUUID=
"\${${entity.code}.attachmentId
!uuid()
}"
isNew=
"false"
bizId=
"\${${entity.code}.${entity.idAttribute.name}}"
bizType=
"${entity.name}"
/>
</div>
@}
<!-- 业务对象须有hidden字段,保存delFlag和version字段-->
@for(item in list){
@if(item==null){continue;}
@if((item.name=="delFlag")||(item.name=="version")){
<input
type=
"hidden"
name=
"${item.name}"
value=
\${${entity.code}.${item.name}}
${
isNotEmpty
(
item.verifyList
)?('
lay-verify=
"'+verifyFormat(item.verifyList)+'"
')
:
''}
/>
@}
@}
<input
type=
"hidden"
name=
"${entity.idAttribute.name}"
value=
\${${entity.code}.${entity.idAttribute.name}}
${
isNotEmpty
(
item.verifyList
)?('
lay-verify=
"'+verifyFormat(item.verifyList)+'"
')
:
''}
/>
<layui:submitButtons
id=
"updateButton"
/>
</form>
...
...
admin-core/src/main/resources/codeTemplate/java/pojo.java
View file @
64e78604
...
...
@@ -17,6 +17,11 @@ import java.math.*;
import
com.ibeetl.admin.core.annotation.Dict
;
import
com.ibeetl.admin.core.entity.BaseEntity
;
import
org.beetl.sql.core.annotatoin.InsertIgnore
;
import
org.beetl.sql.core.annotatoin.Version
;
import
org.beetl.sql.core.annotatoin.LogicDelete
;
/*
* ${comment}
* gen by Spring Boot2 Admin ${date(),"yyyy-MM-dd"}
...
...
@@ -32,10 +37,20 @@ public class ${className} extends BaseEntity{
\
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
\
@AutoID
@
}
@if
(
isNotEmpty
(
attr
.
dictType
))
{
\
@Dict
(
type
=
"${attr.dictType}"
)
@
}
@if
(
attr
.
name
==
"delFlag"
)
{
/*逻辑删除标志*/
\
@InsertIgnore
\
@LogicDelete
(
value
=
1
)
@
}
@if
(
attr
.
name
==
"version"
)
{
/*乐观锁版本标志*/
\
@InsertIgnore
\
@Version
@
}
private
$
{
attr
.
type
}
$
{
attr
.
name
}
;
@
}
...
...
admin-core/src/main/resources/codeTemplate/js/index.js
View file @
64e78604
...
...
@@ -16,6 +16,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
$
{
entity
.
code
}
Table
=
table
.
render
({
elem
:
'
#${entity.code}Table
'
,
height
:
Lib
.
getTableHeight
(
1
),
cellMinWidth
:
100
,
method
:
'
post
'
,
url
:
Common
.
ctxPath
+
'
/${target.urlBase}/${entity.code}/list.json
'
// 数据接口
,
page
:
Lib
.
tablePage
// 开启分页
...
...
@@ -26,18 +27,22 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
fixed
:
'
left
'
,
},
@
for
(
attr
in
entity
.
list
){
@
if
(
attr
.
name
==
"
delFlag
"
){
continue
;}
@
if
(
attr
.
name
==
"
version
"
){
continue
;}
@
if
(
attr
.
name
==
"
attachmentId
"
){
continue
;}
{
field
:
'
${isEmpty(attr.dictType)?attr.name:(attr.name+"Text")}
'
,
$
{
isNotEmpty
(
attr
.
dictType
)?
"
//数据字典类型为
"
+
attr
.
dictType
}
title
:
'
${attr.displayName}
'
,
@
if
(
attrLP
.
first
){
fixed
:
'
left
'
,
width
:
60
,
@}
@
if
(
attr
.
javaType
==
"
date
"
){
templet
:
function
(
d
){
return
Common
.
getDate
(
d
.
$
{
attr
.
name
});
}
,
}
@}
width
:
100
}
$
{
!
attrLP
.
last
?
"
,
"
}
@}
...
...
admin-core/src/main/resources/codeTemplate/md/entity.md
View file @
64e78604
...
...
@@ -7,7 +7,7 @@ queryByCondition
t.*
\@}
from ${entity.tableName} t
where
1=1
where
del_flag=0
\@//数据权限,该sql语句功能点
and #function("${entity.code}.query")#
@for(attr in entity.list){
...
...
admin-core/src/main/resources/templates/common/tag/simpleDataSelect.tag.html
View file @
64e78604
...
...
@@ -10,14 +10,13 @@ if(has(readonly)){
var expected = value!"";
for(item in data){
if(item[attrId]==expected){
selectedD
ict
= item;
selectedD
ata
= item;
break;
}
}
-->
<input
type=
"text"
class=
"layui-input input-readonly"
value=
"${selectedData[attrName]}"
></input>
<input
type=
"hidden"
name=
"${name}"
value=
"${expected}"
></input>
<input
type=
"text"
class=
"layui-input input-readonly"
value=
"${selectedData[attrName]}"
></input>
<input
type=
"hidden"
name=
"${name}"
value=
"${expected}"
></input>
<!--#}else{ -->
<select
name=
"${name}"
${
has
(
id
)?("
id=
"+id):''}>
...
...
admin-core/src/main/resources/templates/core/codeGen/edit.html
View file @
64e78604
...
...
@@ -72,7 +72,7 @@
<label
class=
"layui-form-label"
>
系统包名
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"basePackage"
value=
"c
om.ibeetl.cms
"
class=
"layui-input"
>
value=
"c
n.wlyoa.dnjd
"
class=
"layui-input"
>
</div>
</div>
</div>
...
...
@@ -102,14 +102,14 @@
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
urlBase
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"urlBase"
value=
"
cms
"
class=
"layui-input"
>
<input
type=
"text"
name=
"urlBase"
value=
"
dnjd
"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
system
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"entity.system"
value=
"
cms
"
<input
type=
"text"
name=
"entity.system"
value=
"
dnjd
"
class=
"layui-input"
>
</div>
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment