Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
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
pseer
gxpt_ht
Commits
b1e633ed
Commit
b1e633ed
authored
Mar 27, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉房间最后预定时间查询
parent
28dfeabc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+22
-22
No files found.
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
b1e633ed
...
@@ -137,12 +137,12 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -137,12 +137,12 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
wrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
wrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
orderService
.
list
(
wrapper
);
List
<
SOrder
>
list
=
orderService
.
list
(
wrapper
);
// 查询每一个房间最后一条预定订单下单时间
// 查询每一个房间最后一条预定订单下单时间
Date
now
=
DateUtil
.
date
();
//
Date now = DateUtil.date();
SOrder
orderQuery
=
new
SOrder
();
//
SOrder orderQuery = new SOrder();
orderQuery
.
setStoreId
(
store
.
getId
());
//
orderQuery.setStoreId(store.getId());
orderQuery
.
setCreateTime
(
now
);
//
orderQuery.setCreateTime(now);
List
<
SOrder
>
orderList
=
orderService
.
selectSOrderByMaxTime
(
orderQuery
);
//
List<SOrder> orderList = orderService.selectSOrderByMaxTime(orderQuery);
Map
<
Long
,
SOrder
>
roomOrder
=
Optional
.
ofNullable
(
orderList
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
toMap
(
SOrder:
:
getRoomId
,
Function
.
identity
()));
//
Map<Long, SOrder> roomOrder = Optional.ofNullable(orderList).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(SOrder::getRoomId, Function.identity()));
roomList
.
stream
().
forEach
(
sRoom
->
{
roomList
.
stream
().
forEach
(
sRoom
->
{
SRoomVo
vo
=
new
SRoomVo
();
SRoomVo
vo
=
new
SRoomVo
();
...
@@ -174,22 +174,22 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -174,22 +174,22 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
});
});
}
}
// 计算当天预定最后预定时间
// 计算当天预定最后预定时间
SOrder
order
=
roomOrder
.
get
(
vo
.
getId
());
//
SOrder order = roomOrder.get(vo.getId());
if
(
order
!=
null
)
{
//
if (order != null) {
long
betweenMinute
=
DateUtil
.
between
(
order
.
getCreateTime
(),
now
,
DateUnit
.
MINUTE
);
//
long betweenMinute = DateUtil.between(order.getCreateTime(), now, DateUnit.MINUTE);
if
(
betweenMinute
<
60
)
{
//
if (betweenMinute < 60) {
vo
.
setOrderTimeType
(
1
);
//
vo.setOrderTimeType(1);
vo
.
setOrderTime
(
betweenMinute
);
//
vo.setOrderTime(betweenMinute);
}
else
{
//
} else {
long
betweenHour
=
DateUtil
.
between
(
order
.
getCreateTime
(),
now
,
DateUnit
.
HOUR
);
//
long betweenHour = DateUtil.between(order.getCreateTime(), now, DateUnit.HOUR);
vo
.
setOrderTimeType
(
2
);
//
vo.setOrderTimeType(2);
vo
.
setOrderTime
(
betweenHour
);
//
vo.setOrderTime(betweenHour);
}
//
}
vo
.
setOrderType
(
order
.
getOrderType
());
//
vo.setOrderType(order.getOrderType());
}
else
{
//
} else {
vo
.
setOrderTimeType
(
0
);
//
vo.setOrderTimeType(0);
vo
.
setOrderTime
(
0L
);
//
vo.setOrderTime(0L);
}
//
}
voList
.
add
(
vo
);
voList
.
add
(
vo
);
});
});
}
}
...
...
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