Browse Source

新增物料增加入库操作

hejq 7 years ago
parent
commit
f6c5faa349

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2451,6 +2451,7 @@ public class ProductServiceImpl implements ProductService {
         } else {
         } else {
             // 物料不存在,新增操作
             // 物料不存在,新增操作
             productInfo = product;
             productInfo = product;
+            inOutbound = recordInventory(product, null);
         }
         }
         if (null == productInfo.getStandard()) {
         if (null == productInfo.getStandard()) {
             productInfo.setStandard(IntegerConstant.NO_SHORT);
             productInfo.setStandard(IntegerConstant.NO_SHORT);
@@ -2583,7 +2584,7 @@ public class ProductServiceImpl implements ProductService {
         String type;
         String type;
         CommodityInOutbound inOutbound;
         CommodityInOutbound inOutbound;
         // 原库存不存在或者当前库存大于原库存,入库
         // 原库存不存在或者当前库存大于原库存,入库
-        if (existProduct.getErpReserve() == null || product.getErpReserve() > existProduct.getErpReserve()) {
+        if (null == existProduct || existProduct.getErpReserve() == null || product.getErpReserve() > existProduct.getErpReserve()) {
             type = InOutBoundType.OTHER_INBOUND;
             type = InOutBoundType.OTHER_INBOUND;
             inOutbound = new CommodityInOutbound(type);
             inOutbound = new CommodityInOutbound(type);
             goodsInventory(product.getErpReserve(), type, existProduct.getId());
             goodsInventory(product.getErpReserve(), type, existProduct.getId());