| | |
| | | BigDecimal reduce = productionScheduling.stream() |
| | | .map(ProductionScheduling::getSchedulingNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | if(reduce.compareTo(productionScheduling.get(0).getProductionQuantity()) < 0){ |
| | | if(reduce.compareTo(productionScheduling.get(0).getProductionQuantity()) > 0){ |
| | | return false; |
| | | } |
| | | Production production = productionMapper.selectById(productionScheduling.get(0).getProductionId()); |
| | | if(production == null){ |
| | | throw new RuntimeException("生产订单为空"); |
| | | } |
| | | production.setPendingQuantity(production.getPendingQuantity().add(reduce)); |
| | | production.setStatus(2); |
| | | if(reduce.compareTo(productionScheduling.get(0).getProductionQuantity()) == 0){ |
| | | production.setStatus(3); |