Commit 295c2b34 by 刘鑫

fix(容量): 已完结单子容量时间以实际开始结束时间计算

1 parent 34bac347
......@@ -101,7 +101,16 @@ public class CapacityUtils {
// 工单已使用的时间片
List<OccupyInfoDetail> order = Optional.ofNullable(orders).orElse(Collections.emptyList())
.stream()
.filter(t -> DateUtil.checkTimesHasOverlap(t.getPlanStartTime(), t.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 -> DateUtil.intersection(e.getPlanStartTime(), e.getPlanEndTime(), startTime, endTime))
.collect(Collectors.toList());
List<OccupyInfoDetail> resultList = Stream.of(calendar, order).flatMap(Collection::stream).collect(Collectors.toList());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!