Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SiEn
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
SiEn
Commits
a9bb5914
Commit
a9bb5914
authored
Oct 13, 2020
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化行程列表:查询已完成 需要额外查询已取消状态
parent
234a8e60
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
38 deletions
+56
-38
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
+41
-25
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,36 +54,52 @@
...
@@ -54,36 +54,52 @@
</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
s.*,
s.*,
CONCAT( au.surname, au.`name` ) AS applicant,
CONCAT( au.surname, au.`name` ) AS applicant,
au.phone AS phone_number
au.phone AS phone_number
FROM
FROM
stroke s
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN app_user au ON au.id = s.user_id
<where>
<where>
<if
test=
"mcStrokePageParam.type !=null"
>
<if
test=
"mcStrokePageParam.type !=null"
>
AND s.type = #{mcStrokePageParam.type}
AND s.type = #{mcStrokePageParam.type}
</if>
</if>
<if
test=
"mcStrokePageParam.id !=null"
>
<if
test=
"mcStrokePageParam.id !=null"
>
AND s.id = #{mcStrokePageParam.id}
AND s.id = #{mcStrokePageParam.id}
</if>
</if>
<if
test=
"mcStrokePageParam.startTime !=null and mcStrokePageParam.startTime != ''"
>
<if
test=
"mcStrokePageParam.startTime !=null and mcStrokePageParam.startTime != ''"
>
AND s.create_time
>
= #{mcStrokePageParam.startTime}
AND s.create_time
>
= #{mcStrokePageParam.startTime}
</if>
</if>
<if
test=
"mcStrokePageParam.endTime !=null and mcStrokePageParam.endTime != ''"
>
<if
test=
"mcStrokePageParam.endTime !=null and mcStrokePageParam.endTime != ''"
>
AND s.create_time
<
= #{mcStrokePageParam.endTime}
AND s.create_time
<
= #{mcStrokePageParam.endTime}
</if>
</if>
<if
test=
"mcStrokePageParam.applicant !=null and mcStrokePageParam.applicant != ''"
>
<if
test=
"mcStrokePageParam.applicant !=null and mcStrokePageParam.applicant != ''"
>
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
</if>
</if>
</where>
</where>
WHERE
WHERE
s.type = 2
s.type = 2
AND s.id = 1
AND s.id = 1
AND (s.create_time BETWEEN '2020-10-07 15:32:30' AND '2020-10-12 15:32:30')
AND (s.create_time BETWEEN '2020-10-07 15:32:30' AND '2020-10-12 15:32:30')
AND CONCAT( au.surname, au.`name` ) LIKE '%姓名'
AND CONCAT( au.surname, au.`name` ) LIKE '%姓名'
</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