Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b7a21942
authored
Nov 10, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
2 parents
84c9d6f7
0a89d6ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
project-order/src/main/java/com/dituhui/pea/order/common/CapacityUtils.java
project-order/src/main/java/com/dituhui/pea/order/scheduler/CalcEngineerCapacityScheduler.java
project-order/src/main/java/com/dituhui/pea/order/common/CapacityUtils.java
View file @
b7a2194
...
...
@@ -101,8 +101,26 @@ public class CapacityUtils {
// 工单已使用的时间片
List
<
OccupyInfoDetail
>
order
=
Optional
.
ofNullable
(
orders
).
orElse
(
Collections
.
emptyList
())
.
stream
()
.
filter
(
t
->
DateUtil
.
checkTimesHasOverlap
(
t
.
getPlanStartTime
(),
t
.
getPlanEndTime
(),
startTime
,
endTime
))
.
map
(
e
->
DateUtil
.
intersection
(
e
.
getPlanStartTime
(),
e
.
getPlanEndTime
(),
startTime
,
endTime
))
.
filter
(
t
->
{
String
serviceStatus
=
t
.
getServiceStatus
();
LocalDateTime
checkStartTime
=
t
.
getPlanStartTime
();
LocalDateTime
checkEndTime
=
t
.
getPlanEndTime
();
if
(
Objects
.
equals
(
serviceStatus
,
"FINISHED"
))
{
checkStartTime
=
t
.
getActualStartTime
();
checkEndTime
=
t
.
getActualEndTime
();
}
return
DateUtil
.
checkTimesHasOverlap
(
checkStartTime
,
checkEndTime
,
startTime
,
endTime
);
})
.
map
(
e
->
{
String
serviceStatus
=
e
.
getServiceStatus
();
LocalDateTime
checkStartTime
=
e
.
getPlanStartTime
();
LocalDateTime
checkEndTime
=
e
.
getPlanEndTime
();
if
(
Objects
.
equals
(
serviceStatus
,
"FINISHED"
))
{
checkStartTime
=
e
.
getActualStartTime
();
checkEndTime
=
e
.
getActualEndTime
();
}
return
DateUtil
.
intersection
(
checkStartTime
,
checkEndTime
,
startTime
,
endTime
);
})
.
collect
(
Collectors
.
toList
());
List
<
OccupyInfoDetail
>
resultList
=
Stream
.
of
(
calendar
,
order
).
flatMap
(
Collection:
:
stream
).
collect
(
Collectors
.
toList
());
...
...
project-order/src/main/java/com/dituhui/pea/order/scheduler/CalcEngineerCapacityScheduler.java
View file @
b7a2194
...
...
@@ -31,6 +31,7 @@ import java.time.LocalTime;
import
java.time.ZoneId
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
...
...
@@ -84,8 +85,9 @@ public class CalcEngineerCapacityScheduler {
return
;
}
Set
<
String
>
ss
=
Set
.
of
(
"CANCELED"
,
"RESCHEDULED"
);
List
<
OrderInfoEntity
>
orders
=
orderInfoDao
.
findByDtAndEngineerCode
(
DateUtils
.
localDateFromStr
(
date
),
engineerCode
);
final
LocalDate
nowDate
=
DateUtils
.
localDateFromStr
(
date
);
Set
<
String
>
ss
=
Set
.
of
(
"CANCELED"
);
List
<
OrderInfoEntity
>
orders
=
orderInfoDao
.
findByDtAndEngineerCode
(
nowDate
,
engineerCode
);
// 根据capacity_engineer_calendar和order_info,来确定当天剩下的最大连续时间区块;
EngineerBusinessEntity
businessEntity
=
engineerBusinessDao
.
getByEngineerCode
(
engineerCode
);
// 就算单小时时间段工程师技能已用容量存储至时间切片工程师时间表内
...
...
@@ -95,6 +97,15 @@ public class CalcEngineerCapacityScheduler {
orders
=
Optional
.
ofNullable
(
orders
).
orElse
(
Collections
.
emptyList
())
.
stream
()
.
filter
(
e
->
!
ss
.
contains
(
e
.
getOrderStatus
()))
.
filter
(
order
->
{
if
(!
"RESCHEDULED"
.
equals
(
order
.
getServiceStatus
()))
{
return
true
;
}
if
(
Objects
.
equals
(
nowDate
,
order
.
getPlanStartTime
().
toLocalDate
()))
{
return
true
;
}
return
false
;
})
.
collect
(
Collectors
.
toList
());
initOneEngineerTimeSlot
(
date
,
engineerCode
,
configs
,
orders
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment