huminmin
15 小时以前 ba4f2ca4b3ae845d2bd1e92338b948a8f95ffaaa
src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
@@ -104,8 +104,8 @@
                    stockInRecordDto.setQualitity(stockInRecord.getStockInNum());
                    stockInventoryMapper.updateSubtractStockInventory(stockInRecordDto);
                }
            }else if (stockInRecord.getType().equals("1")) {
                String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getRecordType());
            }else if (stockInRecord.getType().equals("1") || stockInRecord.getType().equals("2")) {
                String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getType());
                LambdaQueryWrapper<StockUninventory> eq = new LambdaQueryWrapper<StockUninventory>()
                        .eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId())
                        .eq(StockUninventory::getType, uninventoryType);
@@ -278,9 +278,9 @@
                    } else {
                        stockInventoryMapper.updateAddStockInventory(stockInventoryDto);
                    }
                } else if ("1".equals(stockInRecord.getType())) {
                } else if ("1".equals(stockInRecord.getType()) || "2".equals(stockInRecord.getType())) {
                    // 不合格入库 -> 先查库存,存在则更新,不存在则新增
                    String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getRecordType());
                    String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getType());
                    StockUninventory stockUninventory = getStockUninventory(stockInRecord.getProductModelId(), stockInRecord.getBatchNo(), uninventoryType);
                    StockUninventoryDto stockUninventoryDto = new StockUninventoryDto();
                    stockUninventoryDto.setProductModelId(stockInRecord.getProductModelId());
@@ -310,8 +310,8 @@
        return items.size();
    }
    private String resolveUninventoryTypeByInRecordType(String recordType) {
        if (StockInQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode().equals(recordType)) {
    private String resolveUninventoryTypeByInRecordType(String stockInType) {
        if ("2".equals(stockInType)) {
            return WASTE_TYPE;
        }
        return UNQUALIFIED_TYPE;