记得上下班打卡 | 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
b6e6f97f
Commit
b6e6f97f
authored
Jan 21, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改精选商品接口
parent
ab3243fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
GoblinFrontSelectGoodsServiceImpl.java
...oblin/service/impl/GoblinFrontSelectGoodsServiceImpl.java
+2
-0
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+1
-1
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+25
-6
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontSelectGoodsServiceImpl.java
View file @
b6e6f97f
...
...
@@ -164,6 +164,8 @@ public class GoblinFrontSelectGoodsServiceImpl extends ServiceImpl<GoblinFrontSe
mongoTemplate
.
save
(
goblinFrontSelectGoods
,
GoblinFrontSelectGoods
.
class
.
getSimpleName
());
}
redisGoblinUtil
.
set
(
GoblinRedisConst
.
SELECT_GOODS
,
list
);
redisGoblinUtil
.
del
(
GoblinRedisConst
.
SELECT_GOODS_SPUIDS
);
redisGoblinUtil
.
del
(
GoblinRedisConst
.
SELECT_GOODS_PAGE1
);
}
return
true
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
b6e6f97f
...
...
@@ -112,7 +112,7 @@ public class GoblinFrontController {
}
@GetMapping
(
"getStoreGoodes"
)
@ApiOperation
(
"获得店铺商品"
)
public
ResponseDto
<
List
<
GoblinGoodsInfoVo
>
>
getStoreGoodes
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"categoryId"
,
required
=
false
)
String
categoryId
,
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
)
throws
ParseException
{
public
ResponseDto
<
GoblinFrontCategoryListVo
>
getStoreGoodes
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"categoryId"
,
required
=
false
)
String
categoryId
,
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getStoreGoodes
(
storeId
,
categoryId
,
name
));
}
@GetMapping
(
"searchGoodesName"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
b6e6f97f
...
...
@@ -383,7 +383,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
return
list1
;
}
public
List
<
GoblinGoodsInfoVo
>
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
){
public
GoblinFrontCategoryListVo
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
){
//
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
));
...
...
@@ -415,7 +415,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
-(
arg0
.
getCount
().
compareTo
(
arg1
.
getCount
()));
}});
}
return
list
;
GoblinFrontCategoryListVo
goblinFrontCategoryListVo
=
GoblinFrontCategoryListVo
.
getNew
();
goblinFrontCategoryListVo
.
setSpuList
(
list
);
return
goblinFrontCategoryListVo
;
}
/**
...
...
@@ -531,10 +533,22 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if
(
StringUtil
.
isNotBlank
(
spuids
)){
query
.
addCriteria
(
Criteria
.
where
(
"spuId"
).
nin
(
spuids
.
split
(
","
)));
}
query
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
0
));
Sort
sortName
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"count"
);
/* Pageable pageable = PageRequest.of(page, pageSize, sortName);
query
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
));
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
int
sortType
=
0
;
Sort
sortName
=
null
;
if
(
sortType
==
1
){
sortName
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"shelvesAt"
);
}
else
if
(
sortType
==
2
){
sortName
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"count"
);
}
else
if
(
sortType
==
3
){
sortName
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"priceGe"
);
}
else
{
sortName
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"priceGe"
);
}
/* Pageable pageable = PageRequest.of(page, pageSize, sortName);
query.with(pageable);*/
query
.
with
(
sortName
);
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
StringBuffer
sb
=
new
StringBuffer
();
int
index
=
0
;
...
...
@@ -590,7 +604,12 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
int
index
=
0
;
StringBuffer
sb1
=
new
StringBuffer
();
for
(
String
ss:
supids
.
split
(
","
)){
sb1
.
append
(
ss
);
if
(
index
==
0
){
sb1
.
append
(
ss
);
}
else
{
sb1
.
append
(
","
+
ss
);
}
index
++;
if
(
index
==
pageSize
){
break
;
...
...
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