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
Eladmin
Commits
40852235
Commit
40852235
authored
Nov 24, 2019
by
dqjdda
Browse files
Merge branch '2.4dev' into 2.3opt
parents
4681ca6e
776cee4b
Changes
89
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
View file @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* @author Zheng Jie
...
...
@@ -18,9 +19,6 @@ public class JobQueryCriteria {
@Query
private
Boolean
isSuccess
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
View file @
40852235
...
...
@@ -42,6 +42,14 @@ public class DictController {
dictService
.
download
(
dictService
.
queryAll
(
criteria
),
response
);
}
@Log
(
"查询字典"
)
@ApiOperation
(
"查询字典"
)
@GetMapping
(
value
=
"/all"
)
@PreAuthorize
(
"@el.check('dict:list')"
)
public
ResponseEntity
all
(){
return
new
ResponseEntity
<>(
dictService
.
queryAll
(
new
DictQueryCriteria
()),
HttpStatus
.
OK
);
}
@Log
(
"查询字典"
)
@ApiOperation
(
"查询字典"
)
@GetMapping
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java
View file @
40852235
...
...
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.List
;
/**
* @author Zheng Jie
...
...
@@ -51,8 +52,7 @@ public class JobController {
@ApiOperation
(
"查询岗位"
)
@GetMapping
@PreAuthorize
(
"@el.check('job:list','user:list')"
)
public
ResponseEntity
getJobs
(
JobQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
getJobs
(
JobQueryCriteria
criteria
,
Pageable
pageable
){
// 数据权限
criteria
.
setDeptIds
(
dataScope
.
getDeptIds
());
return
new
ResponseEntity
<>(
jobService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
View file @
40852235
...
...
@@ -4,7 +4,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.config.DataScope
;
import
me.zhengjie.
modules.tools.
domain.VerificationCode
;
import
me.zhengjie.domain.VerificationCode
;
import
me.zhengjie.modules.system.domain.User
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.system.domain.vo.UserPassVo
;
...
...
@@ -12,7 +12,7 @@ import me.zhengjie.modules.system.service.DeptService;
import
me.zhengjie.modules.system.service.RoleService
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
me.zhengjie.modules.system.service.dto.UserQueryCriteria
;
import
me.zhengjie.
modules.tools.
service.VerificationCodeService
;
import
me.zhengjie.service.VerificationCodeService
;
import
me.zhengjie.utils.*
;
import
me.zhengjie.modules.system.service.UserService
;
import
org.springframework.data.domain.Pageable
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java
View file @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -25,9 +26,6 @@ public class DeptQueryCriteria{
@Query
private
Long
pid
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDTO.java
View file @
40852235
...
...
@@ -22,5 +22,7 @@ public class DictDetailDTO implements Serializable {
private
String
sort
;
private
DictSmallDTO
dict
;
private
Timestamp
createTime
;
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDTO.java
0 → 100644
View file @
40852235
package
me.zhengjie.modules.system.service.dto
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
/**
* @author Zheng Jie
* @date 2019-04-10
*/
@Getter
@Setter
public
class
DictSmallDTO
implements
Serializable
{
private
Long
id
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java
View file @
40852235
...
...
@@ -3,9 +3,8 @@ package me.zhengjie.modules.system.service.dto;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
me.zhengjie.annotation.Query
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -28,9 +27,6 @@ public class JobQueryCriteria {
@Query
(
propName
=
"id"
,
joinName
=
"dept"
,
type
=
Query
.
Type
.
IN
)
private
Set
<
Long
>
deptIds
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
View file @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* 公共查询类
...
...
@@ -15,9 +16,6 @@ public class MenuQueryCriteria {
@Query
(
blurry
=
"name,path,component"
)
private
String
blurry
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java
View file @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* 公共查询类
...
...
@@ -15,9 +16,6 @@ public class RoleQueryCriteria {
@Query
(
blurry
=
"name,remark"
)
private
String
blurry
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java
View file @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -28,9 +29,6 @@ public class UserQueryCriteria implements Serializable {
private
Long
deptId
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/DictDetailMapper.java
View file @
40852235
...
...
@@ -10,7 +10,7 @@ import org.mapstruct.ReportingPolicy;
* @author Zheng Jie
* @date 2019-04-10
*/
@Mapper
(
componentModel
=
"spring"
,
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
@Mapper
(
componentModel
=
"spring"
,
uses
=
{
DictSmallMapper
.
class
},
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
DictDetailMapper
extends
BaseMapper
<
DictDetailDTO
,
DictDetail
>
{
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/DictSmallMapper.java
0 → 100644
View file @
40852235
package
me.zhengjie.modules.system.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
import
me.zhengjie.modules.system.domain.Dict
;
import
me.zhengjie.modules.system.service.dto.DictDTO
;
import
me.zhengjie.modules.system.service.dto.DictSmallDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
/**
* @author Zheng Jie
* @date 2019-04-10
*/
@Mapper
(
componentModel
=
"spring"
,
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
DictSmallMapper
extends
BaseMapper
<
DictSmallDTO
,
Dict
>
{
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Controller.ftl
View file @
40852235
...
...
@@ -70,4 +70,13 @@ public class ${className}Controller {
$
{
changeClassName
}
S
ervice
.delete
(
$
{
pkChangeColName
})
;
return
new
R
esponseEntity
(
H
ttpStatus
.OK
)
;
}
@
L
og
(
"多选删除${className}"
)
@
A
piOperation
(
"多选删除${className}"
)
@
P
reAuthorize
(
"@el.check('${changeClassName}:del')"
)
@
D
eleteMapping
public
R
esponseEntity
deleteAll
(
@
R
equestBody
$
{
pkColumnType
}
[]
ids
)
{
$
{
changeClassName
}
S
ervice
.deleteAll
(
ids
)
;
return
new
R
esponseEntity
(
H
ttpStatus
.OK
)
;
}
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Dto.ftl
View file @
40852235
...
...
@@ -23,8 +23,8 @@ public class ${className}DTO implements Serializable {
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.
columnComment
!=
''>
//
$
{
column
.
columnComment
}
<#
if
column
.
remark
!=
''>
//
$
{
column
.
remark
}
</#
if
>
<#
if
column
.columnKey
=
'
PRI
'>
<#
if
!
auto
&&
pkColumnType
=
'
L
ong
'>
...
...
eladmin-system/src/main/resources/template/generator/admin/Entity.ftl
View file @
40852235
...
...
@@ -4,6 +4,14 @@ import lombok.Data;
import
cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.bean.copier.CopyOptions;
import
javax.persistence.
*
;
<#
if
isNotNullColumns??>
import
javax.validation.constraints.
*
;
</#
if
>
<#
if
hasDateAnnotation>
import
javax.persistence.Entity;
import
javax.persistence.Table;
import
org.hibernate.annotations.
*
;
</#
if
>
<#
if
hasTimestamp>
import
java.sql.Timestamp;
</#
if
>
...
...
@@ -23,8 +31,8 @@ public class ${className} implements Serializable {
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.
columnComment
!=
''>
//
$
{
column
.
columnComment
}
<#
if
column
.
remark
!=
''>
//
$
{
column
.
remark
}
</#
if
>
<#
if
column
.columnKey
=
'
PRI
'>
@
I
d
...
...
@@ -32,7 +40,21 @@ public class ${className} implements Serializable {
@
G
eneratedValue
(
strategy
=
G
enerationType
.IDENTITY
)
</#
if
>
</#
if
>
@
C
olumn
(
name
=
"${column.columnName}"
<#
if
column
.columnKey
=
'
UNI
'>
,
unique
=
true
</#
if
><#
if
column
.isNullable
=
'
NO
'
&&
column
.columnKey
!=
'
PRI
'>
,
nullable
=
false
</#
if
>
)
@
C
olumn
(
name
=
"${column.columnName}"
<#
if
column
.columnKey
=
'
UNI
'>
,
unique
=
true
</#
if
><#
if
column
.istNotNull
&&
column
.columnKey
!=
'
PRI
'>
,
nullable
=
false
</#
if
>
)
<#
if
column
.istNotNull
&&
column
.columnKey
!=
'
PRI
'>
<#
if
column
.columnType
=
'
S
tring
'>
@
N
otBlank
<#
else
>
@
N
otNull
</#
if
>
</#
if
>
<#
if
column
.dateAnnotation
??>
<#
if
column
.dateAnnotation
=
'
C
reationTimestamp
'>
@
C
reationTimestamp
<#
else
>
@
U
pdateTimestamp
</#
if
>
</#
if
>
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
list
>
</#
if
>
...
...
eladmin-system/src/main/resources/template/generator/admin/QueryCriteria.ftl
View file @
40852235
...
...
@@ -7,6 +7,9 @@ import java.sql.Timestamp;
<#
if
queryHasBigDecimal>
import
java.math.BigDecimal;
</#
if
>
<#
if
dateRanges??>
import
java.util.List;
</#
if
>
<#
if
queryColumns??>
import
me.zhengjie.annotation.Query;
</#
if
>
...
...
@@ -20,15 +23,37 @@ public class ${className}QueryCriteria{
<#
if
queryColumns
??>
<#
list
queryColumns
as
column
>
<#
if
column
.columnQuery
=
'
1
'>
//
模糊
@
Q
uery
(
type
=
Q
uery
.Type.INNER_LIKE
)
</#
if
>
<#
if
column
.columnQuery
=
'
2
'>
<#
if
column
.queryType
=
'='>
//
精确
@
Q
uery
</#
if
>
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
if
>
<#
if
column
.queryType
=
'
L
ike
'>
//
模糊
@
Q
uery
(
type
=
Q
uery
.Type.INNER_LIKE
)
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
if
>
<#
if
column
.queryType
=
'!='>
//
不等于
@
Q
uery
(
type
=
Q
uery
.Type.NOT_EQUAL
)
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
if
>
<#
if
column
.queryType
=
'>='>
//
大于等于
@
Q
uery
(
type
=
Q
uery
.Type.GREATER_THAN
)
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
if
>
<#
if
column
.queryType
=
'<='>
//
小于等于
@
Q
uery
(
type
=
Q
uery
.Type.LESS_THAN
)
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
if
>
</#
list
>
</#
if
>
<#
if
dateRanges
??>
<#
list
dateRanges
as
column
>
@
Q
uery
(
type
=
Q
uery
.Type.BETWEEN
)
private
L
ist
<$
{
column
.columnType
}
>
createTime
;
</#
list
>
</#
if
>
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Service.ftl
View file @
40852235
...
...
@@ -43,5 +43,7 @@ public interface ${className}Service {
void
delete
(
$
{
pkColumnType
}
$
{
pkChangeColName
})
;
void
deleteAll
(
$
{
pkColumnType
}
[]
ids
)
;
void
download
(
L
ist
<$
{
className
}
DTO
>
all
,
H
ttpServletResponse
response
)
throws
IOE
xception
;
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/ServiceImpl.ftl
View file @
40852235
...
...
@@ -133,6 +133,13 @@ public class ${className}ServiceImpl implements ${className}Service {
$
{
changeClassName
}
R
epository
.deleteById
(
$
{
pkChangeColName
})
;
}
@
O
verride
@
C
acheEvict
(
allEntries
=
true
)
public
void
deleteAll
(
$
{
pkColumnType
}
[]
ids
)
{
for
(
$
{
pkColumnType
}
id
:
ids
)
{
$
{
changeClassName
}
R
epository
.deleteById
(
$
{
pkChangeColName
})
;
}
}
@
O
verride
public
void
download
(
L
ist
<$
{
className
}
DTO
>
all
,
H
ttpServletResponse
response
)
throws
IOE
xception
{
...
...
@@ -141,8 +148,8 @@ public class ${className}ServiceImpl implements ${className}Service {
M
ap
<
S
tring
,
O
bject
>
map
=
new
L
inkedHashMap
<>
()
;
<#
list
columns
as
column
>
<#
if
column
.columnKey
!=
'
PRI
'>
<#
if
column
.
columnComment
!=
''>
map
.put
(
"${column.
columnComment
}"
,
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}())
;
<#
if
column
.
remark
!=
''>
map
.put
(
"${column.
remark
}"
,
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}())
;
<#
else
>
map
.put
(
" ${column.changeColumnName}"
,
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}())
;
</#
if
>
...
...
eladmin-system/src/main/resources/template/generator/front/api.ftl
View file @
40852235
...
...
@@ -14,6 +14,13 @@ export function del(${pkChangeColName}) {
method
:
'
delete
'
})
}
export
function delAll(ids)
{
return
request
({
url
:
'
api
/$
{
changeClassName
}
/'
,
method
:
'
delete
'
,
data
:
ids
})
}
export
function edit(data)
{
return
request
({
...
...
Prev
1
2
3
4
5
Next
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