Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
a9bb5914
Commit
a9bb5914
authored
Oct 13, 2020
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化行程列表:查询已完成 需要额外查询已取消状态
parent
234a8e60
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
13 deletions
+31
-13
bootstrap/src/main/java/io/geekidea/springbootplus/config/ShiroConfig.java
+4
-8
common/src/main/java/com/jumeirah/common/mapper/StrokeMapper.java
+3
-0
common/src/main/java/com/jumeirah/common/service/impl/StrokeServiceImpl.java
+7
-0
common/src/main/resources/mapper/StrokeMapper.xml
+16
-0
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/JwtFilter.java
+1
-5
No files found.
bootstrap/src/main/java/io/geekidea/springbootplus/config/ShiroConfig.java
View file @
a9bb5914
...
@@ -56,7 +56,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
...
@@ -56,7 +56,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.web.filter.DelegatingFilterProxy
;
import
org.springframework.web.filter.DelegatingFilterProxy
;
import
javax.servlet.DispatcherType
;
import
javax.servlet.DispatcherType
;
...
@@ -204,14 +203,13 @@ public class ShiroConfig {
...
@@ -204,14 +203,13 @@ public class ShiroConfig {
ShiroLoginService
shiroLoginService
,
ShiroLoginService
shiroLoginService
,
SysLoginRedisService
sysLoginRedisService
,
SysLoginRedisService
sysLoginRedisService
,
ShiroProperties
shiroProperties
,
ShiroProperties
shiroProperties
,
JwtProperties
jwtProperties
,
JwtProperties
jwtProperties
)
{
RedisTemplate
redisTemplate
)
{
ShiroFilterFactoryBean
shiroFilterFactoryBean
=
new
ShiroFilterFactoryBean
();
ShiroFilterFactoryBean
shiroFilterFactoryBean
=
new
ShiroFilterFactoryBean
();
// 设置安全管理器
// 设置安全管理器
shiroFilterFactoryBean
.
setSecurityManager
(
securityManager
);
shiroFilterFactoryBean
.
setSecurityManager
(
securityManager
);
// 设置过滤器
// 设置过滤器
Map
<
String
,
Filter
>
filterMap
=
getFilterMap
(
shiroLoginService
,
sysLoginRedisService
,
jwtProperties
,
redisTemplate
);
Map
<
String
,
Filter
>
filterMap
=
getFilterMap
(
shiroLoginService
,
jwtProperties
);
shiroFilterFactoryBean
.
setFilters
(
filterMap
);
shiroFilterFactoryBean
.
setFilters
(
filterMap
);
// 设置过滤器顺序
// 设置过滤器顺序
Map
<
String
,
String
>
filterChainMap
=
getFilterChainDefinitionMap
(
shiroProperties
);
Map
<
String
,
String
>
filterChainMap
=
getFilterChainDefinitionMap
(
shiroProperties
);
...
@@ -226,11 +224,9 @@ public class ShiroConfig {
...
@@ -226,11 +224,9 @@ public class ShiroConfig {
* @return
* @return
*/
*/
private
Map
<
String
,
Filter
>
getFilterMap
(
ShiroLoginService
shiroLoginService
,
private
Map
<
String
,
Filter
>
getFilterMap
(
ShiroLoginService
shiroLoginService
,
SysLoginRedisService
loginRedisService
,
JwtProperties
jwtProperties
)
{
JwtProperties
jwtProperties
,
RedisTemplate
redisTemplate
)
{
Map
<
String
,
Filter
>
filterMap
=
new
LinkedHashMap
<>();
Map
<
String
,
Filter
>
filterMap
=
new
LinkedHashMap
<>();
filterMap
.
put
(
JWT_FILTER_NAME
,
new
JwtFilter
(
shiroLoginService
,
loginRedisService
,
jwtProperties
,
redisTemplate
));
filterMap
.
put
(
JWT_FILTER_NAME
,
new
JwtFilter
(
shiroLoginService
,
jwtProperties
));
return
filterMap
;
return
filterMap
;
}
}
...
...
common/src/main/java/com/jumeirah/common/mapper/StrokeMapper.java
View file @
a9bb5914
...
@@ -39,6 +39,9 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
...
@@ -39,6 +39,9 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
* @return
* @return
*/
*/
IPage
<
StrokeQueryVo
>
getStrokePageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
StrokePageParam
strokePageParam
,
@Param
(
"userId"
)
Long
userId
);
IPage
<
StrokeQueryVo
>
getStrokePageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
StrokePageParam
strokePageParam
,
@Param
(
"userId"
)
Long
userId
);
IPage
<
StrokeQueryVo
>
getStrokePageListWithFinsh
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
StrokePageParam
strokePageParam
,
@Param
(
"userId"
)
Long
userId
);
/**
/**
* 商家端 获取行程分页对象
* 商家端 获取行程分页对象
...
...
common/src/main/java/com/jumeirah/common/service/impl/StrokeServiceImpl.java
View file @
a9bb5914
...
@@ -92,6 +92,13 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
...
@@ -92,6 +92,13 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
// 查询已完成 需要额外查询已取消状态
if
(
strokePageParam
.
getStatus
().
equals
(
StrokeStatusEnum
.
COMPLETED
.
getCode
())){
IPage
<
StrokeQueryVo
>
iPage
=
strokeMapper
.
getStrokePageListWithFinsh
(
page
,
strokePageParam
,
jwtToken
.
getUserId
());
return
new
Paging
<
StrokeQueryVo
>(
iPage
);
}
IPage
<
StrokeQueryVo
>
iPage
=
strokeMapper
.
getStrokePageList
(
page
,
strokePageParam
,
jwtToken
.
getUserId
());
IPage
<
StrokeQueryVo
>
iPage
=
strokeMapper
.
getStrokePageList
(
page
,
strokePageParam
,
jwtToken
.
getUserId
());
return
new
Paging
<
StrokeQueryVo
>(
iPage
);
return
new
Paging
<
StrokeQueryVo
>(
iPage
);
...
...
common/src/main/resources/mapper/StrokeMapper.xml
View file @
a9bb5914
...
@@ -54,6 +54,22 @@
...
@@ -54,6 +54,22 @@
</where>
</where>
</select>
</select>
<!-- 已完成订单-->
<select
id=
"getStrokePageListWithFinsh"
parameterType=
"com.jumeirah.common.param.StrokePageParam"
resultType=
"com.jumeirah.common.vo.StrokeQueryVo"
>
select
<include
refid=
"Page_Column_List"
/>
from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id
<where>
and s.user_id = #{userId}
and s.deleted = 0
and s.`status` = #{param.status}
or s.`status` = 99
</where>
</select>
<select
id=
"getMcStrokePageList"
parameterType=
"com.jumeirah.common.param.McStrokePageParam"
<select
id=
"getMcStrokePageList"
parameterType=
"com.jumeirah.common.param.McStrokePageParam"
resultType=
"com.jumeirah.common.vo.McStrokeQueryVo"
>
resultType=
"com.jumeirah.common.vo.McStrokeQueryVo"
>
SELECT
SELECT
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/JwtFilter.java
View file @
a9bb5914
...
@@ -19,7 +19,6 @@ package io.geekidea.springbootplus.framework.shiro.jwt;
...
@@ -19,7 +19,6 @@ package io.geekidea.springbootplus.framework.shiro.jwt;
import
io.geekidea.springbootplus.config.properties.JwtProperties
;
import
io.geekidea.springbootplus.config.properties.JwtProperties
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.shiro.cache.SysLoginRedisService
;
import
io.geekidea.springbootplus.framework.shiro.service.ShiroLoginService
;
import
io.geekidea.springbootplus.framework.shiro.service.ShiroLoginService
;
import
io.geekidea.springbootplus.framework.shiro.util.JwtTokenUtil
;
import
io.geekidea.springbootplus.framework.shiro.util.JwtTokenUtil
;
import
io.geekidea.springbootplus.framework.shiro.util.JwtUtil
;
import
io.geekidea.springbootplus.framework.shiro.util.JwtUtil
;
...
@@ -32,7 +31,6 @@ import org.apache.shiro.authc.AuthenticationToken;
...
@@ -32,7 +31,6 @@ import org.apache.shiro.authc.AuthenticationToken;
import
org.apache.shiro.subject.Subject
;
import
org.apache.shiro.subject.Subject
;
import
org.apache.shiro.web.filter.authc.AuthenticatingFilter
;
import
org.apache.shiro.web.filter.authc.AuthenticatingFilter
;
import
org.apache.shiro.web.util.WebUtils
;
import
org.apache.shiro.web.util.WebUtils
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.ServletResponse
;
...
@@ -50,13 +48,11 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -50,13 +48,11 @@ import javax.servlet.http.HttpServletResponse;
public
class
JwtFilter
extends
AuthenticatingFilter
{
public
class
JwtFilter
extends
AuthenticatingFilter
{
private
final
ShiroLoginService
shiroLoginService
;
private
final
ShiroLoginService
shiroLoginService
;
private
final
SysLoginRedisService
sysLoginRedisService
;
private
final
JwtProperties
jwtProperties
;
private
final
JwtProperties
jwtProperties
;
public
JwtFilter
(
ShiroLoginService
shiroLoginService
,
SysLoginRedisService
loginRedisService
,
JwtProperties
jwtProperties
,
RedisTemplate
redisTemplate
)
{
public
JwtFilter
(
ShiroLoginService
shiroLoginService
,
JwtProperties
jwtProperties
)
{
this
.
shiroLoginService
=
shiroLoginService
;
this
.
shiroLoginService
=
shiroLoginService
;
this
.
sysLoginRedisService
=
loginRedisService
;
this
.
jwtProperties
=
jwtProperties
;
this
.
jwtProperties
=
jwtProperties
;
}
}
...
...
Write
Preview
Markdown
is supported
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