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
784d670c
Commit
784d670c
authored
May 24, 2019
by
zhengjie
Browse files
2.0 抢先版,主要更新了#71 | #IWYE2
parent
90c2bf90
Changes
49
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/RoleSmallMapper.java
0 → 100644
View file @
784d670c
package
me.zhengjie.modules.system.service.mapper
;
import
me.zhengjie.mapper.EntityMapper
;
import
me.zhengjie.modules.system.domain.Role
;
import
me.zhengjie.modules.system.service.dto.RoleDTO
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
/**
* @author jie
* @date 2019-5-23
*/
@Mapper
(
componentModel
=
"spring"
,
uses
=
{},
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
RoleSmallMapper
extends
EntityMapper
<
RoleSmallDTO
,
Role
>
{
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/query/JobQueryService.java
View file @
784d670c
package
me.zhengjie.modules.system.service.query
;
import
me.zhengjie.modules.system.domain.Dept
;
import
me.zhengjie.modules.system.repository.DeptRepository
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.modules.system.domain.Job
;
import
me.zhengjie.modules.system.service.dto.JobDTO
;
...
...
@@ -34,13 +35,21 @@ public class JobQueryService {
@Autowired
private
JobRepository
jobRepository
;
@Autowired
private
DeptRepository
deptRepository
;
@Autowired
private
JobMapper
jobMapper
;
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
public
Object
queryAll
(
String
name
,
Boolean
enabled
,
Set
<
Long
>
deptIds
,
Long
deptId
,
Pageable
pageable
){
Page
<
Job
>
page
=
jobRepository
.
findAll
(
new
Spec
(
new
JobDTO
(
name
,
enabled
),
deptIds
,
deptId
),
pageable
);
return
PageUtil
.
toPage
(
page
.
map
(
jobMapper:
:
toDto
));
List
<
JobDTO
>
jobs
=
new
ArrayList
<>();
for
(
Job
job
:
page
.
getContent
())
{
jobs
.
add
(
jobMapper
.
toDto
(
job
,
deptRepository
.
findNameById
(
job
.
getDept
().
getPid
())));
}
return
PageUtil
.
toPage
(
jobs
,
page
.
getTotalElements
());
}
class
Spec
implements
Specification
<
Job
>
{
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/query/UserQueryService.java
View file @
784d670c
...
...
@@ -17,7 +17,6 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
javax.persistence.criteria.*
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
eladmin-system/src/main/resources/config/application-dev.yml
View file @
784d670c
...
...
@@ -32,8 +32,6 @@ spring:
stat-view-servlet
:
url-pattern
:
/druid/*
reset-enable
:
false
login-username
:
admin
login-password
:
123456
web-stat-filter
:
url-pattern
:
/*
...
...
eladmin-system/src/main/resources/config/application.yml
View file @
784d670c
server
:
port
:
8000
# actuator 配置
management
:
endpoints
:
web
:
exposure
:
# env 环境属性
# heapdump 应用的 JVM 堆信息
# metrics 应用程序度量信息
include
:
env,health,heapdump,metrics
spring
:
profiles
:
active
:
dev
...
...
@@ -37,7 +47,6 @@ spring:
#连接超时时间
timeout
:
5000
#七牛云
qiniu
:
# 文件大小 /M
...
...
eladmin-system/src/main/resources/template/generator/admin/QueryService.ftl
View file @
784d670c
...
...
@@ -74,13 +74,13 @@ public class ${className}QueryService {
/
**
*
模糊
*
/
list
.add
(
cb
.like
(
root
.get
(
"${column.columnName}"
)
.as
(
$
{
column
.columnType
}
.class
),
"%"
+$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}()
+
"%"
))
;
list
.add
(
cb
.like
(
root
.get
(
"${column.c
hangeC
olumnName}"
)
.as
(
$
{
column
.columnType
}
.class
),
"%"
+$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}()
+
"%"
))
;
</#
if
>
<#
if
column
.columnQuery
=
'
2
'>
/
**
*
精确
*
/
list
.add
(
cb
.equal
(
root
.get
(
"${column.columnName}"
)
.as
(
$
{
column
.columnType
}
.class
),
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}()))
;
list
.add
(
cb
.equal
(
root
.get
(
"${column.c
hangeC
olumnName}"
)
.as
(
$
{
column
.columnType
}
.class
),
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}()))
;
</#
if
>
}
</#
list
>
...
...
eladmin-system/src/main/resources/template/generator/front/eForm.ftl
View file @
784d670c
...
...
@@ -4,7 +4,7 @@
<#
if
columns??>
<#list columns as column>
<#if column.changeColumnName != '$
{
pkChangeColName
}
'>
<el-form-item label="<#if column.columnComment != ''>$
{
column
.columnComment
}
<#else>$
{
column
.changeColumnName
}
</#if>">
<el-form-item label="<#if column.columnComment != ''>$
{
column
.columnComment
}
<#else>$
{
column
.changeColumnName
}
</#if>"
<#if column.columnKey = 'UNI'>prop="$
{
column
.changeColumnName
}
"</#if>
>
<el-input v-model="form.$
{
column
.changeColumnName
}
" style="width: 370px;"/>
</el-form-item>
</#if>
...
...
@@ -40,6 +40,15 @@ export default {
$
{
column
.changeColumnName
}:
''<#
if
column_has_next
>
,
</#
if
>
</#
list
>
</#
if
>
},
rules
:
{
<#
list
columns
as
column
>
<#
if
column
.columnKey
=
'
UNI
'>
$
{
column
.changeColumnName
}:
[
{
required
:
true
,
message
:
'
please
enter
'
,
trigger
:
'
blur
'
}
]<#
if
(
column_has_next
)
>
,
</#
if
>
</#
if
>
</#
list
>
}
}
},
...
...
eladmin-tools/pom.xml
View file @
784d670c
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
eladmin
</artifactId>
<groupId>
me.zhengjie
</groupId>
<version>
1.9
</version>
<version>
2.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -22,7 +22,7 @@
<dependency>
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin-logging
</artifactId>
<version>
1.9
</version>
<version>
2.0
</version>
</dependency>
<!--邮件依赖-->
...
...
pom.xml
View file @
784d670c
...
...
@@ -7,7 +7,7 @@
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin
</artifactId>
<packaging>
pom
</packaging>
<version>
1.9
</version>
<version>
2.0
</version>
<modules>
<module>
eladmin-common
</module>
...
...
@@ -48,10 +48,10 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<!--
<dependency>
-->
<!--
<groupId>org.springframework.boot</groupId>
-->
<!--
<artifactId>spring-boot-starter-actuator</artifactId>
-->
<!--
</dependency>
-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
...
...
Prev
1
2
3
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