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
905c8c64
"src/main/java/vscode:/vscode.git/clone" did not exist on "ef542c34cc156b5c87bbe345c1cf8057797f02b6"
Commit
905c8c64
authored
Oct 31, 2019
by
dqjdda
Browse files
所有列表加入日期搜索与导出功能
parent
938ae1fc
Changes
67
Hide whitespace changes
Inline
Side-by-side
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDTO.java
View file @
905c8c64
...
@@ -3,6 +3,7 @@ package me.zhengjie.service.dto;
...
@@ -3,6 +3,7 @@ package me.zhengjie.service.dto;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
/**
/**
...
@@ -11,7 +12,7 @@ import java.sql.Timestamp;
...
@@ -11,7 +12,7 @@ import java.sql.Timestamp;
*/
*/
@Getter
@Getter
@Setter
@Setter
public
class
LocalStorageDTO
{
public
class
LocalStorageDTO
implements
Serializable
{
// ID
// ID
private
Long
id
;
private
Long
id
;
...
...
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
View file @
905c8c64
...
@@ -14,4 +14,10 @@ public class LocalStorageQueryCriteria{
...
@@ -14,4 +14,10 @@ public class LocalStorageQueryCriteria{
// 模糊
// 模糊
@Query
(
blurry
=
"name,suffix,type,operate,size"
)
@Query
(
blurry
=
"name,suffix,type,operate,size"
)
private
String
blurry
;
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
;
}
}
\ No newline at end of file
eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java
View file @
905c8c64
...
@@ -3,6 +3,8 @@ package me.zhengjie.service.dto;
...
@@ -3,6 +3,8 @@ package me.zhengjie.service.dto;
import
lombok.Data
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
/**
/**
* sm.ms图床
* sm.ms图床
*
*
...
@@ -17,4 +19,10 @@ public class PictureQueryCriteria{
...
@@ -17,4 +19,10 @@ public class PictureQueryCriteria{
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
username
;
private
String
username
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
}
}
eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
View file @
905c8c64
...
@@ -3,6 +3,8 @@ package me.zhengjie.service.dto;
...
@@ -3,6 +3,8 @@ package me.zhengjie.service.dto;
import
lombok.Data
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
/**
/**
* @author Zheng Jie
* @author Zheng Jie
* @date 2019-6-4 09:54:37
* @date 2019-6-4 09:54:37
...
@@ -12,4 +14,10 @@ public class QiniuQueryCriteria{
...
@@ -12,4 +14,10 @@ public class QiniuQueryCriteria{
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
key
;
private
String
key
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"updateTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"updateTime"
)
private
Timestamp
endTime
;
}
}
eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
View file @
905c8c64
...
@@ -17,10 +17,18 @@ import org.springframework.stereotype.Service;
...
@@ -17,10 +17,18 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
/**
/**
* @author Zheng Jie
* @author Zheng Jie
* @date 2019-09-05
* @date 2019-09-05
...
@@ -54,7 +62,7 @@ public class LocalStorageServiceImpl implements LocalStorageService {
...
@@ -54,7 +62,7 @@ public class LocalStorageServiceImpl implements LocalStorageService {
@Override
@Override
@Cacheable
@Cacheable
public
Object
queryAll
(
LocalStorageQueryCriteria
criteria
){
public
List
<
LocalStorageDTO
>
queryAll
(
LocalStorageQueryCriteria
criteria
){
return
localStorageMapper
.
toDto
(
localStorageRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
)));
return
localStorageMapper
.
toDto
(
localStorageRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
)));
}
}
...
@@ -126,4 +134,20 @@ public class LocalStorageServiceImpl implements LocalStorageService {
...
@@ -126,4 +134,20 @@ public class LocalStorageServiceImpl implements LocalStorageService {
localStorageRepository
.
delete
(
storage
);
localStorageRepository
.
delete
(
storage
);
}
}
}
}
@Override
public
void
download
(
List
<
LocalStorageDTO
>
queryAll
,
HttpServletResponse
response
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
for
(
LocalStorageDTO
localStorageDTO
:
queryAll
)
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"文件名"
,
localStorageDTO
.
getRealName
());
map
.
put
(
"备注名"
,
localStorageDTO
.
getName
());
map
.
put
(
"文件类型"
,
localStorageDTO
.
getType
());
map
.
put
(
"文件大小"
,
localStorageDTO
.
getSize
());
map
.
put
(
"操作人"
,
localStorageDTO
.
getOperate
());
map
.
put
(
"创建日期"
,
localStorageDTO
.
getCreateTime
());
list
.
add
(
map
);
}
FileUtil
.
downloadExcel
(
list
,
response
);
}
}
}
eladmin-tools/src/main/java/me/zhengjie/service/impl/PictureServiceImpl.java
View file @
905c8c64
...
@@ -19,8 +19,11 @@ import org.springframework.stereotype.Service;
...
@@ -19,8 +19,11 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.io.IOException
;
import
java.util.*
;
/**
/**
* @author Zheng Jie
* @author Zheng Jie
...
@@ -50,6 +53,11 @@ public class PictureServiceImpl implements PictureService {
...
@@ -50,6 +53,11 @@ public class PictureServiceImpl implements PictureService {
return
PageUtil
.
toPage
(
pictureRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
));
return
PageUtil
.
toPage
(
pictureRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
));
}
}
@Override
public
List
<
Picture
>
queryAll
(
PictureQueryCriteria
criteria
)
{
return
pictureRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
));
}
@Override
@Override
@CacheEvict
(
allEntries
=
true
)
@CacheEvict
(
allEntries
=
true
)
@Transactional
(
rollbackFor
=
Throwable
.
class
)
@Transactional
(
rollbackFor
=
Throwable
.
class
)
...
@@ -106,4 +114,22 @@ public class PictureServiceImpl implements PictureService {
...
@@ -106,4 +114,22 @@ public class PictureServiceImpl implements PictureService {
delete
(
findById
(
id
));
delete
(
findById
(
id
));
}
}
}
}
@Override
public
void
download
(
List
<
Picture
>
queryAll
,
HttpServletResponse
response
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
for
(
Picture
picture
:
queryAll
)
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"文件名"
,
picture
.
getFilename
());
map
.
put
(
"图片地址"
,
picture
.
getUrl
());
map
.
put
(
"文件大小"
,
picture
.
getSize
());
map
.
put
(
"操作人"
,
picture
.
getUsername
());
map
.
put
(
"高度"
,
picture
.
getHeight
());
map
.
put
(
"宽度"
,
picture
.
getWidth
());
map
.
put
(
"删除地址"
,
picture
.
getDelete
());
map
.
put
(
"创建日期"
,
picture
.
getCreateTime
());
list
.
add
(
map
);
}
FileUtil
.
downloadExcel
(
list
,
response
);
}
}
}
eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
View file @
905c8c64
...
@@ -31,7 +31,10 @@ import org.springframework.stereotype.Service;
...
@@ -31,7 +31,10 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.Optional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.*
;
/**
/**
* @author Zheng Jie
* @author Zheng Jie
...
@@ -60,6 +63,11 @@ public class QiNiuServiceImpl implements QiNiuService {
...
@@ -60,6 +63,11 @@ public class QiNiuServiceImpl implements QiNiuService {
return
PageUtil
.
toPage
(
qiniuContentRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
));
return
PageUtil
.
toPage
(
qiniuContentRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
));
}
}
@Override
public
List
<
QiniuContent
>
queryAll
(
QiniuQueryCriteria
criteria
)
{
return
qiniuContentRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
));
}
@Override
@Override
@Cacheable
(
key
=
"'1'"
)
@Cacheable
(
key
=
"'1'"
)
public
QiniuConfig
find
()
{
public
QiniuConfig
find
()
{
...
@@ -206,4 +214,20 @@ public class QiNiuServiceImpl implements QiNiuService {
...
@@ -206,4 +214,20 @@ public class QiNiuServiceImpl implements QiNiuService {
public
void
update
(
String
type
)
{
public
void
update
(
String
type
)
{
qiNiuConfigRepository
.
update
(
type
);
qiNiuConfigRepository
.
update
(
type
);
}
}
@Override
public
void
downloadList
(
List
<
QiniuContent
>
queryAll
,
HttpServletResponse
response
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
for
(
QiniuContent
content
:
queryAll
)
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"文件名"
,
content
.
getKey
());
map
.
put
(
"文件类型"
,
content
.
getSuffix
());
map
.
put
(
"空间名称"
,
content
.
getBucket
());
map
.
put
(
"文件大小"
,
content
.
getSize
());
map
.
put
(
"空间类型"
,
content
.
getType
());
map
.
put
(
"创建日期"
,
content
.
getUpdateTime
());
list
.
add
(
map
);
}
FileUtil
.
downloadExcel
(
list
,
response
);
}
}
}
Prev
1
2
3
4
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