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 875668d8
authored
Nov 21, 2023
by
Ren Ping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:自动排班结束时间也需要在时间窗内
1 parent
2e7911f9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/constraint/DispatchConstraintProvider.java
project-dispatch/src/main/resources/application-dev.yaml
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/constraint/DispatchConstraintProvider.java
View file @
875668d
...
@@ -67,8 +67,12 @@ public class DispatchConstraintProvider implements ConstraintProvider {
...
@@ -67,8 +67,12 @@ public class DispatchConstraintProvider implements ConstraintProvider {
Integer
arrivalTime
=
customer
.
getArrivalTime
();
Integer
arrivalTime
=
customer
.
getArrivalTime
();
if
(
arrivalTime
!=
null
&&
arrivalTime
>
0
)
{
if
(
arrivalTime
!=
null
&&
arrivalTime
>
0
)
{
boolean
in
=
false
;
boolean
in
=
false
;
Integer
departureTime
=
customer
.
getDepartureTime
();
for
(
int
[]
window
:
timeWindows
)
{
for
(
int
[]
window
:
timeWindows
)
{
if
(
window
[
0
]
<=
arrivalTime
&&
window
[
1
]
>=
arrivalTime
)
{
if
(
window
[
0
]
<=
arrivalTime
&&
window
[
1
]
>=
arrivalTime
&&
window
[
0
]
<=
departureTime
&&
window
[
1
]
>=
departureTime
)
{
in
=
true
;
in
=
true
;
break
;
break
;
}
}
...
...
project-dispatch/src/main/resources/application-dev.yaml
View file @
875668d
...
@@ -3,7 +3,7 @@ server:
...
@@ -3,7 +3,7 @@ server:
dispatch
:
dispatch
:
cron
:
cron
:
expr
:
0 3
7
8-23 * * ?
expr
:
0 3
5
8-23 * * ?
next-day-limit
:
2
next-day-limit
:
2
scheduler
:
scheduler
:
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
View file @
875668d
...
@@ -149,7 +149,7 @@ public class ScheduleServiceImpl implements ScheduleService {
...
@@ -149,7 +149,7 @@ public class ScheduleServiceImpl implements ScheduleService {
child
.
setOrderDesc
(
Integer
.
toString
(
orders2
.
size
()));
child
.
setOrderDesc
(
Integer
.
toString
(
orders2
.
size
()));
Integer
distanceSum
=
orders2
.
stream
().
map
(
order
->
Objects
.
nonNull
(
order
.
getArriveDistance
())
?
order
.
getArriveDistance
()
:
0
).
reduce
(
Integer:
:
sum
).
orElse
(
0
);
Integer
distanceSum
=
orders2
.
stream
().
map
(
order
->
Objects
.
nonNull
(
order
.
getArriveDistance
())
?
order
.
getArriveDistance
()
:
0
).
reduce
(
Integer:
:
sum
).
orElse
(
0
);
teamDistance
+=
distanceSum
;
teamDistance
+=
distanceSum
;
child
.
setDistanceDesc
(
distanceSum
+
""
);
child
.
setDistanceDesc
(
distanceSum
/
1000.0
+
""
);
children
.
add
(
child
);
children
.
add
(
child
);
...
@@ -189,8 +189,8 @@ public class ScheduleServiceImpl implements ScheduleService {
...
@@ -189,8 +189,8 @@ public class ScheduleServiceImpl implements ScheduleService {
teamEngineers
.
size
()
>
0
?
new
BigDecimal
(
teamDistance
)
teamEngineers
.
size
()
>
0
?
new
BigDecimal
(
teamDistance
)
.
divide
(
new
BigDecimal
(
teamEngineers
.
size
()),
2
,
RoundingMode
.
HALF_UP
)
.
divide
(
new
BigDecimal
(
teamEngineers
.
size
()),
2
,
RoundingMode
.
HALF_UP
)
.
stripTrailingZeros
()
:
0
,
.
stripTrailingZeros
()
:
0
,
minDistance
,
minDistance
/
1000.0
,
maxDistance
));
maxDistance
/
1000.0
));
teams
.
add
(
team
);
teams
.
add
(
team
);
}
}
...
...
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