| | |
| | | } |
| | | if(flowCardWeight>0){ |
| | | flowCardWeight = inWeight - flowCardWeight; |
| | | shelfQuantity = (int) (flowCardWeight / |
| | | //按照当前流程卡剩余重量,计算当前流程卡剩余数量 |
| | | int remainingQuantity = (int) (flowCardWeight / |
| | | (orderDetail.getHeight() |
| | | * orderDetail.getWidth() |
| | | * glassThickness |
| | | * 2.5 / 1000000)); |
| | | shelfQuantity =Math.min(Math.min(Math.min(shelfQuantityByWeight, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)),shelfQuantity),remainingQuantity); |
| | | if (shelfQuantity == 0) { |
| | | shelfQuantity = Math.min(shelfQuantityByWeight, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)); |
| | | flowCardNo += 1; |
| | | } |
| | | System.out.println(orderDetail.getOrderNumber()+":"+shelfQuantity); |
| | | } |
| | | |
| | | } |
| | | //取最小值 |
| | | Integer maxQuantity = 0; |
| | | //Integer maxQuantity = 0; |
| | | while (orderDetail.getQuantity() > 0) { |
| | | OrderDetail newOrderDetail = new OrderDetail(); |
| | | //当死循环中,当前架子剩余数量为0时,重新计算架子剩余数量 |
| | |
| | | } |
| | | String processId = productionId + String.format("%03d", flowCardNo); |
| | | //取最小值 |
| | | maxQuantity = Math.min(shelfQuantity, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)); |
| | | //maxQuantity = Math.min(shelfQuantity, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)); |
| | | //maxQuantity = Math.min(shelfQuantity, shelfMaxQuantityByThickness); |
| | | |
| | | /*System.out.println("订单序号:"+orderDetail.getOrderNumber()); |
| | | System.out.println(shelfQuantity + "," + "," + shelfMaxQuantityByThickness); |
| | | System.out.println(flowCardNo + "," + maxQuantity); |
| | | System.out.println("------");*/ |
| | | if(shelfQuantity<=0){ |
| | | return false; |
| | | } |
| | | |
| | | if (orderDetail.getQuantity() > maxQuantity) { |
| | | if (orderDetail.getQuantity() > shelfQuantity) { |
| | | newOrderDetail.setProcessId(processId); |
| | | newOrderDetail.setQuantity(Long.valueOf(maxQuantity)); |
| | | newOrderDetail.setQuantity(Long.valueOf(shelfQuantity)); |
| | | newOrderDetail.setHeight(orderDetail.getHeight()); |
| | | newOrderDetail.setWidth(orderDetail.getWidth()); |
| | | newOrderDetail.setOrderNumber(orderDetail.getOrderNumber()); |
| | | newOrderDetail.setShape(orderDetail.getShape()); |
| | | newOrderDetail.setLandingSequence(flowCardNo); |
| | | orderDetailList.add(newOrderDetail); |
| | | orderDetail.setQuantity(orderDetail.getQuantity() - maxQuantity); |
| | | orderDetail.setQuantity(orderDetail.getQuantity() - shelfQuantity); |
| | | flowCardNo += 1; |
| | | shelfQuantity = shelfQuantity - maxQuantity; |
| | | shelfQuantity = shelfQuantity - shelfQuantity; |
| | | } else { |
| | | newOrderDetail.setProcessId(processId); |
| | | newOrderDetail.setQuantity(orderDetail.getQuantity()); |