Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2025-04-16 16:48:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
67e5371429281e7644051f5970baa316043442f2
67e53714
1 parent
2c166ecd
fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
src/main/java/com/infoloop/tianting/service/impl/MealOrderServiceImpl.java
src/main/java/com/infoloop/tianting/service/impl/MealOrderServiceImpl.java
View file @
67e5371
...
...
@@ -41,14 +41,15 @@ public class MealOrderServiceImpl implements MealOrderService {
final
var
loginInfo
=
LoginContextHolder
.
getLoginInfo
();
var
mealOrderRpcResponses
=
mealOrderServiceRpcClient
.
queryMealOrdersByCondition
(
loginInfo
.
getEnterpriseId
(),
loginInfo
.
getId
(),
null
,
null
);
final
var
today
=
LocalDate
.
now
();
final
var
startTimestamp
=
today
.
with
(
DayOfWeek
.
MONDAY
).
atStartOfDay
().
atZone
(
DateUtil
.
CHINA_ZONE
).
toInstant
().
toEpochMilli
();
final
var
endTimestamp
=
today
.
with
(
DayOfWeek
.
SUNDAY
).
atTime
(
LocalTime
.
MAX
).
atZone
(
DateUtil
.
CHINA_ZONE
).
toInstant
().
toEpochMilli
();
final
var
lastWeekStart
=
today
.
minusWeeks
(
1
).
with
(
DayOfWeek
.
MONDAY
).
atStartOfDay
().
atZone
(
DateUtil
.
CHINA_ZONE
).
toInstant
().
toEpochMilli
();
final
var
lastWeekEnd
=
today
.
minusWeeks
(
1
).
with
(
DayOfWeek
.
SUNDAY
).
atTime
(
LocalTime
.
MAX
).
atZone
(
DateUtil
.
CHINA_ZONE
).
toInstant
().
toEpochMilli
();
final
var
thisWeekStart
=
today
.
with
(
DayOfWeek
.
MONDAY
).
atStartOfDay
().
atZone
(
DateUtil
.
CHINA_ZONE
).
toInstant
().
toEpochMilli
();
if
(
queryMealOrderDTO
.
getStatus
()
==
QueryMealOrderStatusEnum
.
COMPLETED
)
{
mealOrderRpcResponses
=
mealOrderRpcResponses
.
stream
().
filter
(
e
->
e
.
getReserveDate
()
<
startTimestamp
).
toList
();
mealOrderRpcResponses
=
mealOrderRpcResponses
.
stream
().
filter
(
e
->
e
.
getReserveDate
()
<
lastWeekStart
).
toList
();
}
else
if
(
queryMealOrderDTO
.
getStatus
()
==
QueryMealOrderStatusEnum
.
UNDER_WAY
)
{
mealOrderRpcResponses
=
mealOrderRpcResponses
.
stream
().
filter
(
e
->
e
.
getReserveDate
()
>=
startTimestamp
&&
e
.
getReserveDate
()
<=
endTimestamp
).
toList
();
mealOrderRpcResponses
=
mealOrderRpcResponses
.
stream
().
filter
(
e
->
e
.
getReserveDate
()
>=
lastWeekStart
&&
e
.
getReserveDate
()
<=
lastWeekEnd
).
toList
();
}
else
if
(
queryMealOrderDTO
.
getStatus
()
==
QueryMealOrderStatusEnum
.
BE_BOOKED
)
{
mealOrderRpcResponses
=
mealOrderRpcResponses
.
stream
().
filter
(
e
->
e
.
getReserveDate
()
>
endTimestamp
).
toList
();
mealOrderRpcResponses
=
mealOrderRpcResponses
.
stream
().
filter
(
e
->
e
.
getReserveDate
()
>
thisWeekStart
).
toList
();
}
return
mealOrderRpcResponses
.
stream
().
map
(
this
::
getMealOrderById
).
toList
();
}
...
...
Please
register
or
login
to post a comment