diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java index 57c3e72..acb9f9c 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java @@ -134,10 +134,9 @@ public class MaterialInventoryServiceImpl implements MaterialInventoryService { if (outNum == null) { throw exception0(BAD_REQUEST.getCode(),"更新库存失败:outNum为空!"); } - MaterialInventoryDO out = new MaterialInventoryDO(); - out.setInventoryId(materialInventory.getInventoryId()); - out.setOutTotalNum(materialInventory.getInventoryTotalNum() + outNum); - out.setCurrentNum(materialInventory.getCurrentNum() - outNum); + materialInventory.setInventoryId(materialInventory.getInventoryId()); + materialInventory.setOutTotalNum(materialInventory.getInventoryTotalNum() + outNum); + materialInventory.setCurrentNum(materialInventory.getCurrentNum() - outNum); return materialInventoryMapper.updateById(materialInventory); }