buhuazhen
昨天 956481188a15a01b6c4372a47e95a6aca3100956
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -221,11 +221,15 @@
            ProcurementRecordOut procurementRecordOut1 = procurementRecordOutMapper.selectCode(dateFormat.format(now));
            Long aLong = procurementRecordOut1 == null ? 1L : Long.valueOf(procurementRecordOut1.getCode().split("LS" + dateFormat.format(now))[1]);
            // 查询采购入库记录
            List<ProcurementRecordStorage> procurementRecordStorages = procurementRecordMapper.selectList(new LambdaQueryWrapper<ProcurementRecordStorage>()
                    .in(ProcurementRecordStorage::getSalesLedgerProductId, salesLedgerProducts.stream()
            LambdaQueryWrapper<ProcurementRecordStorage> procurementRecordStorageLambdaQueryWrapper = new LambdaQueryWrapper<>();
            if (!org.springframework.util.CollectionUtils.isEmpty(salesLedgerProducts)) {
                procurementRecordStorageLambdaQueryWrapper.in(ProcurementRecordStorage::getSalesLedgerProductId, salesLedgerProducts.stream()
                            .map(SalesLedgerProduct::getId)
                            .collect(Collectors.toList()))
                    .orderByDesc(ProcurementRecordStorage::getInboundNum));
                        .collect(Collectors.toList()));
            }
            procurementRecordStorageLambdaQueryWrapper.orderByDesc(ProcurementRecordStorage::getInboundNum);
            List<ProcurementRecordStorage> procurementRecordStorages = procurementRecordMapper.selectList(procurementRecordStorageLambdaQueryWrapper);
            if(CollectionUtils.isNotEmpty(procurementRecordStorages)) {
                // 生产扣除采购库存原料
                BigDecimal quantity = productionProductInput.getQuantity();