Browse Source

库存接口

24282 1 year ago
parent
commit
a728f34bd4

+ 3 - 1
sd-business/src/main/java/com/sd/business/service/inventory/impl/InventoryServiceImpl.java

@@ -161,7 +161,9 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
                     if (bomSpec == null) {
                         throw new ServiceException("未知bom规格id:" + bomSpecId);
                     }
-                    throw new ServiceException("出库失败,品名为:" + bomSpec.getName() + "的bom库存不足");
+                    throw new ServiceException("出库失败,品名为:" + bomSpec.getName() + "的bom库存不足,库存为:" +
+                            (inventory == null ? BigDecimal.ZERO : inventory.getQuantity()) +
+                            ",需要出库:" + quantity);
                 }
 
                 // 计算出库结存单价

+ 1 - 1
sd-business/src/main/java/com/sd/business/service/production/impl/StockPreparationServiceImpl.java

@@ -104,7 +104,7 @@ public class StockPreparationServiceImpl implements StockPreparationService {
                 .eq(OrderSku::getStockPreparationStatus, StatusConstant.NO)
                 .in(BaseIdPo::getId, orderSkuIdList));
 
-        if (orderSkuIdList.size() == 0) {
+        if (orderSkuList.size() == 0) {
             return;
         }