记得上下班打卡 | 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
10f105fc
Commit
10f105fc
authored
Jan 25, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开发新品推荐
parent
5347b9ab
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
2 deletions
+74
-2
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+1
-0
GoblinFrontBannerController.java
...ntroller/zhengzai/goblin/GoblinFrontBannerController.java
+2
-0
GoblinFrontCubeController.java
...controller/zhengzai/goblin/GoblinFrontCubeController.java
+1
-1
GoblinFrontCubeServiceImpl.java
...ngzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
+31
-0
GoblinFrontCube.java
.../com/liquidnet/service/goblin/entity/GoblinFrontCube.java
+2
-0
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+10
-1
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+27
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
10f105fc
...
...
@@ -82,6 +82,7 @@ public class GoblinRedisConst {
public
static
final
String
MOUDLE_INDEX
=
PREFIX
.
concat
(
"moudle_index"
);
//moudle_index 组件排序
public
static
final
String
COMPLIATIONS
=
PREFIX
.
concat
(
"goblinFrontCompilations"
);
// 合集
public
static
final
String
FRONT_GOBLINFRONTCUBE
=
PREFIX
.
concat
(
"goblinFrontCube"
);
// 魔方
public
static
final
String
FRONT_GOBLIN_RECOMMEND
=
PREFIX
.
concat
(
"goblinFrontRECOMMMEND"
);
// 新品推荐
public
static
final
String
FRONT_SHOPCART
=
PREFIX
.
concat
(
"goblin_shopcart:"
);
// 购物车
public
static
final
String
FRONT_SHOPCART_TWO
=
PREFIX
.
concat
(
"goblin_shopcartTwo:"
);
// 购物车第二部
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontBannerController.java
View file @
10f105fc
...
...
@@ -146,6 +146,8 @@ public class GoblinFrontBannerController extends BaseController {
//魔方
boolean
cubeResult
=
goblinFrontCubeService
.
online
();
logger
.
info
(
"魔方{}"
,
cubeResult
);
boolean
recommendResult
=
goblinFrontCubeService
.
onlineRecommend
();
logger
.
debug
(
"新品推荐{}"
,
recommendResult
);
/* boolean hejiReult=goblinFrontCompilationsService.online();
logger.info("合集{}",hejiReult);*/
if
(
bannerResult
&&
hotWordResult
&&
navigationResult
&
bannerMiddle
&&
selectGoods
&&
moudleIndexResult
&&
cubeResult
)
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontCubeController.java
View file @
10f105fc
...
...
@@ -56,7 +56,7 @@ public class GoblinFrontCubeController extends BaseController {
BeanUtils
.
copyProperties
(
goblinFrontCubeParam
,
goblinFrontCube
);
list1
.
add
(
goblinFrontCube
);
}
logger
.
info
(
"修改
banner
{}"
,
JSON
.
toJSONString
(
list
));
logger
.
info
(
"修改
或者删除魔方
{}"
,
JSON
.
toJSONString
(
list
));
boolean
result
=
goblinFrontCubeService
.
updateOrCreate
(
list1
);
if
(
result
)
{
return
success
(
"操作成功"
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
View file @
10f105fc
...
...
@@ -96,9 +96,15 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
}
return
list1
;
}
/**
* 魔方上线
* @return
*/
public
boolean
online
(){
LambdaQueryWrapper
<
GoblinFrontCube
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontCube
.
class
);
queryWrapper
.
ne
(
GoblinFrontCube:
:
getDelTag
,
1
);
queryWrapper
.
eq
(
GoblinFrontCube:
:
getType
,
1
);
List
<
GoblinFrontCube
>
list
=
goblinFrontCubeMapper
.
selectList
(
queryWrapper
);
if
(
list
.
size
()>
0
){
//mongodb
...
...
@@ -120,6 +126,31 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
return
true
;
}
public
boolean
onlineRecommend
(){
LambdaQueryWrapper
<
GoblinFrontCube
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontCube
.
class
);
queryWrapper
.
ne
(
GoblinFrontCube:
:
getDelTag
,
1
);
queryWrapper
.
eq
(
GoblinFrontCube:
:
getType
,
2
);
List
<
GoblinFrontCube
>
list
=
goblinFrontCubeMapper
.
selectList
(
queryWrapper
);
if
(
list
.
size
()>
0
){
//mongodb
for
(
GoblinFrontCube
goblinFrontCube:
list
){
GoblinFrontCube
goblinFrontCube1
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"cubeId"
).
is
(
goblinFrontCube
.
getCubeId
())),
GoblinFrontCube
.
class
,
GoblinFrontCube
.
class
.
getSimpleName
());
if
(
null
==
goblinFrontCube1
){
mongoTemplate
.
save
(
goblinFrontCube
,
GoblinFrontCube
.
class
.
getSimpleName
());
}
else
{
BasicDBObject
orderObject
=
new
BasicDBObject
(
"$set"
,
JSON
.
parse
(
JsonUtils
.
toJson
(
goblinFrontCube
)));
mongoTemplate
.
getCollection
(
GoblinFrontCube
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"cubeId"
).
is
(
goblinFrontCube
.
getCubeId
())).
getQueryObject
(),
orderObject
);
}
}
//redis
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_GOBLIN_RECOMMEND
,
list
);
}
return
true
;
}
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinFrontCube.java
View file @
10f105fc
...
...
@@ -70,5 +70,7 @@ public class GoblinFrontCube implements Serializable {
private
String
informationB
;
private
String
informationC
;
private
String
informationD
;
//1魔方2新品推荐
private
String
type
;
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
10f105fc
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
...
...
@@ -82,6 +83,11 @@ public class GoblinFrontController {
public
ResponseDto
<
GoblinFrontCubeVo
>
getCube
()
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
}
@GetMapping
(
"getRecommend"
)
@ApiOperation
(
"获取魔方"
)
public
ResponseDto
<
GoblinFrontCubeVo
>
getRecommend
()
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getRecommend
());
}
@GetMapping
(
"getCategoryList"
)
@ApiOperation
(
"获取分类列表商品( 1、销量优先、2、新品优先、3、价格降序、4、价格升序)"
)
public
ResponseDto
<
GoblinFrontCategoryListVo
>
getCategoryList
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
,
@RequestParam
(
name
=
"categoryId"
,
required
=
true
)
String
categoryId
,
@RequestParam
(
name
=
"page"
,
required
=
true
)
int
page
,
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
int
pageSize
)
throws
ParseException
{
...
...
@@ -118,7 +124,10 @@ public class GoblinFrontController {
@GetMapping
(
"searchGoodesName"
)
@ApiOperation
(
"搜索商品名字"
)
public
ResponseDto
<
List
<
GoblinGoodsInfoVo
>>
searchGoodesName
(
@RequestParam
(
name
=
"name"
,
required
=
true
)
String
name
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
searchGoodesName
(
name
));
if
(
StringUtil
.
isNotBlank
(
name
)){
return
ResponseDto
.
success
(
goblinFrontService
.
searchGoodesName
(
name
));
}
return
ResponseDto
.
success
(
null
);
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
10f105fc
...
...
@@ -292,6 +292,33 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
List
<
GoblinFrontMoudleIndex
>
list
=
(
List
<
GoblinFrontMoudleIndex
>)
redisUtil
.
get
(
GoblinRedisConst
.
MOUDLE_INDEX
);
return
list
;
}
/***
* @author zhangfuxin
* @Description:获取魔方
* @date 2022/1/10 下午4:49
*/
public
GoblinFrontCubeVo
getRecommend
(){
GoblinFrontCubeVo
goblinFrontCubeVo
=
GoblinFrontCubeVo
.
getNew
();
ArrayList
<
GoblinGoodsInfoVo
>
goblinGoodsInfoVoArrayList
=
ObjectUtil
.
getGoblinGoodsInfoVos
();
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
FRONT_GOBLIN_RECOMMEND
)){
return
null
;
}
List
<
GoblinFrontCube
>
list
=
(
List
<
GoblinFrontCube
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_GOBLIN_RECOMMEND
);
if
(
list
.
size
()>
0
){
BeanUtils
.
copyProperties
(
list
.
get
(
0
),
goblinFrontCubeVo
);
for
(
String
spuid:
goblinFrontCubeVo
.
getSpuId
().
split
(
","
)){
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuid
);
if
(
null
!=
goblinGoodsInfoVo
){
GoblinGoodsInfoVo
goblinGoodsInfoVo1
=
GoblinGoodsInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinGoodsInfoVo
,
goblinGoodsInfoVo1
);
goblinGoodsInfoVoArrayList
.
add
(
goblinGoodsInfoVo1
);
}
}
goblinFrontCubeVo
.
setGoblinGoodsInfoVoList
(
goblinGoodsInfoVoArrayList
);
}
return
goblinFrontCubeVo
;
}
/***
* @author zhangfuxin
* @Description:获取魔方
...
...
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