记得上下班打卡 | 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
1b0bc5d4
Commit
1b0bc5d4
authored
Jan 18, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
539e80a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
1 deletion
+82
-1
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+18
-0
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+64
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
1b0bc5d4
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @author zhangfuxin
* @author zhangfuxin
...
@@ -99,6 +100,23 @@ public class GoblinFrontController {
...
@@ -99,6 +100,23 @@ public class GoblinFrontController {
return
ResponseDto
.
success
(
goblinFrontService
.
getCategory
(
categoryId
));
return
ResponseDto
.
success
(
goblinFrontService
.
getCategory
(
categoryId
));
}
}
@GetMapping
(
"getStore"
)
@ApiOperation
(
"获得店铺详情"
)
public
ResponseDto
<
GoblinStoreInfoVo
>
getStore
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getStore
(
storeId
));
}
@GetMapping
(
"getStoreCategory"
)
@ApiOperation
(
"获得店铺分类"
)
public
ResponseDto
<
List
<
GoblinStoreGoodsCategoryVo
>>
getStoreCategory
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getStoreCategory
(
storeId
));
}
@GetMapping
(
"getStoreGoodes"
)
@ApiOperation
(
"获得店铺分类"
)
public
ResponseDto
<
List
<
GoblinStoreGoodsCategoryVo
>>
getStoreGoodes
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getStoreCategory
(
storeId
));
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
1b0bc5d4
...
@@ -45,6 +45,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -45,6 +45,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
@Override
@Override
public
ArrayList
<
GoblinFrontBannerVo
>
getListBanner
()
{
public
ArrayList
<
GoblinFrontBannerVo
>
getListBanner
()
{
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
FRONT_TOP_BANNER
)){
return
null
;
}
List
<
GoblinFrontBanner
>
list
=
(
List
<
GoblinFrontBanner
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_TOP_BANNER
);
List
<
GoblinFrontBanner
>
list
=
(
List
<
GoblinFrontBanner
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_TOP_BANNER
);
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
ArrayList
<
GoblinFrontBanner
>
goblinFrontBannerArrayList
=
ObjectUtil
.
getGoblinFrontBannerArrayList
();
ArrayList
<
GoblinFrontBanner
>
goblinFrontBannerArrayList
=
ObjectUtil
.
getGoblinFrontBannerArrayList
();
...
@@ -66,6 +69,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -66,6 +69,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
list1
;
return
list1
;
}
}
public
ArrayList
<
GoblinFrontBannerVo
>
getMiddleBanner
()
{
public
ArrayList
<
GoblinFrontBannerVo
>
getMiddleBanner
()
{
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
FRONT_MIDDLE_BANNER
)){
return
null
;
}
List
<
GoblinFrontBanner
>
list
=
(
List
<
GoblinFrontBanner
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_MIDDLE_BANNER
);
List
<
GoblinFrontBanner
>
list
=
(
List
<
GoblinFrontBanner
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_MIDDLE_BANNER
);
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
ArrayList
<
GoblinFrontBanner
>
goblinFrontBannerArrayList
=
ObjectUtil
.
getGoblinFrontBannerArrayList
();
ArrayList
<
GoblinFrontBanner
>
goblinFrontBannerArrayList
=
ObjectUtil
.
getGoblinFrontBannerArrayList
();
...
@@ -89,6 +95,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -89,6 +95,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
@Override
@Override
public
GoblinFrontHotWord
getHotWord
()
{
public
GoblinFrontHotWord
getHotWord
()
{
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
FRONT_HOTWORD
)){
return
null
;
}
// int index= (int) redisUtil.get(GoblinRedisConst.FRONT_HOTWORD_INDEX);
// int index= (int) redisUtil.get(GoblinRedisConst.FRONT_HOTWORD_INDEX);
//获得value
//获得value
List
<
GoblinFrontHotWord
>
list
=
(
List
<
GoblinFrontHotWord
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_HOTWORD
);
List
<
GoblinFrontHotWord
>
list
=
(
List
<
GoblinFrontHotWord
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_HOTWORD
);
...
@@ -109,6 +118,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -109,6 +118,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
@Override
@Override
public
GoblinFrontNavigationVoo
getNavigation
()
{
public
GoblinFrontNavigationVoo
getNavigation
()
{
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
FRONT_NAVIGATION
)){
return
null
;
}
GoblinFrontNavigationVoo
goblinFrontNavigationVoo
=
GoblinFrontNavigationVoo
.
getNew
();
GoblinFrontNavigationVoo
goblinFrontNavigationVoo
=
GoblinFrontNavigationVoo
.
getNew
();
List
<
GoblinFrontNavigation
>
list
=
(
List
<
GoblinFrontNavigation
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_NAVIGATION
);
List
<
GoblinFrontNavigation
>
list
=
(
List
<
GoblinFrontNavigation
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_NAVIGATION
);
ArrayList
<
GoblinFrontNavigationVo
>
list1
=
ObjectUtil
.
getgoblinFrontNavigationVoArrayList
();
ArrayList
<
GoblinFrontNavigationVo
>
list1
=
ObjectUtil
.
getgoblinFrontNavigationVoArrayList
();
...
@@ -257,6 +269,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -257,6 +269,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* 获得商品详情
* 获得商品详情
*/
*/
public
List
getMoudleIndex
(){
public
List
getMoudleIndex
(){
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
MOUDLE_INDEX
)){
return
null
;
}
//GoblinGoodsInfoVo goblinGoodsInfoVo=goblinRedisUtils.get(spuId);
//GoblinGoodsInfoVo goblinGoodsInfoVo=goblinRedisUtils.get(spuId);
List
<
GoblinFrontMoudleIndex
>
list
=
(
List
<
GoblinFrontMoudleIndex
>)
redisUtil
.
get
(
GoblinRedisConst
.
MOUDLE_INDEX
);
List
<
GoblinFrontMoudleIndex
>
list
=
(
List
<
GoblinFrontMoudleIndex
>)
redisUtil
.
get
(
GoblinRedisConst
.
MOUDLE_INDEX
);
return
list
;
return
list
;
...
@@ -269,6 +284,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -269,6 +284,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public
GoblinFrontCubeVo
getCube
(){
public
GoblinFrontCubeVo
getCube
(){
GoblinFrontCubeVo
goblinFrontCubeVo
=
GoblinFrontCubeVo
.
getNew
();
GoblinFrontCubeVo
goblinFrontCubeVo
=
GoblinFrontCubeVo
.
getNew
();
ArrayList
<
GoblinGoodsInfoVo
>
goblinGoodsInfoVoArrayList
=
ObjectUtil
.
getGoblinGoodsInfoVos
();
ArrayList
<
GoblinGoodsInfoVo
>
goblinGoodsInfoVoArrayList
=
ObjectUtil
.
getGoblinGoodsInfoVos
();
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
FRONT_GOBLINFRONTCUBE
)){
return
null
;
}
List
<
GoblinFrontCube
>
list
=
(
List
<
GoblinFrontCube
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_GOBLINFRONTCUBE
);
List
<
GoblinFrontCube
>
list
=
(
List
<
GoblinFrontCube
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_GOBLINFRONTCUBE
);
if
(
list
.
size
()>
0
){
if
(
list
.
size
()>
0
){
BeanUtils
.
copyProperties
(
list
.
get
(
0
),
goblinFrontCubeVo
);
BeanUtils
.
copyProperties
(
list
.
get
(
0
),
goblinFrontCubeVo
);
...
@@ -285,7 +303,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -285,7 +303,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
return
goblinFrontCubeVo
;
return
goblinFrontCubeVo
;
}
}
public
GoblinStoreInfoVo
getStore
(
String
storId
){
return
goblinRedisUtils
.
getStoreInfoVo
(
storId
);
}
/***
* @author zhangfuxin
* @Description:获得商铺分类
* @date 2022/1/18 下午1:44
*/
public
List
<
GoblinStoreGoodsCategoryVo
>
getStoreCategory
(
String
storId
){
//店铺分类数据源
List
<
GoblinStoreGoodsCategoryVo
>
list
=
goblinRedisUtils
.
getStoreGoodsCategoryVos
(
storId
);
return
list
;
}
/**
/**
* 找到分类
* 找到分类
*/
*/
...
@@ -315,6 +345,36 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -315,6 +345,36 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
goblinCategoryzfVo
;
return
goblinCategoryzfVo
;
}
}
public
List
<
GoblinGoodsInfoVo
>
getStoreGoodes
(
String
storeId
,
String
categoryId
){
//
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
));
if
(
StringUtil
.
isNotBlank
(
categoryId
)){
query
.
addCriteria
(
new
Criteria
().
orOperator
(
Criteria
.
where
(
"cateFid"
).
is
(
categoryId
),
Criteria
.
where
(
"cateSid"
).
is
(
categoryId
),
Criteria
.
where
(
"cateTid"
).
is
(
categoryId
)
));
}
// 查询总数
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
if
(
list
.
size
()>
0
){
//找到 销量
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo:
list
){
Integer
counts
=
goblinRedisUtils
.
getSpuSaleCount
(
goblinGoodsInfoVo
.
getSpuId
());
if
(
counts
==
null
){
goblinGoodsInfoVo
.
setCount
(
0
);
}
else
{
goblinGoodsInfoVo
.
setCount
(
counts
);
}
}
Collections
.
sort
(
list
,
new
Comparator
<
GoblinGoodsInfoVo
>()
{
public
int
compare
(
GoblinGoodsInfoVo
arg0
,
GoblinGoodsInfoVo
arg1
)
{
return
-(
arg0
.
getCount
().
compareTo
(
arg1
.
getCount
()));
}});
}
return
list
;
}
/**
/**
*音乐人列表
*音乐人列表
...
@@ -428,6 +488,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -428,6 +488,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
*/
*/
@Override
@Override
public
GoblinFrontSelectGoodVo
getSelectGoods
(
int
page
,
int
pageSize
)
{
public
GoblinFrontSelectGoodVo
getSelectGoods
(
int
page
,
int
pageSize
)
{
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
SELECT_GOODS
)){
return
null
;
}
//redis 取出精选商品列表
//redis 取出精选商品列表
List
<
GoblinFrontSelectGoods
>
list
=
(
List
<
GoblinFrontSelectGoods
>)
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS
);
List
<
GoblinFrontSelectGoods
>
list
=
(
List
<
GoblinFrontSelectGoods
>)
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS
);
if
(
null
!=
list
&&
list
.
size
()==
1
){
if
(
null
!=
list
&&
list
.
size
()==
1
){
...
...
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