记得上下班打卡 | 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
02bfee45
Commit
02bfee45
authored
Jan 14, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类列表
parent
14591028
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
0 deletions
+74
-0
GoblinGoodsInfoVo.java
...om/liquidnet/service/goblin/dto/vo/GoblinGoodsInfoVo.java
+30
-0
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+5
-0
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+39
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsInfoVo.java
View file @
02bfee45
...
@@ -10,6 +10,9 @@ import lombok.Data;
...
@@ -10,6 +10,9 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinGoodsInfoVo"
,
description
=
"商品SPU详情[不包含具体SKU,SKU详情参见'GoblinGoobsSkuInfoVo']"
)
@ApiModel
(
value
=
"GoblinGoodsInfoVo"
,
description
=
"商品SPU详情[不包含具体SKU,SKU详情参见'GoblinGoobsSkuInfoVo']"
)
...
@@ -104,6 +107,8 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
...
@@ -104,6 +107,8 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private
List
<
GoblinGoodsExtagVo
>
extagVoList
;
private
List
<
GoblinGoodsExtagVo
>
extagVoList
;
@ApiModelProperty
(
position
=
55
,
value
=
"活动Id"
)
@ApiModelProperty
(
position
=
55
,
value
=
"活动Id"
)
private
String
marketId
;
private
String
marketId
;
@ApiModelProperty
(
position
=
56
,
value
=
"销量"
)
private
Integer
count
;
@ApiModelProperty
(
position
=
55
,
value
=
"SPU包含的SKU_ID列表"
)
@ApiModelProperty
(
position
=
55
,
value
=
"SPU包含的SKU_ID列表"
)
private
List
<
String
>
skuIdList
;
private
List
<
String
>
skuIdList
;
...
@@ -117,4 +122,29 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
...
@@ -117,4 +122,29 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
return
new
GoblinGoodsInfoVo
();
return
new
GoblinGoodsInfoVo
();
}
}
}
}
/* public int compareTo(GoblinGoodsInfoVo arg0) {
return this.getCount().compareTo(arg0.getCount());
}*/
public
static
void
main
(
String
[]
args
)
{
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
new
GoblinGoodsInfoVo
();
goblinGoodsInfoVo
.
setCount
(
1
);
GoblinGoodsInfoVo
goblinGoodsInfoVo1
=
new
GoblinGoodsInfoVo
();
goblinGoodsInfoVo1
.
setCount
(
12
);
GoblinGoodsInfoVo
goblinGoodsInfoVo2
=
new
GoblinGoodsInfoVo
();
goblinGoodsInfoVo2
.
setCount
(
12
);
List
<
GoblinGoodsInfoVo
>
list
=
new
ArrayList
<>();
list
.
add
(
goblinGoodsInfoVo1
);
list
.
add
(
goblinGoodsInfoVo
);
list
.
add
(
goblinGoodsInfoVo2
);
Collections
.
sort
(
list
,
new
Comparator
<
GoblinGoodsInfoVo
>()
{
public
int
compare
(
GoblinGoodsInfoVo
arg0
,
GoblinGoodsInfoVo
arg1
)
{
return
-(
arg0
.
getCount
().
compareTo
(
arg1
.
getCount
()));
}});
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo3:
list
){
System
.
out
.
println
(
goblinGoodsInfoVo3
.
getCount
());
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
02bfee45
...
@@ -86,6 +86,11 @@ public class GoblinFrontController {
...
@@ -86,6 +86,11 @@ public class GoblinFrontController {
public
ResponseDto
getCube
()
throws
ParseException
{
public
ResponseDto
getCube
()
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
}
}
@GetMapping
(
"getCategory"
)
@ApiOperation
(
"获取分类"
)
public
ResponseDto
getCategory
(
String
type
,
String
categoryId
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
02bfee45
...
@@ -17,6 +17,9 @@ import com.mongodb.BasicDBObject;
...
@@ -17,6 +17,9 @@ import com.mongodb.BasicDBObject;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
...
@@ -259,6 +262,42 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -259,6 +262,42 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
goblinFrontCubeVo
;
return
goblinFrontCubeVo
;
}
}
/**
* 获取分类列表
* 1、销量优先、2、新品优先、3、价格降序、4、价格升序
*/
public
void
getCategoryList
(
String
type
,
String
categoryId
,
int
page
,
int
pageSize
){
//
Query
query
=
new
Query
();
//Criteria.where("cateSid").is(categoryId)
query
.
addCriteria
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"cateSid"
).
is
(
categoryId
),
Criteria
.
where
(
"cateTid"
).
is
(
categoryId
)
));
Pageable
pageable
=
null
;
//
boolean
isRe
=
false
;
if
(
type
.
equals
(
"1"
)){
isRe
=
true
;
}
else
if
(
type
.
equals
(
"2"
)){
pageable
=
PageRequest
.
of
(
page
,
pageSize
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"shelvesAt"
));
}
else
if
(
type
.
equals
(
"3"
)){
pageable
=
PageRequest
.
of
(
page
,
pageSize
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"priceGe"
));
}
else
if
(
type
.
equals
(
"4"
)){
pageable
=
PageRequest
.
of
(
page
,
pageSize
,
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"priceGe"
));
}
// 排序 分页
// Query query = Query.query(Criteria.where("status").ne(1).and("status").ne(0));
// 查询总数
long
count
=
mongoTemplate
.
count
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
if
(!
isRe
){
query
.
with
(
pageable
);
}
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
}
/**
/**
* @author zhangfuxin
* @author zhangfuxin
...
...
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