记得上下班打卡 | 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
9092085a
Commit
9092085a
authored
Jun 02, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hjc_goblin_list_unbox' into hjc_goblin_list_unbox
parents
5ff3fa7d
c1c29d86
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
10 deletions
+73
-10
GoblinGoodsInfoListVoo.java
...quidnet/service/goblin/dto/vo/GoblinGoodsInfoListVoo.java
+31
-0
GoblinFrontCubeController.java
...controller/zhengzai/goblin/GoblinFrontCubeController.java
+7
-0
GoblinFrontCubeServiceImpl.java
...ngzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
+22
-2
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+2
-5
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+11
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsInfoListVoo.java
0 → 100644
View file @
9092085a
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinGoodsInfoListVo"
,
description
=
"商品SPU List"
)
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
GoblinGoodsInfoListVoo
implements
Serializable
,
Cloneable
{
private
List
<
GoblinGoodsInfoListVo
>
list
;
@ApiModelProperty
(
position
=
55
,
value
=
"数量"
)
private
long
count
;
private
static
final
GoblinGoodsInfoListVoo
obj
=
new
GoblinGoodsInfoListVoo
();
public
static
GoblinGoodsInfoListVoo
getNew
()
{
try
{
return
(
GoblinGoodsInfoListVoo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinGoodsInfoListVoo
();
}
}
/* public int compareTo(GoblinGoodsInfoVo arg0) {
return this.getCount().compareTo(arg0.getCount());
}*/
}
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 @
9092085a
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.impl.GoblinFrontCubeServiceImpl
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.goblin.entity.GoblinFrontCube
;
import
com.liquidnet.service.goblin.param.GoblinFrontCubeParam
;
import
io.swagger.annotations.Api
;
...
...
@@ -52,6 +53,12 @@ public class GoblinFrontCubeController extends BaseController {
public
AjaxResult
updateOrCreate
(
@RequestBody
List
<
GoblinFrontCubeParam
>
list
)
{
List
<
GoblinFrontCube
>
list1
=
new
ArrayList
<>();
for
(
GoblinFrontCubeParam
goblinFrontCubeParam:
list
){
if
(
StringUtil
.
isBlank
(
goblinFrontCubeParam
.
getSpuId
())||
goblinFrontCubeParam
.
getSpuId
().
equals
(
"undefined"
)){
return
error
(
"spuId必传,请填写"
);
}
if
(
goblinFrontCubeParam
.
getSpuId
().
split
(
","
).
length
==
0
){
return
error
(
"spuId必传,请填写"
);
}
GoblinFrontCube
goblinFrontCube
=
new
GoblinFrontCube
();
BeanUtils
.
copyProperties
(
goblinFrontCubeParam
,
goblinFrontCube
);
list1
.
add
(
goblinFrontCube
);
...
...
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 @
9092085a
...
...
@@ -67,6 +67,17 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
public
boolean
updateOrCreate
(
List
<
GoblinFrontCube
>
list
)
{
for
(
GoblinFrontCube
goblinFrontCube:
list
){
if
(
goblinFrontCube
.
getMid
()
==
0
)
{
String
spuIds
=
""
;
for
(
String
spuId:
goblinFrontCube
.
getSpuId
().
split
(
","
)){
if
(
spuId
.
equals
(
""
)||
spuId
.
equals
(
"undefined"
)){
}
else
{
spuIds
=
spuIds
.
concat
(
spuId
).
concat
(
","
);
}
}
if
(
spuIds
.
length
()>
0
){
goblinFrontCube
.
setSpuId
(
spuIds
.
substring
(
0
,
spuIds
.
length
()-
1
));
}
this
.
create
(
goblinFrontCube
);
}
else
{
goblinFrontCube
.
setUpdateTime
(
LocalDateTime
.
now
());
...
...
@@ -79,7 +90,10 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
spuIds
=
spuIds
.
concat
(
spuId
).
concat
(
","
);
}
}
goblinFrontCube
.
setSpuId
(
spuIds
);
if
(
spuIds
.
length
()>
0
){
goblinFrontCube
.
setSpuId
(
spuIds
.
substring
(
0
,
spuIds
.
length
()-
1
));
}
goblinFrontCubeMapper
.
updateById
(
goblinFrontCube
);
}
}
...
...
@@ -107,7 +121,9 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
List
<
GoblinGoods
>
goodsList
=
goblinGoodsMapper
.
selectList
(
queryWrappers
);
GoblinFrontCubeParam
goblinFrontCubeParam
=
new
GoblinFrontCubeParam
();
BeanUtils
.
copyProperties
(
goblinFrontCube
,
goblinFrontCubeParam
);
goblinFrontCubeParam
.
setGoblinGoods
(
goodsList
.
get
(
0
));
if
(
null
!=
goodsList
&&
goodsList
.
size
()>
0
){
goblinFrontCubeParam
.
setGoblinGoods
(
goodsList
.
get
(
0
));
}
list1
.
add
(
goblinFrontCubeParam
);
}
}
...
...
@@ -139,6 +155,8 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
}
//redis
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_GOBLINFRONTCUBE
,
list
);
}
else
{
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_GOBLINFRONTCUBE
,
list
);
}
return
true
;
...
...
@@ -164,6 +182,8 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
}
//redis
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_GOBLIN_RECOMMEND
,
list
);
}
else
{
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_GOBLIN_RECOMMEND
,
list
);
}
return
true
;
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
9092085a
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
;
import
com.liquidnet.service.goblin.service.GoblinFrontService
;
import
com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -134,9 +131,9 @@ public class GoblinFrontController {
@GetMapping
(
"searchGoodesName"
)
@ApiOperation
(
"搜索商品名字、或商铺名字"
)
public
ResponseDto
<
List
<
GoblinGoodsInfoListVo
>>
searchGoodesName
(
@RequestParam
(
name
=
"name"
,
required
=
true
)
String
nam
e
)
throws
ParseException
{
public
ResponseDto
<
GoblinGoodsInfoListVoo
>
searchGoodesName
(
@RequestParam
(
name
=
"name"
,
required
=
true
)
String
name
,
@RequestParam
(
name
=
"page"
,
required
=
true
)
int
page
,
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
int
pageSiz
e
)
throws
ParseException
{
if
(
StringUtil
.
isNotBlank
(
name
))
{
return
ResponseDto
.
success
(
goblinFrontService
.
searchGoodesName
(
name
));
return
ResponseDto
.
success
(
goblinFrontService
.
searchGoodesName
(
name
,
page
,
pageSize
));
}
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 @
9092085a
...
...
@@ -380,6 +380,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
goblinFrontCubeVo
.
setGoblinGoodsInfoVoList
(
goblinGoodsInfoVoArrayList
);
}
else
{
return
null
;
}
return
goblinFrontCubeVo
;
}
...
...
@@ -463,7 +465,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
public
List
<
GoblinGoodsInfoListVo
>
searchGoodesName
(
String
nam
e
)
{
public
GoblinGoodsInfoListVoo
searchGoodesName
(
String
name
,
int
page
,
int
pageSiz
e
)
{
List
<
String
>
listStore
=
mongoUtils
.
getStoreInfoVoRegexName
(
name
);
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
Query
query
=
new
Query
();
...
...
@@ -475,11 +477,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
),
new
Criteria
().
orOperator
(
Criteria
.
where
(
"spuType"
).
exists
(
false
),
(
Criteria
.
where
(
"spuType"
).
is
(
0
)))
));
query
.
with
(
PageRequest
.
of
(
0
,
20
)).
with
(
Sort
.
by
(
long
count
=
mongoTemplate
.
count
(
query
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
query
.
with
(
PageRequest
.
of
(
page
,
pageSize
)).
with
(
Sort
.
by
(
//Sort.Order.desc("count"),
Sort
.
Order
.
desc
(
"shelvesAt"
)
));
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
GoblinGoodsInfoListVoo
goblinGoodsInfoListVoo
=
GoblinGoodsInfoListVoo
.
getNew
();
goblinGoodsInfoListVoo
.
setCount
(
count
);
ArrayList
<
GoblinGoodsInfoListVo
>
list1
=
ObjectUtil
.
getGoblinGoodsInfoListVo
();
//遍历
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo
:
list
)
{
...
...
@@ -507,7 +513,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
list1
.
add
(
goblinGoodsInfoListVo
);
}
}
return
list1
;
goblinGoodsInfoListVoo
.
setList
(
list1
);
return
goblinGoodsInfoListVoo
;
//return list1;
}
public
GoblinFrontCategoryListVo
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
)
{
...
...
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