Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
9e0d1cfb
Commit
9e0d1cfb
authored
Nov 14, 2018
by
zhangyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
9866fead
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
9 deletions
+18
-9
WebMvcConfig.java
src/main/java/com/egolm/shop/config/WebMvcConfig.java
+3
-3
OpenInterceptor.java
...va/com/egolm/shop/config/interceptor/OpenInterceptor.java
+5
-3
BrandController.java
src/main/java/com/egolm/shop/controller/BrandController.java
+1
-1
BrandServiceImpl.java
...in/java/com/egolm/shop/service/impl/BrandServiceImpl.java
+9
-2
No files found.
src/main/java/com/egolm/shop/config/WebMvcConfig.java
View file @
9e0d1cfb
...
...
@@ -13,9 +13,9 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
private
OpenInterceptor
openInterceptor
;
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
/*
//注册自定义拦截器,添加拦截路径和排除拦截路径
System.out.println("-addInterceptors------");
//注册自定义拦截器,添加拦截路径和排除拦截路径
/*
System.out.println("-addInterceptors------");
registry.addInterceptor(openInterceptor).excludePathPatterns("api/path/login");
super.addInterceptors(registry);*/
super.addInterceptors(registry);
*/
}
}
src/main/java/com/egolm/shop/config/interceptor/OpenInterceptor.java
View file @
9e0d1cfb
...
...
@@ -16,7 +16,6 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.HttpUtil
;
import
com.egolm.common.MD5Util
;
import
com.egolm.common.StringUtil
;
import
com.egolm.shop.config.XException
;
...
...
@@ -29,7 +28,7 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
String
encoding
=
"UTF-8"
;
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
/*签名规则:1.按照参数字段名ASCII码排序;2.参数进行url拼接;3.加上签名字符串secret;4.得到字符串后进行SHA1签名;5.将签名得到的字符串加入参数列表中,字段名为sig*/
@Override
...
...
@@ -53,6 +52,9 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
String
value
=
req
.
getParameter
(
key
);
parameters
.
put
(
key
,
value
);
}
redisTemplate
.
opsForHash
().
put
(
"SystemCtl1111"
,
"test"
,
"111"
);
System
.
out
.
println
(
redisTemplate
.
opsForHash
().
get
(
"SystemCtl1111"
,
"test"
));
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
redisTemplate
.
opsForHash
().
get
(
ShopContstrant
.
SystemCtl_Redis_Base_Key
,
ShopContstrant
.
CLIENT_MD5KEY
);
System
.
out
.
println
(
map
);
...
...
src/main/java/com/egolm/shop/controller/BrandController.java
View file @
9e0d1cfb
...
...
@@ -65,7 +65,7 @@ public class BrandController {
Page
page
=
new
Page
();
page
.
setIndex
(
Long
.
valueOf
(
index
));
page
.
setLimit
(
Long
.
valueOf
(
limit
));
page
.
setLimitKey
(
"
BannerID
asc"
);
page
.
setLimitKey
(
"
Idx
asc"
);
List
<
Map
<
String
,
Object
>>
detailList
=
brandService
.
listBanner
(
param
,
page
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
detailList
).
setPage
(
page
).
toString
();
...
...
src/main/java/com/egolm/shop/service/impl/BrandServiceImpl.java
View file @
9e0d1cfb
...
...
@@ -28,8 +28,15 @@ public class BrandServiceImpl implements BrandService {
@Override
public
List
<
Map
<
String
,
Object
>>
listBanner
(
Map
<
String
,
Object
>
params
,
Page
page
){
String
orgNO
=
params
.
get
(
"orgNO"
)+
""
;
String
sql
=
"select nItem BannerID, nIdx Idx, sTitle Title, sLinkType LinkType, sLinkPath LinkUrl, sImagePath ImgPath from tBanner where sOrgList like '%"
+
orgNO
+
"%'"
;
// return jdbcTemplate.queryForList(sql);
String
sql
=
"select nItem BannerID, nIdx Idx, sTitle Title, sLinkType LinkType, sLinkPath LinkUrl, sImagePath ImgPath from tBanner"
+
" where CONVERT(varchar(100), dStartTime, 23) <= CONVERT(varchar(100),getdate(), 23) "
+
" AND CONVERT(varchar(100), dEndTime, 23) >= CONVERT(varchar(100),getdate(), 23) "
+
" AND nTag&1=0 "
;
if
(!
orgNO
.
equals
(
"-1"
))
{
sql
+=
" AND (sOrgList like '%"
+
orgNO
+
"%' or sOrgList = '-1') "
;
//全部
}
else
{
sql
+=
" AND sOrgList like '%"
+
orgNO
+
"%' "
;
}
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
limit
(
sql
,
page
);
}
...
...
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