| | |
| | | for (Long id : ids) { |
| | | StockInRecord stockInRecord = stockInRecordMapper.selectById(id); |
| | | if (stockInRecord.getType().equals("0")) { |
| | | StockInventory stockInventory = stockInventoryMapper.selectOne(new LambdaQueryWrapper<StockInventory>().eq(StockInventory::getProductModelId, stockInRecord.getProductModelId())); |
| | | StockInventory stockInventory = stockInventoryMapper.selectOne( |
| | | new LambdaQueryWrapper<StockInventory>() |
| | | .eq(StockInventory::getProductModelId, stockInRecord.getProductModelId()) |
| | | .eq(StockInventory::getBatchNo, stockInRecord.getBatchNo()) |
| | | ); |
| | | if (stockInventory == null) { |
| | | throw new BaseException("库存记录中没有对应的产品,无法删除!!!"); |
| | | } else { |
| | |
| | | stockInventoryMapper.updateSubtractStockInventory(stockInRecordDto); |
| | | } |
| | | } else if (stockInRecord.getType().equals("1")) { |
| | | StockUninventory stockUninventory = stockUninventoryMapper.selectOne(new LambdaQueryWrapper<StockUninventory>().eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId())); |
| | | StockUninventory stockUninventory = stockUninventoryMapper.selectOne( |
| | | new LambdaQueryWrapper<StockUninventory>() |
| | | .eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId()) |
| | | .eq(StockUninventory::getBatchNo, stockInRecord.getBatchNo())); |
| | | if (stockUninventory == null) { |
| | | throw new BaseException("库存记录中没有对应的产品,无法删除!!!"); |
| | | } else { |