| | |
| | | } |
| | | productOrderMapper.updateById(productOrder); |
| | | } |
| | | //如果报废数量>0,需要进入报废的库存 |
| | | if (ObjectUtils.isNotEmpty(dto.getScrapQty())) { |
| | | if (dto.getScrapQty().compareTo(BigDecimal.ZERO) > 0) { |
| | | stockUtils.addUnStock(productModel.getId(), dto.getScrapQty(), StockInUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode(), productionProductMain.getId()); |
| | | } |
| | | } |
| | | |
| | | //nextAddProductMain(productionProductOutput) // 由于需要审核,所以需要拆封下来 |
| | | return true; |
| | | } |
| | |
| | | .build(); |
| | | salesLedgerProductionAccountingMapper.insert(salesLedgerProductionAccounting); |
| | | } |
| | | |
| | | //如果报废数量>0,需要进入报废的库存 |
| | | if (ObjectUtils.isNotEmpty(productionProductOutput.getScrapQty())) { |
| | | if (productionProductOutput.getScrapQty().compareTo(BigDecimal.ZERO) > 0) { |
| | | stockUtils.addUnStock(productModel.getId(), productionProductOutput.getScrapQty(), StockInUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode(), productionProductMain.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | BigDecimal scrapQty = productionProductOutput.getScrapQty() == null ? BigDecimal.ZERO : productionProductOutput.getScrapQty(); |
| | | BigDecimal completeQty = productWorkOrder.getCompleteQuantity() == null ? BigDecimal.ZERO : productWorkOrder.getCompleteQuantity(); |
| | | |
| | | BigDecimal validQuantity = outputQty.subtract(scrapQty); |
| | | // 必须为审核通过的才会减少数量 |
| | | |
| | | productWorkOrder.setCompleteQuantity(completeQty.subtract(validQuantity)); |
| | | |
| | | BigDecimal validQuantity = outputQty.subtract(scrapQty); |
| | | if(productionProductMain.getAuditStatus() != 2){ |
| | | productWorkOrder.setCompleteQuantity(completeQty.subtract(validQuantity).max(BigDecimal.ZERO)); |
| | | } |
| | | productWorkOrder.setActualEndTime(null); |
| | | productWorkOrderMapper.updateById(productWorkOrder); |
| | | } else { |