记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
f076baec
Commit
f076baec
authored
Mar 06, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按照炳哥 去掉haskey
parent
859ce6be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+15
-4
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
f076baec
...
...
@@ -774,6 +774,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
}
public
String
getRedisKey
(
String
key
){
Object
value
=
redisUtil
.
get
(
key
);
if
(
null
!=
value
){
return
value
.
toString
();
}
else
{
return
""
;
}
}
/**
* @author zhangfuxin
* @Description:精选商品列表
...
...
@@ -785,8 +794,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
//先从redis里 查 是否有第一页的值
String
spuIds
=
""
;
if
(
page
==
0
){
if
(
redisUtil
.
hasKey
(
GoblinRedisConst
.
SELECT_GOODS_PAGE1
)){
String
[]
spuids
=
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS_PAGE1
).
toString
().
split
(
","
);
String
selectGoodsPage1
=
getRedisKey
(
GoblinRedisConst
.
SELECT_GOODS_PAGE1
);
if
(
StringUtil
.
isNotBlank
(
selectGoodsPage1
)){
String
[]
spuids
=
selectGoodsPage1
.
split
(
","
);
log
.
debug
(
"spuids{}"
,
spuids
);
ArrayList
<
GoblinGoodsInfoVo
>
goblinGoodsInfoVoArrayList
=
ObjectUtil
.
getGoblinGoodsInfoVos
();
for
(
String
id:
spuids
){
...
...
@@ -816,12 +826,13 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
else
{
//查看是否有 配置的 spuid的顺序
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
SELECT_GOODS_SPUIDS
)){
String
selectGoodsSpuids
=
getRedisKey
(
GoblinRedisConst
.
SELECT_GOODS_PAGE1
);
if
(
StringUtil
.
isBlank
(
selectGoodsSpuids
)){
List
<
GoblinFrontSelectGoods
>
list
=
(
List
<
GoblinFrontSelectGoods
>)
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS
);
setPage1AndSpu
(
list
,
pageSize
);
this
.
getSelectGoods
(
page
,
pageSize
);
}
String
[]
spuidss
=
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS_SPUIDS
).
toString
()
.
split
(
","
);
String
[]
spuidss
=
selectGoodsSpuids
.
split
(
","
);
//找到对应的spuid
int
start
=
page
*
pageSize
;
int
end
=(
page
+
1
)*
pageSize
;
...
...
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