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 8363d5f6
authored
Nov 08, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(工程师时间片容量): 时间片容量存在负值情况, 修订计算订单与休息时间时进行已用时间段并集运算,避免重复时间交叉计算
1 parent
049f4fd0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
project-order/src/main/java/com/dituhui/pea/order/common/jackson/DateUtil.java
project-order/src/main/java/com/dituhui/pea/order/common/jackson/DateUtil.java
View file @
8363d5f
...
...
@@ -2,6 +2,7 @@ package com.dituhui.pea.order.common.jackson;
import
com.dituhui.pea.order.common.DateSplit
;
import
com.dituhui.pea.order.common.OccupyInfo
;
import
com.dituhui.pea.order.common.OccupyInfoDetail
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.util.Assert
;
...
...
@@ -490,14 +491,14 @@ public class DateUtil {
// 计算两个时间片的交集
public
OccupyInfo
intersection
(
LocalDateTime
dynaStartTime
,
LocalDateTime
dynaEndTime
,
public
OccupyInfo
Detail
intersection
(
LocalDateTime
dynaStartTime
,
LocalDateTime
dynaEndTime
,
LocalDateTime
fixedStartTime
,
LocalDateTime
fixedEndTime
)
{
// 如果两个时间片没有交集,返回null
if
(!
checkTimesHasOverlap
(
dynaStartTime
,
dynaEndTime
,
fixedStartTime
,
fixedEndTime
))
{
return
null
;
}
// 否则,返回一个新的时间片,其开始时间是两个时间片中较晚的开始时间,其结束时间是两个时间片中较早的结束时间
return
new
OccupyInfo
(
dynaStartTime
.
isAfter
(
fixedStartTime
)
?
dynaStartTime
:
fixedStartTime
,
return
new
OccupyInfo
Detail
(
dynaStartTime
.
isAfter
(
fixedStartTime
)
?
dynaStartTime
:
fixedStartTime
,
dynaEndTime
.
isBefore
(
fixedEndTime
)
?
dynaEndTime
:
fixedEndTime
);
}
...
...
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