|
|
|
@ -757,7 +757,8 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
|
|
public List<BigDecimal> capacitySplit(Map<LocalDateTime, List<EquipResourceEntity>> map, BigDecimal sumCapacity) { |
|
|
|
public List<BigDecimal> capacitySplit(Map<LocalDateTime, List<EquipResourceEntity>> map, BigDecimal sumCapacity) { |
|
|
|
List<EquipResourceEntity> equipResourceList1 = map.values().stream().flatMap(List::stream).collect(Collectors.toList()); |
|
|
|
List<EquipResourceEntity> equipResourceList1 = map.values().stream().flatMap(List::stream).collect(Collectors.toList()); |
|
|
|
BigDecimal maxRestCapacity = equipResourceList1.stream().filter(entity -> entity.getRestCapacity().compareTo(BigDecimal.ZERO) >= 0).map(EquipResourceEntity::getRestCapacity).max(BigDecimal::compareTo).orElseThrow(() -> new IllegalArgumentException("列表中无有效的 restCapacity 数值"));; |
|
|
|
BigDecimal maxRestCapacity = equipResourceList1.stream().filter(entity -> entity.getRestCapacity().compareTo(BigDecimal.ZERO) >= 0).map(EquipResourceEntity::getRestCapacity).max(BigDecimal::compareTo).orElseThrow(() -> new IllegalArgumentException("列表中无有效的 restCapacity 数值")); |
|
|
|
|
|
|
|
; |
|
|
|
List<BigDecimal> capacityList = new ArrayList<>(); |
|
|
|
List<BigDecimal> capacityList = new ArrayList<>(); |
|
|
|
if (sumCapacity.compareTo(maxRestCapacity) > 0) { |
|
|
|
if (sumCapacity.compareTo(maxRestCapacity) > 0) { |
|
|
|
// 计算商(fullCount)和余数(remainder):divideAndRemainder返回[商, 余数]
|
|
|
|
// 计算商(fullCount)和余数(remainder):divideAndRemainder返回[商, 余数]
|
|
|
|
@ -789,7 +790,9 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
capacityList.add(sumCapacity); |
|
|
|
capacityList.add(sumCapacity); |
|
|
|
} |
|
|
|
} |
|
|
|
return capacityList; |
|
|
|
return capacityList; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取时间列表中的最早时间(字符串转LocalDateTime比较) |
|
|
|
* 获取时间列表中的最早时间(字符串转LocalDateTime比较) |
|
|
|
@ -839,6 +842,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
.map(dt -> dt.format(dateTimeFormatter)) |
|
|
|
.map(dt -> dt.format(dateTimeFormatter)) |
|
|
|
.orElse(null); |
|
|
|
.orElse(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void checkSchedulingOrder(List<YieldOrderEntity> list) { |
|
|
|
public void checkSchedulingOrder(List<YieldOrderEntity> list) { |
|
|
|
//判断待排产优先级,1级所有1级往后订单重新排产,2级订单重新排4/5级订单
|
|
|
|
//判断待排产优先级,1级所有1级往后订单重新排产,2级订单重新排4/5级订单
|
|
|
|
List<Integer> priorityList = list.stream().map(YieldOrderEntity::getPriorityAps).collect(Collectors.toList()); |
|
|
|
List<Integer> priorityList = list.stream().map(YieldOrderEntity::getPriorityAps).collect(Collectors.toList()); |
|
|
|
|