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
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
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.web.filter.DelegatingFilterProxy
;
import
javax.servlet.DispatcherType
;
...
...
@@ -204,14 +203,13 @@ public class ShiroConfig {
ShiroLoginService
shiroLoginService
,
SysLoginRedisService
sysLoginRedisService
,
ShiroProperties
shiroProperties
,
JwtProperties
jwtProperties
,
RedisTemplate
redisTemplate
)
{
JwtProperties
jwtProperties
)
{
ShiroFilterFactoryBean
shiroFilterFactoryBean
=
new
ShiroFilterFactoryBean
();
// 设置安全管理器
shiroFilterFactoryBean
.
setSecurityManager
(
securityManager
);
// 设置过滤器
Map
<
String
,
Filter
>
filterMap
=
getFilterMap
(
shiroLoginService
,
sysLoginRedisService
,
jwtProperties
,
redisTemplate
);
Map
<
String
,
Filter
>
filterMap
=
getFilterMap
(
shiroLoginService
,
jwtProperties
);
shiroFilterFactoryBean
.
setFilters
(
filterMap
);
// 设置过滤器顺序
Map
<
String
,
String
>
filterChainMap
=
getFilterChainDefinitionMap
(
shiroProperties
);
...
...
@@ -226,11 +224,9 @@ public class ShiroConfig {
* @return
*/
private
Map
<
String
,
Filter
>
getFilterMap
(
ShiroLoginService
shiroLoginService
,
SysLoginRedisService
loginRedisService
,
JwtProperties
jwtProperties
,
RedisTemplate
redisTemplate
)
{
JwtProperties
jwtProperties
)
{
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
;
}
...
...
common/src/main/java/com/jumeirah/common/mapper/StrokeMapper.java
View file @
a9bb5914
...
...
@@ -39,6 +39,9 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
* @return
*/
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
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
());
return
new
Paging
<
StrokeQueryVo
>(
iPage
);
...
...
common/src/main/resources/mapper/StrokeMapper.xml
View file @
a9bb5914
...
...
@@ -54,36 +54,52 @@
</where>
</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"
resultType=
"com.jumeirah.common.vo.McStrokeQueryVo"
>
SELECT
s.*,
CONCAT( au.surname, au.`name` ) AS applicant,
au.phone AS phone_number
s.*,
CONCAT( au.surname, au.`name` ) AS applicant,
au.phone AS phone_number
FROM
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
<where>
<if
test=
"mcStrokePageParam.type !=null"
>
AND s.type = #{mcStrokePageParam.type}
</if>
<if
test=
"mcStrokePageParam.id !=null"
>
AND s.id = #{mcStrokePageParam.id}
</if>
<if
test=
"mcStrokePageParam.startTime !=null and mcStrokePageParam.startTime != ''"
>
AND s.create_time
>
= #{mcStrokePageParam.startTime}
</if>
<if
test=
"mcStrokePageParam.endTime !=null and mcStrokePageParam.endTime != ''"
>
AND s.create_time
<
= #{mcStrokePageParam.endTime}
</if>
<if
test=
"mcStrokePageParam.applicant !=null and mcStrokePageParam.applicant != ''"
>
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
</if>
</where>
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
<where>
<if
test=
"mcStrokePageParam.type !=null"
>
AND s.type = #{mcStrokePageParam.type}
</if>
<if
test=
"mcStrokePageParam.id !=null"
>
AND s.id = #{mcStrokePageParam.id}
</if>
<if
test=
"mcStrokePageParam.startTime !=null and mcStrokePageParam.startTime != ''"
>
AND s.create_time
>
= #{mcStrokePageParam.startTime}
</if>
<if
test=
"mcStrokePageParam.endTime !=null and mcStrokePageParam.endTime != ''"
>
AND s.create_time
<
= #{mcStrokePageParam.endTime}
</if>
<if
test=
"mcStrokePageParam.applicant !=null and mcStrokePageParam.applicant != ''"
>
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
</if>
</where>
WHERE
s.type = 2
AND s.id = 1
AND (s.create_time BETWEEN '2020-10-07 15:32:30' AND '2020-10-12 15:32:30')
s.type = 2
AND s.id = 1
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 '%姓名'
</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;
import
io.geekidea.springbootplus.config.properties.JwtProperties
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
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.util.JwtTokenUtil
;
import
io.geekidea.springbootplus.framework.shiro.util.JwtUtil
;
...
...
@@ -32,7 +31,6 @@ import org.apache.shiro.authc.AuthenticationToken;
import
org.apache.shiro.subject.Subject
;
import
org.apache.shiro.web.filter.authc.AuthenticatingFilter
;
import
org.apache.shiro.web.util.WebUtils
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletResponse
;
...
...
@@ -50,13 +48,11 @@ import javax.servlet.http.HttpServletResponse;
public
class
JwtFilter
extends
AuthenticatingFilter
{
private
final
ShiroLoginService
shiroLoginService
;
private
final
SysLoginRedisService
sysLoginRedisService
;
private
final
JwtProperties
jwtProperties
;
public
JwtFilter
(
ShiroLoginService
shiroLoginService
,
SysLoginRedisService
loginRedisService
,
JwtProperties
jwtProperties
,
RedisTemplate
redisTemplate
)
{
public
JwtFilter
(
ShiroLoginService
shiroLoginService
,
JwtProperties
jwtProperties
)
{
this
.
shiroLoginService
=
shiroLoginService
;
this
.
sysLoginRedisService
=
loginRedisService
;
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