Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
huluobin
gogirl-miniapp-backend
Commits
986e1bbe
Commit
986e1bbe
authored
Oct 12, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6768c80d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
ScheduleManageServiceImpl.java
...plication/order/serve/impl/ScheduleManageServiceImpl.java
+11
-7
No files found.
src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
View file @
986e1bbe
...
...
@@ -233,6 +233,10 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
departmentId
,
serveStartTime
.
toLocalDate
().
toString
(),
Lists
.
newArrayList
(
serveId
));
//下班时间加上,下班时间不属于闲时
storeTechnicianPeriodList
.
forEach
(
storeTechnicianPeriod
->
{
storeTechnicianPeriod
.
getPeriodList
().
add
(
storeTechnicianPeriod
.
getBreakTime
());
});
//服务占用的时间区间
Period
servePeriod
=
new
Period
(
serveStartTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
(),
serveEndTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
());
...
...
@@ -315,10 +319,10 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
List
<
IdleTimeDTO
>
idleTimeDTOList
=
new
ArrayList
<>(
qry
.
getDateTimeList
().
size
());
//
ExecutorService threadPool = ThreadUtil.newExecutor(qry.getDateTimeList().size());
ExecutorService
threadPool
=
ThreadUtil
.
newExecutor
(
qry
.
getDateTimeList
().
size
());
for
(
Long
dateTime
:
qry
.
getDateTimeList
())
{
//
threadPool.submit(() -> {
//
System.out.println("threadName:" + Thread.currentThread().getName());
threadPool
.
submit
(()
->
{
System
.
out
.
println
(
"threadName:"
+
Thread
.
currentThread
().
getName
());
//每个主服务由不同的美甲师做,setter主服务的时间period
mainScheduleServeQueryLinkedList
.
forEach
(
mainScheduleServeQuery
->
{
...
...
@@ -350,16 +354,16 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
idleTimeDTO
.
setDefaultNodeList
(
defaultNodeList
);
idleTimeDTOList
.
add
(
idleTimeDTO
);
//
});
});
}
//
threadPool.shutdown();
threadPool
.
shutdown
();
//等待直到所有任务完成
/*
try {
try
{
threadPool
.
awaitTermination
(
Long
.
MAX_VALUE
,
TimeUnit
.
MINUTES
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
*/
}
if
(
qry
.
getShowNodeDetail
()
!=
null
&&
!
qry
.
getShowNodeDetail
())
{
idleTimeDTOList
.
forEach
(
idleTimeDTO
->
{
...
...
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