Commit e1423902 by 刘鑫

fix(容量): 改约单如果是当天单子 纳入容量计算

1 parent 295c2b34
......@@ -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);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!