记得上下班打卡 | 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
f556c368
Commit
f556c368
authored
Apr 10, 2022
by
高虎
Committed by
GaoHu
Apr 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exit
parent
33038355
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
GoblinGoodsAnticipateVo.java
...uidnet/service/goblin/dto/vo/GoblinGoodsAnticipateVo.java
+4
-0
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+19
-1
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+1
-2
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsAnticipateVo.java
View file @
f556c368
...
...
@@ -72,6 +72,7 @@ public class GoblinGoodsAnticipateVo implements Serializable {
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createdDate
;
/**
...
...
@@ -86,6 +87,9 @@ public class GoblinGoodsAnticipateVo implements Serializable {
@ApiModelProperty
(
value
=
"删除(0:未删除1:已删除)"
)
private
Integer
delTag
;
@ApiModelProperty
(
value
=
"目前三种状态(0:未开始,1:预约中,2:已结束)"
)
private
Integer
state
;
/**
* 库存
*/
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
f556c368
...
...
@@ -52,9 +52,27 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
@Override
public
ResponseDto
<
PageInfo
<
GoblinGoodsAnticipateVo
>>
list
(
GoblinGoodsAnticipateParam
goodsAnticipateParam
)
{
PageInfo
<
GoblinGoodsAnticipateVo
>
pageInfo
=
new
PageInfo
();
PageInfo
<
GoblinGoodsAnticipateVo
>
pageInfo
=
new
PageInfo
<>
();
HashMap
<
String
,
Object
>
map
=
goblinMongoUtils
.
getGoblinGoodsAnticipateVos
(
goodsAnticipateParam
);
List
<
GoblinGoodsAnticipateVo
>
data
=
(
List
<
GoblinGoodsAnticipateVo
>)
map
.
get
(
"data"
);
for
(
GoblinGoodsAnticipateVo
goblinGoodsAnticipateVo
:
data
){
//预约开始时间
LocalDateTime
aboutStartDate
=
goblinGoodsAnticipateVo
.
getAboutStartDate
();
LocalDateTime
aboutEndDate
=
goblinGoodsAnticipateVo
.
getAboutEndDate
();
LocalDateTime
now
=
LocalDateTime
.
now
();
if
(
aboutStartDate
.
isBefore
(
now
)){
//未开始 0
goblinGoodsAnticipateVo
.
setState
(
0
);
}
if
(!
aboutStartDate
.
isBefore
(
now
)&&
aboutEndDate
.
isAfter
(
now
)){
//预约中
goblinGoodsAnticipateVo
.
setState
(
1
);
}
if
(
aboutEndDate
.
isBefore
(
now
)){
//已结束
goblinGoodsAnticipateVo
.
setState
(
2
);
}
}
pageInfo
.
setList
(
data
);
pageInfo
.
setTotal
((
Long
)
map
.
get
(
"total"
));
return
ResponseDto
.
success
(
pageInfo
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
f556c368
...
...
@@ -60,8 +60,7 @@ public class GoblinMongoUtils {
public
HashMap
<
String
,
Object
>
getGoblinGoodsAnticipateVos
(
GoblinGoodsAnticipateParam
goodsAnticipateParam
)
{
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
Pageable
pageable
=
PageRequest
.
of
(
goodsAnticipateParam
.
getPageNum
()
-
1
,
goodsAnticipateParam
.
getPageSize
(),
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdDate"
));
Criteria
criteria
=
Criteria
.
where
(
"delFlg"
).
is
(
"0"
);
Criteria
criteria
=
Criteria
.
where
(
"delTag"
).
is
(
0
);
if
(
StringUtils
.
isNotBlank
(
goodsAnticipateParam
.
getName
()))
{
criteria
=
criteria
.
and
(
"name"
).
is
(
goodsAnticipateParam
.
getName
());
}
...
...
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