|
|
|
|
@ -619,6 +619,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
isSchecuding = false; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
log.info("开始获取设备资源:" + DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
Map<Integer, List<EquipAbilityEntity>> equipAbilityMap = equipAbilityList.stream().collect(Collectors.groupingBy(EquipAbilityEntity::getEquipOrder)); |
|
|
|
|
|
|
|
|
|
//匹配设备资源
|
|
|
|
|
@ -660,6 +661,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
isSchecuding = false; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
log.info("已获取设备资源:" + DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
//设备资源按照时间段分组并按时间排序,然后再每个组内按照剩余产能倒序排序
|
|
|
|
|
Map<LocalDateTime, List<EquipResourceEntity>> equipResourceMap = equipResourceList.stream() |
|
|
|
|
.collect(Collectors.groupingBy( |
|
|
|
|
@ -679,6 +681,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
) |
|
|
|
|
)); |
|
|
|
|
//计算生产所需产能
|
|
|
|
|
log.info("开始计算所需产能:" + DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
BigDecimal sumCapacity = order.getYieldType() == YieldOrderEnum.YIELD_TYPE_1.getCode() ? order.getYpArea().multiply(BigDecimal.valueOf(order.getYpQty())) : BigDecimal.valueOf(order.getYpQty()); |
|
|
|
|
//需要判断设备额定生产能力是否满足订单总产能,如果不满足,则需要把总产能进行拆分
|
|
|
|
|
List<BigDecimal> capacityList = capacitySplit(equipResourceMap, sumCapacity); |
|
|
|
|
@ -801,6 +804,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
log.info("匹配设备资源结束:" + DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
if(CollectionUtils.isNotEmpty(processPlanList)){ |
|
|
|
|
log.info("设备排产用到的资源是:" + JSONObject.toJSONString(processPlanList)); |
|
|
|
|
WorkPlanEntity workPlan = new WorkPlanEntity(); |
|
|
|
|
|