|
|
|
@ -750,7 +750,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
log.info("当前订单是:" + order.getId() + ",工序是:" + craft.getId()+",获取到的设备资源是:[作业中心:" + equipResource.getWorkCenterId() + ",工艺能力:" + equipResource.getCraftId() + ",工序:" + equipResource.getProcessId() +",资源id是:" + equipResource.getId() + "]"); |
|
|
|
log.info("当前订单是:" + order.getId() + ",工序是:" + craft.getId()+",获取到的设备资源是:[作业中心:" + equipResource.getWorkCenterId() + ",工艺能力:" + equipResource.getCraftId() + ",工序:" + equipResource.getProcessId() +",资源id是:" + equipResource.getId() + "]"); |
|
|
|
//更新剩余产能
|
|
|
|
//更新剩余产能
|
|
|
|
equipResource.setRestCapacity(equipResource.getRestCapacity().subtract(capacity)); |
|
|
|
equipResource.setRestCapacity(equipResource.getRestCapacity().subtract(capacity)); |
|
|
|
|
|
|
|
//当剩余产能不足20%时,更新为已使用
|
|
|
|
|
|
|
|
if(equipResource.getRestCapacity().divide(equipResource.getTotalCapacity(),2,RoundingMode.HALF_UP).compareTo(new BigDecimal("0.2")) < 0){ |
|
|
|
equipResource.setIsUsed("1"); |
|
|
|
equipResource.setIsUsed("1"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (order.getYieldType() != YieldOrderEnum.YIELD_TYPE_1.getCode() && sameMap.get("glassCode") != null) { |
|
|
|
if (order.getYieldType() != YieldOrderEnum.YIELD_TYPE_1.getCode() && sameMap.get("glassCode") != null) { |
|
|
|
equipResource.setGlassCode(sameMap.get("glassCode").toString()); |
|
|
|
equipResource.setGlassCode(sameMap.get("glassCode").toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -795,6 +799,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if(CollectionUtils.isNotEmpty(processPlanList)){ |
|
|
|
if(CollectionUtils.isNotEmpty(processPlanList)){ |
|
|
|
|
|
|
|
log.info("设备排产用到的资源是:" + JSONObject.toJSONString(processPlanList)); |
|
|
|
WorkPlanEntity workPlan = new WorkPlanEntity(); |
|
|
|
WorkPlanEntity workPlan = new WorkPlanEntity(); |
|
|
|
BeanUtils.copyProperties(processPlanList.get(0),workPlan); |
|
|
|
BeanUtils.copyProperties(processPlanList.get(0),workPlan); |
|
|
|
workPlan.setPlanStartTime(processPlanList.get(0).getPlanStartTime()); |
|
|
|
workPlan.setPlanStartTime(processPlanList.get(0).getPlanStartTime()); |
|
|
|
@ -802,6 +807,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
String equipCode = processPlanList.stream().map(WorkPlanEntity::getEquipCode).collect(Collectors.joining(",")); |
|
|
|
String equipCode = processPlanList.stream().map(WorkPlanEntity::getEquipCode).collect(Collectors.joining(",")); |
|
|
|
String equipName = processPlanList.stream().map(WorkPlanEntity::getEquipName).collect(Collectors.joining(",")); |
|
|
|
String equipName = processPlanList.stream().map(WorkPlanEntity::getEquipName).collect(Collectors.joining(",")); |
|
|
|
String equipResourceId = processPlanList.stream().map(WorkPlanEntity::getEquipResourceId).map(String::valueOf).collect(Collectors.joining(",")); |
|
|
|
String equipResourceId = processPlanList.stream().map(WorkPlanEntity::getEquipResourceId).map(String::valueOf).collect(Collectors.joining(",")); |
|
|
|
|
|
|
|
log.info("设备排产占用的资源ID是:" + equipResourceId); |
|
|
|
Double hourQuota = processPlanList.stream().mapToDouble(WorkPlanEntity::getHourQuota).sum(); |
|
|
|
Double hourQuota = processPlanList.stream().mapToDouble(WorkPlanEntity::getHourQuota).sum(); |
|
|
|
workPlan.setEquipCode(equipCode); |
|
|
|
workPlan.setEquipCode(equipCode); |
|
|
|
workPlan.setEquipName(equipName); |
|
|
|
workPlan.setEquipName(equipName); |
|
|
|
|